libsnapshot: Remove flaky image creation test.

This test has always been flaky, and is not testing something super
valuable: we know that image creation succeeds throughout the rest of
the suite, so it's not very interesting to know that it can succeed in a
low-space scenario.

The inverse test is much more valuable, since we want the correct status
code when creation fails due to low space.

Bug: 240391002
Test: vts_libsnapshot_test
Change-Id: I6235d11033d2f30efe530077b877863ba2574810
(cherry picked from commit 97e8a2f0e9)
This commit is contained in:
David Anderson 2022-08-11 22:12:19 -07:00
parent aee8ddbc46
commit 5b9c9ba1e0

View file

@ -2609,7 +2609,6 @@ class ImageManagerTest : public SnapshotTest, public WithParamInterface<uint64_t
}
void TearDown() override {
RETURN_IF_NON_VIRTUAL_AB();
return; // BUG(149738928)
EXPECT_TRUE(!image_manager_->BackingImageExists(kImageName) ||
image_manager_->DeleteBackingImage(kImageName));
@ -2618,19 +2617,6 @@ class ImageManagerTest : public SnapshotTest, public WithParamInterface<uint64_t
std::unique_ptr<LowSpaceUserdata> userdata_;
};
TEST_P(ImageManagerTest, CreateImageEnoughAvailSpace) {
if (userdata_->available_space() == 0) {
GTEST_SKIP() << "/data is full (" << userdata_->available_space()
<< " bytes available), skipping";
}
ASSERT_TRUE(image_manager_->CreateBackingImage(kImageName, userdata_->available_space(),
IImageManager::CREATE_IMAGE_DEFAULT))
<< "Should be able to create image with size = " << userdata_->available_space()
<< " bytes";
ASSERT_TRUE(image_manager_->DeleteBackingImage(kImageName))
<< "Should be able to delete created image";
}
TEST_P(ImageManagerTest, CreateImageNoSpace) {
uint64_t to_allocate = userdata_->free_space() + userdata_->bsize();
auto res = image_manager_->CreateBackingImage(kImageName, to_allocate,