Skip to content

Commit

Permalink
Merge "Tests: Improve cascade delete coverage"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Jun 18, 2021
2 parents 7a854c1 + 8f6a3ca commit fa05c2e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cinder/tests/unit/volume/test_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,20 @@ def test_unmanage_encrypted_volume_fails(self):
unmanage_only=True)
self.volume.delete_volume(self.context, volume)

def test_unmanage_cascade_delete_fails(self):
volume = tests_utils.create_volume(
self.context,
**self.volume_params)
self.volume.create_volume(self.context, volume)
manager = vol_manager.VolumeManager()
self.assertRaises(exception.Invalid,
manager.delete_volume,
self.context,
volume,
unmanage_only=True,
cascade=True)
self.volume.delete_volume(self.context, volume)

def test_get_volume_different_tenant(self):
"""Test can't get volume of another tenant when viewable_admin_meta."""
volume = tests_utils.create_volume(self.context,
Expand Down

0 comments on commit fa05c2e

Please sign in to comment.