update_engine: Use libchromeos to launch subprocesses.
The Subprocess class handles the execution of suprocesses in the
update_engine such as the post-install script and bspatch operations.
This patch migrates this class from using glib functions to use
libchromeos classes with equivalent functionality.
Callsites and unittests were updated to match the new interface.
BUG=chromium:499886
TEST=Unittest still pass. Deployed on link and cros flash another image
using a delta payload.
Change-Id: Ia64d39734e220675113f393a6049e9a9b0fe8409
Reviewed-on: https://chromium-review.googlesource.com/288837
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/update_attempter_unittest.cc b/update_attempter_unittest.cc
index 41a8232..8c6fa3d 100644
--- a/update_attempter_unittest.cc
+++ b/update_attempter_unittest.cc
@@ -110,12 +110,8 @@
// Finish initializing the attempter.
attempter_.Init();
-
- // We set the set_good_kernel command to a non-existent path so it fails to
- // run it. This avoids the async call to the command and continues the
- // update process right away. Tests testing that behavior can override the
- // default set_good_kernel command if needed.
- attempter_.set_good_kernel_cmd_ = "/path/to/non-existent/command";
+ // Don't run setgoodkernel command.
+ attempter_.skip_set_good_kernel_ = true;
}
void SetUp() override {
@@ -165,7 +161,6 @@
void TearDown() override {
test_utils::RecursiveUnlinkDir(test_dir_);
- EXPECT_EQ(0, MessageLoopRunMaxIterations(&loop_, 1));
}
public:
@@ -514,9 +509,7 @@
}
TEST_F(UpdateAttempterTest, UpdateTest) {
- loop_.PostTask(FROM_HERE,
- base::Bind(&UpdateAttempterTest::UpdateTestStart,
- base::Unretained(this)));
+ UpdateTestStart();
loop_.Run();
}