diff options
author | Alex Deymo <deymo@google.com> | 2016-04-04 19:09:22 -0700 |
---|---|---|
committer | Alex Deymo <deymo@google.com> | 2016-04-05 08:32:58 -0700 |
commit | 20e3960e245f6dfa57fa5c9124b0fd33e679f723 (patch) | |
tree | 1e76cf3bc9913502f4a71a1fb6d0e810c963e8ac /common/subprocess_unittest.cc | |
parent | 0d29854cf5bb05a22cf161b50052539aa420a36e (diff) |
Make transition to "postinstall" domain explicit.
When running the postinstall program, we were relying on the automatic
transition between update_engine domain and postinstall, which required
postinstall_file to be an entrypoint for such domain. This patch makes
the transition explicit by calling setexeccon(3).
Bug: 28008031
TEST=make dist; Deployed an update to edison-eng: postinstall runs as "postinstall" domain.
Change-Id: I27d404886841e0bd39589f0274eaaf98929eeac9
Diffstat (limited to 'common/subprocess_unittest.cc')
-rw-r--r-- | common/subprocess_unittest.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/common/subprocess_unittest.cc b/common/subprocess_unittest.cc index 5ca44e80..d5e33bba 100644 --- a/common/subprocess_unittest.cc +++ b/common/subprocess_unittest.cc @@ -148,6 +148,7 @@ TEST_F(SubprocessTest, StderrNotIncludedInOutputTest) { {kBinPath "/sh", "-c", "echo on stdout; echo on stderr >&2"}, 0, {}, + nullptr, base::Bind(&ExpectedResults, 0, "on stdout\n"))); loop_.Run(); } @@ -158,6 +159,7 @@ TEST_F(SubprocessTest, PipeRedirectFdTest) { {kBinPath "/sh", "-c", "echo on pipe >&3"}, 0, {3}, + nullptr, base::Bind(&ExpectedDataOnPipe, &subprocess_, &pid, 3, "on pipe\n", 0)); EXPECT_NE(0, pid); @@ -174,10 +176,7 @@ TEST_F(SubprocessTest, PipeClosedWhenNotRedirectedTest) { const vector<string> cmd = {kBinPath "/sh", "-c", base::StringPrintf("echo on pipe >/proc/self/fd/%d", pipe.writer)}; EXPECT_TRUE(subprocess_.ExecFlags( - cmd, - 0, - {}, - base::Bind(&ExpectedResults, 1, ""))); + cmd, 0, {}, nullptr, base::Bind(&ExpectedResults, 1, ""))); loop_.Run(); } |