|
|
@@ -18,14 +18,14 @@ import six
|
|
|
|
|
|
class CloudBlockStoreServiceTestCase(ProviderTestBase):
|
|
|
|
|
|
- @helpers.skipIfNoService(['block_store.volumes'])
|
|
|
+ @helpers.skipIfNoService(['storage.volumes'])
|
|
|
def test_crud_volume(self):
|
|
|
"""
|
|
|
Create a new volume, check whether the expected values are set,
|
|
|
and delete it
|
|
|
"""
|
|
|
def create_vol(name):
|
|
|
- return self.provider.block_store.volumes.create(
|
|
|
+ return self.provider.storage.volumes.create(
|
|
|
name,
|
|
|
1,
|
|
|
helpers.get_provider_test_data(self.provider, "placement"))
|
|
|
@@ -35,10 +35,10 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
|
|
|
vol.wait_for([VolumeState.DELETED, VolumeState.UNKNOWN],
|
|
|
terminal_states=[VolumeState.ERROR])
|
|
|
|
|
|
- sit.check_crud(self, self.provider.block_store.volumes, Volume,
|
|
|
+ sit.check_crud(self, self.provider.storage.volumes, Volume,
|
|
|
"cb_createvol", create_vol, cleanup_vol)
|
|
|
|
|
|
- @helpers.skipIfNoService(['block_store.volumes'])
|
|
|
+ @helpers.skipIfNoService(['storage.volumes'])
|
|
|
def test_attach_detach_volume(self):
|
|
|
"""
|
|
|
Create a new volume, and attempt to attach it to an instance
|
|
|
@@ -55,7 +55,7 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
|
|
|
test_instance = helpers.get_test_instance(
|
|
|
self.provider, name, subnet=subnet)
|
|
|
|
|
|
- test_vol = self.provider.block_store.volumes.create(
|
|
|
+ test_vol = self.provider.storage.volumes.create(
|
|
|
name, 1, test_instance.zone_id)
|
|
|
with helpers.cleanup_action(lambda: test_vol.delete()):
|
|
|
test_vol.wait_till_ready()
|
|
|
@@ -68,7 +68,7 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
|
|
|
[VolumeState.AVAILABLE],
|
|
|
terminal_states=[VolumeState.ERROR, VolumeState.DELETED])
|
|
|
|
|
|
- @helpers.skipIfNoService(['block_store.volumes'])
|
|
|
+ @helpers.skipIfNoService(['storage.volumes'])
|
|
|
def test_volume_properties(self):
|
|
|
"""
|
|
|
Test volume properties
|
|
|
@@ -86,7 +86,7 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
|
|
|
test_instance = helpers.get_test_instance(
|
|
|
self.provider, name, subnet=subnet)
|
|
|
|
|
|
- test_vol = self.provider.block_store.volumes.create(
|
|
|
+ test_vol = self.provider.storage.volumes.create(
|
|
|
name, 1, test_instance.zone_id, description=vol_desc)
|
|
|
with helpers.cleanup_action(lambda: test_vol.delete()):
|
|
|
test_vol.wait_till_ready()
|
|
|
@@ -128,7 +128,7 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
|
|
|
[VolumeState.AVAILABLE],
|
|
|
terminal_states=[VolumeState.ERROR, VolumeState.DELETED])
|
|
|
|
|
|
- @helpers.skipIfNoService(['block_store.snapshots'])
|
|
|
+ @helpers.skipIfNoService(['storage.snapshots'])
|
|
|
def test_crud_snapshot(self):
|
|
|
"""
|
|
|
Create a new volume, create a snapshot of the volume, and check
|
|
|
@@ -136,7 +136,7 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
|
|
|
Delete everything afterwards.
|
|
|
"""
|
|
|
name = "cb_crudsnap-{0}".format(helpers.get_uuid())
|
|
|
- test_vol = self.provider.block_store.volumes.create(
|
|
|
+ test_vol = self.provider.storage.volumes.create(
|
|
|
name,
|
|
|
1,
|
|
|
helpers.get_provider_test_data(self.provider, "placement"))
|
|
|
@@ -153,27 +153,27 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
|
|
|
[SnapshotState.UNKNOWN],
|
|
|
terminal_states=[SnapshotState.ERROR])
|
|
|
|
|
|
- sit.check_crud(self, self.provider.block_store.snapshots, Snapshot,
|
|
|
+ sit.check_crud(self, self.provider.storage.snapshots, Snapshot,
|
|
|
"cb_snap", create_snap, cleanup_snap)
|
|
|
|
|
|
# Test creation of a snap via SnapshotService
|
|
|
def create_snap2(name):
|
|
|
- return self.provider.block_store.snapshots.create(
|
|
|
+ return self.provider.storage.snapshots.create(
|
|
|
name=name, volume=test_vol, description=name)
|
|
|
|
|
|
if (self.provider.PROVIDER_ID == ProviderList.AWS and
|
|
|
not isinstance(self.provider, TestMockHelperMixin)):
|
|
|
time.sleep(15) # Or get SnapshotCreationPerVolumeRateExceeded
|
|
|
- sit.check_crud(self, self.provider.block_store.snapshots, Snapshot,
|
|
|
+ sit.check_crud(self, self.provider.storage.snapshots, Snapshot,
|
|
|
"cb_snaptwo", create_snap2, cleanup_snap)
|
|
|
|
|
|
- @helpers.skipIfNoService(['block_store.snapshots'])
|
|
|
+ @helpers.skipIfNoService(['storage.snapshots'])
|
|
|
def test_snapshot_properties(self):
|
|
|
"""
|
|
|
Test snapshot properties
|
|
|
"""
|
|
|
name = "cb_snapprop-{0}".format(uuid.uuid4())
|
|
|
- test_vol = self.provider.block_store.volumes.create(
|
|
|
+ test_vol = self.provider.storage.volumes.create(
|
|
|
name,
|
|
|
1,
|
|
|
helpers.get_provider_test_data(self.provider, "placement"))
|
|
|
@@ -211,7 +211,7 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
|
|
|
|
|
|
# Test volume creation from a snapshot (via VolumeService)
|
|
|
sv_name = "cb_snapvol_{0}".format(test_snap.name)
|
|
|
- snap_vol = self.provider.block_store.volumes.create(
|
|
|
+ snap_vol = self.provider.storage.volumes.create(
|
|
|
sv_name,
|
|
|
1,
|
|
|
helpers.get_provider_test_data(self.provider, "placement"),
|