• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


Commit MetaInfo

Revision06a80456743c0ad26ec360cce4c262bd8f2d25ca (tree)
Zeit2019-05-16 07:37:02
AutorHridya Valsaraju <hridya@goog...>
Commiterandroid-build-merger

Log Message

Merge "Allow CreateResizeDeleteLP test case to run on non-A/B devices" into qt-dev
am: 2c4803838e

Change-Id: Ie24284987a4423a67e2e26bd8095e96a428761e3

Ändern Zusammenfassung

Diff

--- a/fastboot/fuzzy_fastboot/main.cpp
+++ b/fastboot/fuzzy_fastboot/main.cpp
@@ -244,16 +244,29 @@ TEST_F(LogicalPartitionCompliance, FastbootRebootTest) {
244244 // Testing creation/resize/delete of logical partitions
245245 TEST_F(LogicalPartitionCompliance, CreateResizeDeleteLP) {
246246 ASSERT_TRUE(UserSpaceFastboot());
247+ std::string test_partition_name = "test_partition";
248+ std::string slot_count;
249+ // Add suffix to test_partition_name if device is slotted.
250+ EXPECT_EQ(fb->GetVar("slot-count", &slot_count), SUCCESS) << "getvar slot-count failed";
251+ int32_t num_slots = strtol(slot_count.c_str(), nullptr, 10);
252+ if (num_slots > 0) {
253+ std::string current_slot;
254+ EXPECT_EQ(fb->GetVar("current-slot", &current_slot), SUCCESS)
255+ << "getvar current-slot failed";
256+ std::string slot_suffix = "_" + current_slot;
257+ test_partition_name += slot_suffix;
258+ }
259+
247260 GTEST_LOG_(INFO) << "Testing 'fastboot create-logical-partition' command";
248- EXPECT_EQ(fb->CreatePartition("test_partition_a", "0"), SUCCESS)
261+ EXPECT_EQ(fb->CreatePartition(test_partition_name, "0"), SUCCESS)
249262 << "create-logical-partition failed";
250263 GTEST_LOG_(INFO) << "Testing 'fastboot resize-logical-partition' command";
251- EXPECT_EQ(fb->ResizePartition("test_partition_a", "4096"), SUCCESS)
264+ EXPECT_EQ(fb->ResizePartition(test_partition_name, "4096"), SUCCESS)
252265 << "resize-logical-partition failed";
253266 std::vector<char> buf(4096);
254267
255268 GTEST_LOG_(INFO) << "Flashing a logical partition..";
256- EXPECT_EQ(fb->FlashPartition("test_partition_a", buf), SUCCESS)
269+ EXPECT_EQ(fb->FlashPartition(test_partition_name, buf), SUCCESS)
257270 << "flash logical -partition failed";
258271 GTEST_LOG_(INFO) << "Rebooting to bootloader mode";
259272 // Reboot to bootloader mode and attempt to flash the logical partitions
@@ -262,7 +275,7 @@ TEST_F(LogicalPartitionCompliance, CreateResizeDeleteLP) {
262275 ReconnectFastbootDevice();
263276 ASSERT_FALSE(UserSpaceFastboot());
264277 GTEST_LOG_(INFO) << "Attempt to flash a logical partition..";
265- EXPECT_EQ(fb->FlashPartition("test_partition", buf), DEVICE_FAIL)
278+ EXPECT_EQ(fb->FlashPartition(test_partition_name, buf), DEVICE_FAIL)
266279 << "flash logical partition must fail in bootloader";
267280 GTEST_LOG_(INFO) << "Rebooting back to fastbootd mode";
268281 fb->RebootTo("fastboot");
@@ -270,7 +283,7 @@ TEST_F(LogicalPartitionCompliance, CreateResizeDeleteLP) {
270283 ReconnectFastbootDevice();
271284 ASSERT_TRUE(UserSpaceFastboot());
272285 GTEST_LOG_(INFO) << "Testing 'fastboot delete-logical-partition' command";
273- EXPECT_EQ(fb->DeletePartition("test_partition_a"), SUCCESS)
286+ EXPECT_EQ(fb->DeletePartition(test_partition_name), SUCCESS)
274287 << "delete logical-partition failed";
275288 }
276289