Skip to content

Commit

Permalink
Merge test_snapshot_create_with_volume_in_use
Browse files Browse the repository at this point in the history
test_snapshot_create_with_volume_in_use can be mostly
covered in test_snapshot_delete_with_volume_in_use, except
"Snapshot a volume which attached to an instance with
 force=False", so this is to move that test step to
test_snapshot_delete_with_volume_in_use and remove
test_snapshot_create_with_volume_in_use, so the total
run time can be reduced.

These two testcases are not used in the newest defcore
json files.

Change-Id: Ib04fe2d2127681cd89bfea3cc2d09f4aafbc6f34
  • Loading branch information
zhufl committed May 12, 2017
1 parent a93a8e9 commit 529eefa
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions tempest/api/volume/test_volumes_snapshots.py
Expand Up @@ -35,10 +35,9 @@ def resource_setup(cls):
super(VolumesSnapshotTestJSON, cls).resource_setup()
cls.volume_origin = cls.create_volume()

@decorators.idempotent_id('b467b54c-07a4-446d-a1cf-651dedcc3ff1')
@decorators.idempotent_id('8567b54c-4455-446d-a1cf-651ddeaa3ff2')
@test.services('compute')
def test_snapshot_create_with_volume_in_use(self):
# Create a snapshot when volume status is in-use
def test_snapshot_create_delete_with_volume_in_use(self):
# Create a test instance
server = self.create_server(wait_until='ACTIVE')
self.attach_volume(server['id'], self.volume_origin['id'])
Expand All @@ -47,19 +46,6 @@ def test_snapshot_create_with_volume_in_use(self):
self.assertRaises(lib_exc.BadRequest, self.create_snapshot,
self.volume_origin['id'], force=False)

# Snapshot a volume even if it's attached to an instance
snapshot = self.create_snapshot(self.volume_origin['id'],
force=True)
# Delete the snapshot
self.delete_snapshot(snapshot['id'])

@decorators.idempotent_id('8567b54c-4455-446d-a1cf-651ddeaa3ff2')
@test.services('compute')
def test_snapshot_delete_with_volume_in_use(self):
# Create a test instance
server = self.create_server(wait_until='ACTIVE')
self.attach_volume(server['id'], self.volume_origin['id'])

# Snapshot a volume attached to an instance
snapshot1 = self.create_snapshot(self.volume_origin['id'], force=True)
snapshot2 = self.create_snapshot(self.volume_origin['id'], force=True)
Expand Down

0 comments on commit 529eefa

Please sign in to comment.