Add test case: delete snapshot when driver not initialized
This patch add test case: when deleting snapshot, volume driver is not ready, the snapshot status will be set 'error_deleting'. Change-Id: I71b6071026b3b60c5fb3a0d72149f2f3c529af68
This commit is contained in:
parent
da34b35579
commit
26bce3edd9
|
@ -583,3 +583,16 @@ class SnapshotTestCase(base.BaseVolumeTestCase):
|
|||
self.volume.manage_existing_snapshot,
|
||||
self.context,
|
||||
snap)
|
||||
|
||||
def test_delete_snapshot_driver_not_initialized(self):
|
||||
volume = tests_utils.create_volume(self.context, **self.volume_params)
|
||||
snapshot = tests_utils.create_snapshot(self.context, volume.id)
|
||||
|
||||
self.volume.driver._initialized = False
|
||||
self.assertRaises(exception.DriverNotInitialized,
|
||||
self.volume.delete_snapshot,
|
||||
self.context, snapshot)
|
||||
|
||||
snapshot.refresh()
|
||||
self.assertEqual(fields.SnapshotStatus.ERROR_DELETING,
|
||||
snapshot.status)
|
||||
|
|
Loading…
Reference in New Issue