summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErlon R. Cruz <erlon@netapp.com>2018-11-05 17:44:21 -0200
committerErlon R. Cruz <erlon@netapp.com>2019-01-16 13:23:20 -0200
commitf208601ab5ba7e33cff535595d4ce480489ef4b9 (patch)
tree3e6ed28a8a9e12d2db33f27c5e22027759534eba
parentd12f0b693ef09dfd9abd1013fe616c4bbd672714 (diff)
downloadcinder-tempest-plugin-f208601ab5ba7e33cff535595d4ce480489ef4b9.zip
cinder-tempest-plugin-f208601ab5ba7e33cff535595d4ce480489ef4b9.tar.gz
cinder-tempest-plugin-f208601ab5ba7e33cff535595d4ce480489ef4b9.tar.bz2
Fix volume revert to snapshot tests
According to the revert to snapshot spec, it should not be possible to revert a volume to a snapshot after the volume is extended. This was fixed on [1] but the cinder_tempest_plugin test still was being considering the old behavior. [1] https://bugs.launchpad.net/cinder/+bug/1798503 Change-Id: I21d0b2291608922e46278ae5799478a5df0c4904
-rw-r--r--cinder_tempest_plugin/api/volume/test_volume_revert.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/cinder_tempest_plugin/api/volume/test_volume_revert.py b/cinder_tempest_plugin/api/volume/test_volume_revert.py
index f7e9169..8a2f657 100644
--- a/cinder_tempest_plugin/api/volume/test_volume_revert.py
+++ b/cinder_tempest_plugin/api/volume/test_volume_revert.py
@@ -16,6 +16,7 @@
from tempest.common import waiters
from tempest import config
from tempest.lib import decorators
+from tempest.lib import exceptions
from cinder_tempest_plugin.api.volume import base
from cinder_tempest_plugin import cinder_clients
@@ -65,7 +66,7 @@ class VolumeRevertTests(base.BaseVolumeTest):
self.assertEqual(expected_size, volume['size'])
@decorators.idempotent_id('4e8b0788-87fe-430d-be7a-444d7f8e0347')
- def test_volume_revert_to_snapshot_after_extended(self):
+ def test_volume_revert_to_snapshot_after_extended_negative(self):
"""Test revert to snapshot after extended"""
# Extend volume to double the size
expected_size = self.volume['size'] * 2
@@ -74,14 +75,8 @@ class VolumeRevertTests(base.BaseVolumeTest):
new_size=expected_size)
waiters.wait_for_volume_resource_status(self.volumes_client,
self.volume['id'], 'available')
- # Revert to snapshot
- self.volume_revert_client.revert_to_snapshot(self.volume,
- self.snapshot['id'])
- waiters.wait_for_volume_resource_status(
- self.volumes_client,
- self.volume['id'], 'available')
- waiters.wait_for_volume_resource_status(
- self.snapshots_client,
- self.snapshot['id'], 'available')
- volume = self.volumes_client.show_volume(self.volume['id'])['volume']
- self.assertEqual(expected_size, volume['size'])
+
+ # Destination volume smaller than source, API should block that
+ self.assertRaises(exceptions.BadRequest,
+ self.volume_revert_client.revert_to_snapshot,
+ self.volume, self.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