Change checks for test_server test
Changed checks that verify update instance name
to new with non-ASCII characters in different states.
Change-Id: I5fb58e7dbbf6a6196761a6e7bc78bea13028b715
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index d2fb652..8e2fbf1 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -71,9 +71,10 @@
server = self.client.show_server(server['id'])['server']
self.assertEqual(key_name, server['key_name'])
- def _update_server_name(self, server_id, status):
+ def _update_server_name(self, server_id, status, prefix_name='server'):
# The server name should be changed to the the provided value
- new_name = data_utils.rand_name('server')
+ new_name = data_utils.rand_name(prefix_name)
+
# Update the server with a new name
self.client.update_server(server_id,
name=new_name)
@@ -88,8 +89,9 @@
def test_update_server_name(self):
# The server name should be changed to the the provided value
server = self.create_test_server(wait_until='ACTIVE')
-
- self._update_server_name(server['id'], 'ACTIVE')
+ # Update instance name with non-ASCII characters
+ prefix_name = u'\u00CD\u00F1st\u00E1\u00F1c\u00E9'
+ self._update_server_name(server['id'], 'ACTIVE', prefix_name)
@test.idempotent_id('6ac19cb1-27a3-40ec-b350-810bdc04c08e')
def test_update_server_name_in_stop_state(self):
@@ -97,7 +99,11 @@
server = self.create_test_server(wait_until='ACTIVE')
self.client.stop_server(server['id'])
waiters.wait_for_server_status(self.client, server['id'], 'SHUTOFF')
- updated_server = self._update_server_name(server['id'], 'SHUTOFF')
+ # Update instance name with non-ASCII characters
+ prefix_name = u'\u00CD\u00F1st\u00E1\u00F1c\u00E9'
+ updated_server = self._update_server_name(server['id'],
+ 'SHUTOFF',
+ prefix_name)
self.assertNotIn('progress', updated_server)
@test.idempotent_id('89b90870-bc13-4b73-96af-f9d4f2b70077')