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
This commit is contained in:
Hridya Valsaraju 2019-04-04 13:43:29 -07:00
parent 21aa749ec7
commit 61a5bc6cf4

View file

@ -201,18 +201,28 @@ TEST_F(LogicalPartitionCompliance, GetVarIsLogical) {
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", &current_slot), SUCCESS)
ASSERT_EQ(fb->GetVar("current-slot", &current_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) {