diff options
author | Hridya Valsaraju <hridya@google.com> | 2019-03-22 21:09:08 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-03-22 21:09:08 +0000 |
commit | d5b690993b48bb816abfa0c18016f26f173c303f (patch) | |
tree | 0afc344f5de6bed9515cd8b5f331583c16a9daeb /fastboot | |
parent | 605eab93c64754ed9e0650ecf20e658d6f7cf023 (diff) | |
parent | bcab240cbc44f6519f4617506a7b183cc19c7160 (diff) | |
download | system_core-d5b690993b48bb816abfa0c18016f26f173c303f.tar.gz system_core-d5b690993b48bb816abfa0c18016f26f173c303f.tar.bz2 system_core-d5b690993b48bb816abfa0c18016f26f173c303f.zip |
Merge "Fuzzy_fastboot must set back the original slot after test"
Diffstat (limited to 'fastboot')
-rw-r--r-- | fastboot/fuzzy_fastboot/fixtures.cpp | 5 | ||||
-rw-r--r-- | fastboot/fuzzy_fastboot/fixtures.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/fastboot/fuzzy_fastboot/fixtures.cpp b/fastboot/fuzzy_fastboot/fixtures.cpp index eb043ce36..c23da01a2 100644 --- a/fastboot/fuzzy_fastboot/fixtures.cpp +++ b/fastboot/fuzzy_fastboot/fixtures.cpp @@ -130,10 +130,14 @@ void FastBootTest::SetUp() { ASSERT_EQ(device_path, cb_scratch); // The path can not change } fb = std::unique_ptr<FastBootDriver>(new FastBootDriver(transport.get(), {}, true)); + // No error checking since non-A/B devices may not support the command + fb->GetVar("current-slot", &initial_slot); } void FastBootTest::TearDown() { EXPECT_TRUE(UsbStillAvailible()) << USB_PORT_GONE; + // No error checking since non-A/B devices may not support the command + fb->SetActive(initial_slot); TearDownSerial(); @@ -232,6 +236,7 @@ void FastBootTest::SetLockState(bool unlock, bool assert_change) { std::string FastBootTest::device_path = ""; std::string FastBootTest::cb_scratch = ""; +std::string FastBootTest::initial_slot = ""; int FastBootTest::serial_port = 0; template <bool UNLOCKED> diff --git a/fastboot/fuzzy_fastboot/fixtures.h b/fastboot/fuzzy_fastboot/fixtures.h index 9c955eae5..7c8d54d27 100644 --- a/fastboot/fuzzy_fastboot/fixtures.h +++ b/fastboot/fuzzy_fastboot/fixtures.h @@ -70,6 +70,7 @@ class FastBootTest : public testing::Test { // This is an annoying hack static std::string cb_scratch; static std::string device_path; + static std::string initial_slot; }; template <bool UNLOCKED> |