GET backup before asserting 'volume_id' and 'snapshot_id'
Recently, commit c96757b275a77a745c6c80947bdd0bcb2de7eefd 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
melanie witt
7 years ago
| 40 | 40 | backup = self.create_backup( |
| 41 | 41 | volume_id=volume['id'], |
| 42 | 42 | snapshot_id=snapshot['id']) |
| 43 | # Get a given backup. We need to do this to get the volume_id and | |
| 44 | # snapshot_id of the backup. They are not returned by the create API. | |
| 45 | backup = self.backups_client.show_backup(backup['id'])['backup'] | |
| 43 | 46 | self.assertEqual(volume['id'], backup['volume_id']) |
| 44 | 47 | self.assertEqual(snapshot['id'], backup['snapshot_id']) |
| 45 | 48 |