aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand SIMONNET <bsimonnet@chromium.org>2015-07-21 15:42:04 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-22 05:02:53 +0000
commit336d2c323e500ae23dccfa9be827024c1772ef7c (patch)
treef50996c035fc6848480559fa423f12f13bab1d21
parenta554a499270573a8f10e43e305b7d4cc153c5450 (diff)
downloadlibbrillo-336d2c323e500ae23dccfa9be827024c1772ef7c.tar.gz
libchromeos: Use sh instead of bash in process_test.
Don't rely on bash for sh functionality. This allows the unittests to run on system that don't have bash. BUG=None TEST=`FEATURES=test emerge-gizmo libchromeos --nodeps` works. CQ-DEPEND=CL:287404 Change-Id: Icf3ae17a9a4f0553e5c623927d25d60303b88306 Reviewed-on: https://chromium-review.googlesource.com/287405 Trybot-Ready: Bertrand Simonnet <bsimonnet@chromium.org> Tested-by: Bertrand Simonnet <bsimonnet@chromium.org> Reviewed-by: Christopher Wiley <wiley@chromium.org> Reviewed-by: Dan Erat <derat@chromium.org> Commit-Queue: Bertrand Simonnet <bsimonnet@chromium.org>
-rw-r--r--chromeos/process_test.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/chromeos/process_test.cc b/chromeos/process_test.cc
index eac0996..130f75e 100644
--- a/chromeos/process_test.cc
+++ b/chromeos/process_test.cc
@@ -16,7 +16,7 @@
using base::FilePath;
// This test assumes the following standard binaries are installed.
-static const char kBinBash[] = "/bin/bash";
+static const char kBinSh[] = "/bin/sh";
static const char kBinCat[] = "/bin/cat";
static const char kBinCp[] = "/bin/cp";
static const char kBinEcho[] = "/bin/echo";
@@ -134,7 +134,7 @@ TEST_F(ProcessTest, BadExecutable) {
void ProcessTest::CheckStderrCaptured() {
std::string contents;
- process_.AddArg(kBinBash);
+ process_.AddArg(kBinSh);
process_.AddArg("-c");
process_.AddArg("echo errormessage 1>&2 && exit 1");
EXPECT_EQ(1, process_.Run());
@@ -161,7 +161,7 @@ FilePath ProcessTest::GetFdPath(int fd) {
TEST_F(ProcessTest, RedirectStderrUsingPipe) {
std::string contents;
process_.RedirectOutput("");
- process_.AddArg(kBinBash);
+ process_.AddArg(kBinSh);
process_.AddArg("-c");
process_.AddArg("echo errormessage >&2 && exit 1");
process_.RedirectUsingPipe(STDERR_FILENO, false);
@@ -258,7 +258,7 @@ TEST_F(ProcessTest, NoParams) {
}
TEST_F(ProcessTest, SegFaultHandling) {
- process_.AddArg(kBinBash);
+ process_.AddArg(kBinSh);
process_.AddArg("-c");
process_.AddArg("kill -SEGV $$");
EXPECT_EQ(-1, process_.Run());