Add image "version" metadata in test_snapshot_pattern

Add image "version" metadata to the snapshot image in
test_snapshot_pattern as shown in the related bug. Creating
another test just to update the metadata is not worth it.

Change-Id: I2f1093616dc7c4268a0bda5a4854da23423f4cab
Related-Bug: #1717547
This commit is contained in:
Archit Modi
2020-05-21 16:31:41 +00:00
parent f004447315
commit 2c8e8ae0e5
+10
View File
@@ -29,8 +29,10 @@ class TestSnapshotPattern(manager.ScenarioTest):
The following is the scenario outline:
* boot an instance and create a timestamp file in it
* snapshot the instance
* add version metadata to the snapshot image
* boot a second instance from the snapshot
* check the existence of the timestamp file in the second instance
* snapshot the instance again
"""
@@ -63,6 +65,11 @@ class TestSnapshotPattern(manager.ScenarioTest):
# snapshot the instance
snapshot_image = self.create_server_snapshot(server=server)
# add version metadata to the snapshot image
self.image_client.update_image(
snapshot_image['id'], [dict(add='/version',
value='8.0')])
# boot a second instance from the snapshot
server_from_snapshot = self.create_server(
image_id=snapshot_image['id'],
@@ -75,3 +82,6 @@ class TestSnapshotPattern(manager.ScenarioTest):
private_key=keypair['private_key'],
server=server_from_snapshot)
self.assertEqual(timestamp, timestamp2)
# snapshot the instance again
self.create_server_snapshot(server=server_from_snapshot)