AU: Many minor cleanup changes
postinstall: Run postinst twice, once for pre-commit (ie, before we
mark the install partition bootable in the partition table), and
post-commit (for after we do). This behavior is needed for specific
types of firmware update.
download action: flush caches, as we found was necessary in
memento_updater.sh
omaha request prep action: update the names of keys we look for in
lsb-release, also get the AU server url from a file, rather than
hard-code it.
set bootable flag action: GPT support.
also, some misc utility functions.
BUG=None
TEST=attached unittests
Review URL: http://codereview.chromium.org/1881001
diff --git a/postinstall_runner_action_unittest.cc b/postinstall_runner_action_unittest.cc
index 7c1993e..9b19158 100644
--- a/postinstall_runner_action_unittest.cc
+++ b/postinstall_runner_action_unittest.cc
@@ -110,11 +110,13 @@
ASSERT_EQ(0, System(string("losetup ") + dev + " " + cwd + "/image.dat"));
ActionProcessor processor;
- ObjectFeederAction<string> feeder_action;
- feeder_action.set_obj(dev);
- PostinstallRunnerAction runner_action;
+ ObjectFeederAction<InstallPlan> feeder_action;
+ InstallPlan install_plan;
+ install_plan.install_path = dev;
+ feeder_action.set_obj(install_plan);
+ PostinstallRunnerAction runner_action(true);
BondActions(&feeder_action, &runner_action);
- ObjectCollectorAction<string> collector_action;
+ ObjectCollectorAction<InstallPlan> collector_action;
BondActions(&runner_action, &collector_action);
PostinstActionProcessorDelegate delegate;
processor.EnqueueAction(&feeder_action);
@@ -127,9 +129,10 @@
EXPECT_TRUE(delegate.success_set_);
EXPECT_EQ(do_losetup && !do_err_script, delegate.success_);
- EXPECT_EQ(do_losetup && !do_err_script, !collector_action.object().empty());
+ EXPECT_EQ(do_losetup && !do_err_script,
+ !collector_action.object().install_path.empty());
if (do_losetup && !do_err_script) {
- EXPECT_EQ(dev, collector_action.object());
+ EXPECT_TRUE(install_plan == collector_action.object());
}
struct stat stbuf;
@@ -148,7 +151,7 @@
// Death tests don't seem to be working on Hardy
TEST_F(PostinstallRunnerActionTest, DISABLED_RunAsRootDeathTest) {
ASSERT_EQ(0, getuid());
- PostinstallRunnerAction runner_action;
+ PostinstallRunnerAction runner_action(true);
ASSERT_DEATH({ runner_action.TerminateProcessing(); },
"postinstall_runner_action.h:.*] Check failed");
}