update_engine: Fake chromeos-setgoodkernel command for testing.
This patch fakes the chromeos-setgoodkernel command when running
unittests so the command doesn't attempt to run it. It also makes
Subprocess log the error message when there's a failure running
an async process.
BUG=chromium:401866
TEST=cros_workon_make update_engine --test
Change-Id: Ieca3216c57f6f9bc2f71a53e520575ae1fc19c0e
Reviewed-on: https://chromium-review.googlesource.com/212260
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index 437ff42..05cfd49 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -1150,7 +1150,7 @@
// the script runtime.
update_boot_flags_running_ = true;
LOG(INFO) << "Updating boot flags...";
- vector<string> cmd(1, "/usr/sbin/chromeos-setgoodkernel");
+ vector<string> cmd{set_good_kernel_cmd_};
if (!Subprocess::Get().Exec(cmd, StaticCompleteUpdateBootFlags, this)) {
CompleteUpdateBootFlags(1);
}