Add missing IPs validation to test_rebuild_server
The test_rebuild_server test verifies several properties in a server
that has been rebuilt, however the IP addresses are never checked,
and after a rebuild the IP addresses should not change, so they should
be validated also by this test. This commit adds that validation to the
test.
Change-Id: If4baf51f1d36fb2298a01c28f6d55f851533cac4
Closes-Bug: 1600372
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 0a94d5e..7cb8130 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -156,6 +156,9 @@
@test.idempotent_id('aaa6cdf3-55a7-461a-add9-1c8596b9a07c')
def test_rebuild_server(self):
+ # Get the IPs the server has before rebuilding it
+ original_addresses = (self.client.show_server(self.server_id)['server']
+ ['addresses'])
# The server should be rebuilt using the provided image and data
meta = {'rebuild': 'server'}
new_name = data_utils.rand_name(self.__class__.__name__ + '-server')
@@ -185,6 +188,7 @@
rebuilt_image_id = server['image']['id']
self.assertTrue(self.image_ref_alt.endswith(rebuilt_image_id))
self.assertEqual(new_name, server['name'])
+ self.assertEqual(original_addresses, server['addresses'])
if CONF.validation.run_validation:
# Authentication is attempted in the following order of priority: