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/utils_unittest.cc b/utils_unittest.cc
index 5ab78cd..a66e739 100644
--- a/utils_unittest.cc
+++ b/utils_unittest.cc
@@ -125,4 +125,14 @@
EXPECT_FALSE(utils::StringHasSuffix(result, "XXXXXX"));
}
+TEST(UtilsTest, RootDeviceTest) {
+ EXPECT_EQ("/dev/sda", utils::RootDevice("/dev/sda3"));
+ EXPECT_EQ("/dev/mmc0", utils::RootDevice("/dev/mmc0p3"));
+}
+
+TEST(UtilsTest, PartitionNumberTest) {
+ EXPECT_EQ("3", utils::PartitionNumber("/dev/sda3"));
+ EXPECT_EQ("3", utils::PartitionNumber("/dev/mmc0p3"));
+}
+
} // namespace chromeos_update_engine