diff options
author | Hridya Valsaraju <hridya@google.com> | 2019-04-04 13:43:29 -0700 |
---|---|---|
committer | Hridya Valsaraju <hridya@google.com> | 2019-04-05 11:30:21 -0700 |
commit | 61a5bc6cf4cf22186505d87db31a449ed960818e (patch) | |
tree | 4180033f20d41ffc946d47924c3060b9dc73e67d /fastboot/fuzzy_fastboot/main.cpp | |
parent | 21aa749ec71e44bdde61f8d6173a18350d1344e5 (diff) |
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
Diffstat (limited to 'fastboot/fuzzy_fastboot/main.cpp')
-rw-r--r-- | fastboot/fuzzy_fastboot/main.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/fastboot/fuzzy_fastboot/main.cpp b/fastboot/fuzzy_fastboot/main.cpp index 7ffc7d57c..a40bc27ef 100644 --- a/fastboot/fuzzy_fastboot/main.cpp +++ b/fastboot/fuzzy_fastboot/main.cpp @@ -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", ¤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) { |