Test is-logical command for vendor and boot partitions.
Vendor must be a logical partition and boot must not be a logical
partition.
Test: fuzzy_fastboot --gtest_filter=*Logical*
Bug: 117220134
Change-Id: Ifc6f2f715ca92cd1fe779e8fce2d6a10a1f140b9
diff --git a/fastboot/fuzzy_fastboot/main.cpp b/fastboot/fuzzy_fastboot/main.cpp
index 7ffc7d5..a40bc27 100644
--- a/fastboot/fuzzy_fastboot/main.cpp
+++ b/fastboot/fuzzy_fastboot/main.cpp
@@ -201,18 +201,28 @@
ASSERT_TRUE(UserSpaceFastboot());
std::string has_slot;
EXPECT_EQ(fb->GetVar("has-slot:system", &has_slot), SUCCESS) << "getvar has-slot:system failed";
- std::string is_logical_cmd;
+ std::string is_logical_cmd_system = "is-logical:system";
+ std::string is_logical_cmd_vendor = "is-logical:vendor";
+ std::string is_logical_cmd_boot = "is-logical:boot";
if (has_slot == "yes") {
std::string current_slot;
- EXPECT_EQ(fb->GetVar("current-slot", ¤t_slot), SUCCESS)
+ ASSERT_EQ(fb->GetVar("current-slot", ¤t_slot), SUCCESS)
<< "getvar current-slot failed";
- is_logical_cmd = "is-logical:system_" + current_slot;
- } else {
- is_logical_cmd = "is-logical:system";
+ std::string slot_suffix = "_" + current_slot;
+ is_logical_cmd_system += slot_suffix;
+ is_logical_cmd_vendor += slot_suffix;
+ is_logical_cmd_boot += slot_suffix;
}
std::string is_logical;
- EXPECT_EQ(fb->GetVar(is_logical_cmd, &is_logical), SUCCESS) << "getvar is-logical failed";
- ASSERT_EQ(is_logical, "yes");
+ EXPECT_EQ(fb->GetVar(is_logical_cmd_system, &is_logical), SUCCESS)
+ << "system must be a logical partition";
+ EXPECT_EQ(is_logical, "yes");
+ EXPECT_EQ(fb->GetVar(is_logical_cmd_vendor, &is_logical), SUCCESS)
+ << "vendor must be a logical partition";
+ EXPECT_EQ(is_logical, "yes");
+ EXPECT_EQ(fb->GetVar(is_logical_cmd_boot, &is_logical), SUCCESS)
+ << "boot must not be logical partition";
+ EXPECT_EQ(is_logical, "no");
}
TEST_F(LogicalPartitionCompliance, FastbootRebootTest) {