summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Young <eric.young@dell.com>2018-05-01 09:41:47 -0400
committerEric Young <eric.young@emc.com>2018-05-01 09:45:50 -0400
commit6fa4c41955f486dbf6b3eb41a59ac82d357f9f40 (patch)
tree099f1facc6ba08eb4549ce7731ac8c4113f83749
parent751fdf0f4552b4b2aa95b30a76b9d62c14bbf24c (diff)
downloadcinder-tempest-plugin-6fa4c41955f486dbf6b3eb41a59ac82d357f9f40.zip
cinder-tempest-plugin-6fa4c41955f486dbf6b3eb41a59ac82d357f9f40.tar.gz
cinder-tempest-plugin-6fa4c41955f486dbf6b3eb41a59ac82d357f9f40.tar.bz2
Modify revert tests to account for creating volumes != 1GB
Some backends cannot create volumes in sizes of 1GB, such as ScaleIO. In that case, ensure volumes are created and extended in multiples of what they can support. Change-Id: I92a317e025b37efa09713ecf4ec254fabbff3437
-rw-r--r--cinder_tempest_plugin/api/volume/test_volume_revert.py12
-rw-r--r--cinder_tempest_plugin/services/volume_revert_client.py2
2 files changed, 10 insertions, 4 deletions
diff --git a/cinder_tempest_plugin/api/volume/test_volume_revert.py b/cinder_tempest_plugin/api/volume/test_volume_revert.py
index 15e4aed..f7e9169 100644
--- a/cinder_tempest_plugin/api/volume/test_volume_revert.py
+++ b/cinder_tempest_plugin/api/volume/test_volume_revert.py
@@ -43,13 +43,14 @@ class VolumeRevertTests(base.BaseVolumeTest):
def setUp(self):
super(VolumeRevertTests, self).setUp()
# Create volume
- self.volume = self.create_volume(size=1)
+ self.volume = self.create_volume()
# Create snapshot
self.snapshot = self.create_snapshot(self.volume['id'])
@decorators.idempotent_id('87b7dcb7-4950-4a3a-802c-ece55491846d')
def test_volume_revert_to_snapshot(self):
"""Test revert to snapshot"""
+ expected_size = self.volume['size']
# Revert to snapshot
self.volume_revert_client.revert_to_snapshot(self.volume,
self.snapshot['id'])
@@ -61,13 +62,16 @@ class VolumeRevertTests(base.BaseVolumeTest):
self.snapshot['id'], 'available')
volume = self.volumes_client.show_volume(self.volume['id'])['volume']
- self.assertEqual(1, volume['size'])
+ self.assertEqual(expected_size, volume['size'])
@decorators.idempotent_id('4e8b0788-87fe-430d-be7a-444d7f8e0347')
def test_volume_revert_to_snapshot_after_extended(self):
"""Test revert to snapshot after extended"""
+ # Extend volume to double the size
+ expected_size = self.volume['size'] * 2
# Extend the volume
- self.volumes_client.extend_volume(self.volume['id'], new_size=2)
+ self.volumes_client.extend_volume(self.volume['id'],
+ new_size=expected_size)
waiters.wait_for_volume_resource_status(self.volumes_client,
self.volume['id'], 'available')
# Revert to snapshot
@@ -80,4 +84,4 @@ class VolumeRevertTests(base.BaseVolumeTest):
self.snapshots_client,
self.snapshot['id'], 'available')
volume = self.volumes_client.show_volume(self.volume['id'])['volume']
- self.assertEqual(2, volume['size'])
+ self.assertEqual(expected_size, volume['size'])
diff --git a/cinder_tempest_plugin/services/volume_revert_client.py b/cinder_tempest_plugin/services/volume_revert_client.py
index 0d54701..fc9b6ad 100644
--- a/cinder_tempest_plugin/services/volume_revert_client.py
+++ b/cinder_tempest_plugin/services/volume_revert_client.py
@@ -24,6 +24,8 @@ class VolumeRevertClient(base_client.BaseClient):
def __init__(self, auth_provider, service, region, **kwargs):
super(VolumeRevertClient, self).__init__(
auth_provider, service, region, **kwargs)
+ # revert needs v3 of the volume API
+ self.api_version = 'v3'
def revert_to_snapshot(self, volume, snapshot_id):
"""Revert a volume to snapshot."""

This mirror site include all the OpenStack related repositories under: openstack, openstack-dev and openstack-infra.

NOTE: All repositories are updated every one hour.

Usage

For Git Clone
 git clone http://git.trystack.cn/openstack/nova.git 
For DevStack

Add GIT_BASE, NOVNC_REPO and SPICE_REPO variables to local.conf file.

[[local|localrc]]

# use TryStack git mirror
GIT_BASE=http://git.trystack.cn
NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git