system/core
修訂 | 1e30c33a1a364d5064e3b916d34f0d480516d790 (tree) |
---|---|
時間 | 2019-04-09 07:31:25 |
作者 | Hridya Valsaraju <hridya@goog...> |
Commiter | Hridya Valsaraju |
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
Merged-In: Ifc6f2f715ca92cd1fe779e8fce2d6a10a1f140b9
(cherry picked from commit 61a5bc6cf4cf22186505d87db31a449ed960818e)
@@ -201,18 +201,28 @@ TEST_F(LogicalPartitionCompliance, GetVarIsLogical) { | ||
201 | 201 | ASSERT_TRUE(UserSpaceFastboot()); |
202 | 202 | std::string has_slot; |
203 | 203 | EXPECT_EQ(fb->GetVar("has-slot:system", &has_slot), SUCCESS) << "getvar has-slot:system failed"; |
204 | - std::string is_logical_cmd; | |
204 | + std::string is_logical_cmd_system = "is-logical:system"; | |
205 | + std::string is_logical_cmd_vendor = "is-logical:vendor"; | |
206 | + std::string is_logical_cmd_boot = "is-logical:boot"; | |
205 | 207 | if (has_slot == "yes") { |
206 | 208 | std::string current_slot; |
207 | - EXPECT_EQ(fb->GetVar("current-slot", ¤t_slot), SUCCESS) | |
209 | + ASSERT_EQ(fb->GetVar("current-slot", ¤t_slot), SUCCESS) | |
208 | 210 | << "getvar current-slot failed"; |
209 | - is_logical_cmd = "is-logical:system_" + current_slot; | |
210 | - } else { | |
211 | - is_logical_cmd = "is-logical:system"; | |
211 | + std::string slot_suffix = "_" + current_slot; | |
212 | + is_logical_cmd_system += slot_suffix; | |
213 | + is_logical_cmd_vendor += slot_suffix; | |
214 | + is_logical_cmd_boot += slot_suffix; | |
212 | 215 | } |
213 | 216 | std::string is_logical; |
214 | - EXPECT_EQ(fb->GetVar(is_logical_cmd, &is_logical), SUCCESS) << "getvar is-logical failed"; | |
215 | - ASSERT_EQ(is_logical, "yes"); | |
217 | + EXPECT_EQ(fb->GetVar(is_logical_cmd_system, &is_logical), SUCCESS) | |
218 | + << "system must be a logical partition"; | |
219 | + EXPECT_EQ(is_logical, "yes"); | |
220 | + EXPECT_EQ(fb->GetVar(is_logical_cmd_vendor, &is_logical), SUCCESS) | |
221 | + << "vendor must be a logical partition"; | |
222 | + EXPECT_EQ(is_logical, "yes"); | |
223 | + EXPECT_EQ(fb->GetVar(is_logical_cmd_boot, &is_logical), SUCCESS) | |
224 | + << "boot must not be logical partition"; | |
225 | + EXPECT_EQ(is_logical, "no"); | |
216 | 226 | } |
217 | 227 | |
218 | 228 | TEST_F(LogicalPartitionCompliance, FastbootRebootTest) { |