update_engine: Omit test LVM when LVM is not compiled in
On board where device-mapper USE flag is not set (and by extension)
lvm_stateful_partition is not set, do not run related tests.
The code will never be called and prevent an emerge failure.
BUG=b:262166536
TEST=CQ.
TEST=FEATURES=test emerge-viking update_engine
Cq-Depend: chromium:4945452
Change-Id: I60e39e53bf512f90538e8aee139e51c7dccf2ecb
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/4930209
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Commit-Queue: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
diff --git a/cros/boot_control_chromeos_unittest.cc b/cros/boot_control_chromeos_unittest.cc
index 55c9853..69fcfa6 100644
--- a/cros/boot_control_chromeos_unittest.cc
+++ b/cros/boot_control_chromeos_unittest.cc
@@ -154,6 +154,7 @@
EXPECT_FALSE(bootctl_.GetMiniOSVersion(output, &value));
}
+#if USE_LVM_STATEFUL_PARTITION
TEST_F(BootControlChromeOSTest, IsLvmStackEnabledTest) {
std::optional<brillo::PhysicalVolume> opt;
opt = brillo::PhysicalVolume(base::FilePath("/foo/bar"), nullptr);
@@ -175,5 +176,6 @@
// Check caching too.
EXPECT_FALSE(bootctl_.IsLvmStackEnabled(&mock_lvm));
}
+#endif // USE_LVM_STATEFUL_PARTITION
} // namespace chromeos_update_engine