Skip to content

Commit

Permalink
Remove skip of test_stamp_pattern
Browse files Browse the repository at this point in the history
test_stamp_pattern is skipped of bug 1205344 which is reported at 2013,
though there is no exact hint on whether the bug is fixed or not, but
since 2013 is too long ago, we guess the bug should have been fixed.

This is to remove the skip, and to fix several obvious errors in the
code.

Change-Id: I2c13099595d8ee8099e02e3f06096078c7d27c34
  • Loading branch information
zhufl committed Feb 13, 2017
1 parent 2d5bdd0 commit 96c36cf
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions tempest/scenario/test_stamp_pattern.py
Expand Up @@ -13,8 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.

import time

from oslo_log import log as logging
import testtools

Expand Down Expand Up @@ -63,21 +61,17 @@ def _create_volume_snapshot(self, volume):
snapshot_name = data_utils.rand_name('scenario-snapshot')
snapshot = self.snapshots_client.create_snapshot(
volume_id=volume['id'], display_name=snapshot_name)['snapshot']

def cleaner():
self.snapshots_client.delete_snapshot(snapshot['id'])
try:
while self.snapshots_client.show_snapshot(
snapshot['id'])['snapshot']:
time.sleep(1)
except lib_exc.NotFound:
pass
self.addCleanup(cleaner)
self.addCleanup(self.snapshots_client.wait_for_resource_deletion,
snapshot['id'])
self.addCleanup(self.snapshots_client.delete_snapshot, snapshot['id'])
waiters.wait_for_volume_status(self.volumes_client,
volume['id'], 'available')
waiters.wait_for_snapshot_status(self.snapshots_client,
snapshot['id'], 'available')
self.assertEqual(snapshot_name, snapshot['display_name'])
if 'display_name' in snapshot:
self.assertEqual(snapshot_name, snapshot['display_name'])
else:
self.assertEqual(snapshot_name, snapshot['name'])
return snapshot

def _wait_for_volume_available_on_the_system(self, ip_address,
Expand All @@ -94,7 +88,6 @@ def _func():
CONF.compute.build_interval):
raise lib_exc.TimeoutException

@decorators.skip_because(bug="1205344")
@decorators.idempotent_id('10fd234a-515c-41e5-b092-8323060598c5')
@testtools.skipUnless(CONF.compute_feature_enabled.snapshot,
'Snapshotting is not available.')
Expand All @@ -109,7 +102,7 @@ def test_stamp_pattern(self):
server = self.create_server(
image_id=CONF.compute.image_ref,
key_name=keypair['name'],
security_groups=security_group)
security_groups=[{'name': security_group['name']}])

# create and add floating IP to server1
ip_for_server = self.get_server_ip(server)
Expand All @@ -136,7 +129,7 @@ def test_stamp_pattern(self):
server_from_snapshot = self.create_server(
image_id=snapshot_image['id'],
key_name=keypair['name'],
security_groups=security_group)
security_groups=[{'name': security_group['name']}])

# create and add floating IP to server_from_snapshot
ip_for_snapshot = self.get_server_ip(server_from_snapshot)
Expand Down

0 comments on commit 96c36cf

Please sign in to comment.