Snap for 8050481 from 654bb5225b to sc-d2-release

Change-Id: I12339c67ba35bca911326f5677bc16fca950d792
This commit is contained in:
Android Build Coastguard Worker 2022-01-07 00:08:53 +00:00
commit 0c7166362a
1 changed files with 2 additions and 6 deletions

View File

@ -684,13 +684,9 @@ TEST(libdm, DeleteDeviceDeferredWaitsForLastReference) {
TEST(libdm, CreateEmptyDevice) {
DeviceMapper& dm = DeviceMapper::Instance();
ASSERT_TRUE(dm.CreateEmptyDevice("empty-device"));
auto guard = android::base::make_scope_guard([&]() { dm.DeleteDevice("empty-device", 5s); });
auto guard =
android::base::make_scope_guard([&]() { dm.DeleteDeviceIfExists("empty-device", 5s); });
// Empty device should be in suspended state.
ASSERT_EQ(DmDeviceState::SUSPENDED, dm.GetState("empty-device"));
std::string path;
ASSERT_TRUE(dm.WaitForDevice("empty-device", 5s, &path));
// Path should exist.
ASSERT_EQ(0, access(path.c_str(), F_OK));
}