Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b017a1cd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Test is-logical command for vendor and boot partitions." into qt-dev

parents 13d92df7 1e30c33a
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -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) {