GET backup before asserting 'volume_id' and 'snapshot_id'
Recently, commit c96757b275
was merged
to remove redundant cleanups in volume backup tests. But there was a
bug in the change that assumed 'volume_id' and 'snapshot_id' are
returned from the backup create API when they are not.
We need to GET the backup in the API in order to obtain the 'volume_id'
and 'snapshot_id' for the asserts.
Closes-Bug: #1796207
Change-Id: I640fe41ec6049bfd980dfcbb6cae95a9a3e97b66
This commit is contained in:
parent
9540ed07ab
commit
e935d35956
|
@ -41,6 +41,9 @@ class VolumesBackupsTest(base.BaseVolumeTest):
|
||||||
backup = self.create_backup(
|
backup = self.create_backup(
|
||||||
volume_id=volume['id'],
|
volume_id=volume['id'],
|
||||||
snapshot_id=snapshot['id'])
|
snapshot_id=snapshot['id'])
|
||||||
|
# Get a given backup. We need to do this to get the volume_id and
|
||||||
|
# snapshot_id of the backup. They are not returned by the create API.
|
||||||
|
backup = self.backups_client.show_backup(backup['id'])['backup']
|
||||||
self.assertEqual(volume['id'], backup['volume_id'])
|
self.assertEqual(volume['id'], backup['volume_id'])
|
||||||
self.assertEqual(snapshot['id'], backup['snapshot_id'])
|
self.assertEqual(snapshot['id'], backup['snapshot_id'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue