devmapper: more precise way of checking if device is activated
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
This commit is contained in:
@@ -191,12 +191,13 @@ func testDeactivateThinDevice(t *testing.T, pool *PoolDevice) {
|
||||
}
|
||||
|
||||
for _, deviceName := range deviceList {
|
||||
assert.Assert(t, pool.IsActivated(deviceName))
|
||||
|
||||
err := pool.DeactivateDevice(context.Background(), deviceName, false)
|
||||
assert.NilError(t, err, "failed to remove '%s'", deviceName)
|
||||
}
|
||||
|
||||
err := pool.DeactivateDevice(context.Background(), "not-existing-device", false)
|
||||
assert.Assert(t, err != nil, "should return an error if trying to remove not existing device")
|
||||
assert.Assert(t, !pool.IsActivated(deviceName))
|
||||
}
|
||||
}
|
||||
|
||||
func testRemoveThinDevice(t *testing.T, pool *PoolDevice) {
|
||||
|
||||
Reference in New Issue
Block a user