Fix create_test_server for multiple create request
Currently create_test_server function assume that if
either 'min_count' or 'max_count' are present in kwargs then
request is for multiple create.
But that is not valid assumption. If 'min_count' and 'max_count'
are present and equal to 1 then it is single server create request.
Nova also set them default to 1 if they are not passed.
https://github.com/openstack/nova/blob/master/nova/compute/api.py#L1133
This commits checks if they are greater than 1 than only assume that
request is for multiple create server.
Change-Id: Ie4f45eb8481cd1aff55877cb7f8be327d548031e
diff --git a/tempest/common/compute.py b/tempest/common/compute.py
index 6e6ada8..d57bae3 100644
--- a/tempest/common/compute.py
+++ b/tempest/common/compute.py
@@ -55,10 +55,13 @@
kwargs = fixed_network.set_networks_kwarg(
tenant_network, kwargs) or {}
+ multiple_create_request = (max(kwargs.get('min_count', 0),
+ kwargs.get('max_count', 0)) > 1)
+
if CONF.validation.run_validation and validatable:
# As a first implementation, multiple pingable or sshable servers will
# not be supported
- if 'min_count' in kwargs or 'max_count' in kwargs:
+ if multiple_create_request:
msg = ("Multiple pingable or sshable servers not supported at "
"this stage.")
raise ValueError(msg)
@@ -112,7 +115,7 @@
# handle the case of multiple servers
servers = []
- if 'min_count' in kwargs or 'max_count' in kwargs:
+ if multiple_create_request:
# Get servers created which name match with name param.
body_servers = clients.servers_client.list_servers()
servers = \