Skip to content

Commit

Permalink
Add server name check for multiple creations
Browse files Browse the repository at this point in the history
As https://developer.openstack.org/api-ref/compute/#create-multiple-servers
the server names become {name}-1, {name}-2, {name}-3 by default.
Then this patch adds the corresponding check on Tempest.
NOTE: This comes from a review If5369bcf4a6f7fc36190e153776e60446eb14040

Change-Id: I2b544d4ccb54cb5e6db71f788926ac13be7a4fe0
  • Loading branch information
Ken'ichi Ohmichi committed May 17, 2018
1 parent e4f4d8b commit b59f458
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tempest/api/compute/servers/test_multiple_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,24 @@ class MultipleCreateTestJSON(base.BaseV2ComputeTest):
@decorators.idempotent_id('61e03386-89c3-449c-9bb1-a06f423fd9d1')
def test_multiple_create(self):
tenant_network = self.get_tenant_network()
server_names = set()
body, servers = compute.create_test_server(
self.os_primary,
name='VM',
wait_until='ACTIVE',
min_count=2,
tenant_network=tenant_network)
for server in servers:
self.addCleanup(self.servers_client.delete_server, server['id'])
server_names.add(server['name'])
# NOTE(maurosr): do status response check and also make sure that
# reservation_id is not in the response body when the request send
# contains return_reservation_id=False
self.assertNotIn('reservation_id', body)
self.assertEqual(2, len(servers))
# NOTE: If specifying a server name on the request API,
# server names should be "(name)-(index)" on Nova API side.
self.assertEqual(set(['VM-1', 'VM-2']), server_names)

@decorators.idempotent_id('864777fb-2f1e-44e3-b5b9-3eb6fa84f2f7')
def test_multiple_create_with_reservation_return(self):
Expand Down

0 comments on commit b59f458

Please sign in to comment.