Merge "Consolidate the ssh code"
diff --git a/tempest/api/compute/servers/test_list_server_filters.py b/tempest/api/compute/servers/test_list_server_filters.py
index d1ec064..37f322f 100644
--- a/tempest/api/compute/servers/test_list_server_filters.py
+++ b/tempest/api/compute/servers/test_list_server_filters.py
@@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+from tempest_lib import decorators
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
@@ -290,6 +291,7 @@
self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
+ @decorators.skip_because(bug="1540645")
@test.idempotent_id('a905e287-c35e-42f2-b132-d02b09f3654a')
def test_list_servers_filtered_by_ip_regex(self):
# Filter servers by regex ip
diff --git a/tempest/api/identity/admin/v2/test_endpoints.py b/tempest/api/identity/admin/v2/test_endpoints.py
index 349edfa..df75d0a 100644
--- a/tempest/api/identity/admin/v2/test_endpoints.py
+++ b/tempest/api/identity/admin/v2/test_endpoints.py
@@ -36,11 +36,12 @@
for i in range(2):
region = data_utils.rand_name('region')
url = data_utils.rand_url()
- endpoint = cls.client.create_endpoint(cls.service_id,
- region,
- publicurl=url,
- adminurl=url,
- internalurl=url)['endpoint']
+ endpoint = cls.endpoints_client.create_endpoint(
+ cls.service_id,
+ region,
+ publicurl=url,
+ adminurl=url,
+ internalurl=url)['endpoint']
# list_endpoints() will return 'enabled' field
endpoint['enabled'] = True
cls.setup_endpoints.append(endpoint)
@@ -48,7 +49,7 @@
@classmethod
def resource_cleanup(cls):
for e in cls.setup_endpoints:
- cls.client.delete_endpoint(e['id'])
+ cls.endpoints_client.delete_endpoint(e['id'])
for s in cls.service_ids:
cls.services_client.delete_service(s)
super(EndPointsTestJSON, cls).resource_cleanup()
@@ -56,7 +57,7 @@
@test.idempotent_id('11f590eb-59d8-4067-8b2b-980c7f387f51')
def test_list_endpoints(self):
# Get a list of endpoints
- fetched_endpoints = self.client.list_endpoints()['endpoints']
+ fetched_endpoints = self.endpoints_client.list_endpoints()['endpoints']
# Asserting LIST endpoints
missing_endpoints =\
[e for e in self.setup_endpoints if e not in fetched_endpoints]
@@ -68,22 +69,23 @@
def test_create_list_delete_endpoint(self):
region = data_utils.rand_name('region')
url = data_utils.rand_url()
- endpoint = self.client.create_endpoint(self.service_id,
- region,
- publicurl=url,
- adminurl=url,
- internalurl=url)['endpoint']
+ endpoint = self.endpoints_client.create_endpoint(
+ self.service_id,
+ region,
+ publicurl=url,
+ adminurl=url,
+ internalurl=url)['endpoint']
# Asserting Create Endpoint response body
self.assertIn('id', endpoint)
self.assertEqual(region, endpoint['region'])
self.assertEqual(url, endpoint['publicurl'])
# Checking if created endpoint is present in the list of endpoints
- fetched_endpoints = self.client.list_endpoints()['endpoints']
+ fetched_endpoints = self.endpoints_client.list_endpoints()['endpoints']
fetched_endpoints_id = [e['id'] for e in fetched_endpoints]
self.assertIn(endpoint['id'], fetched_endpoints_id)
# Deleting the endpoint created in this method
- self.client.delete_endpoint(endpoint['id'])
+ self.endpoints_client.delete_endpoint(endpoint['id'])
# Checking whether endpoint is deleted successfully
- fetched_endpoints = self.client.list_endpoints()['endpoints']
+ fetched_endpoints = self.endpoints_client.list_endpoints()['endpoints']
fetched_endpoints_id = [e['id'] for e in fetched_endpoints]
self.assertNotIn(endpoint['id'], fetched_endpoints_id)
diff --git a/tempest/api/identity/admin/v2/test_roles.py b/tempest/api/identity/admin/v2/test_roles.py
index 3f3d16e..5847129 100644
--- a/tempest/api/identity/admin/v2/test_roles.py
+++ b/tempest/api/identity/admin/v2/test_roles.py
@@ -33,9 +33,9 @@
def _get_role_params(self):
self.data.setup_test_user()
self.data.setup_test_role()
- user = self.get_user_by_name(self.data.test_user)
- tenant = self.get_tenant_by_name(self.data.test_tenant)
- role = self.get_role_by_name(self.data.test_role)
+ user = self.get_user_by_name(self.data.user['name'])
+ tenant = self.get_tenant_by_name(self.data.tenant['name'])
+ role = self.get_role_by_name(self.data.role['name'])
return (user, tenant, role)
def assert_role_in_role_list(self, role, roles):
diff --git a/tempest/api/identity/admin/v2/test_roles_negative.py b/tempest/api/identity/admin/v2/test_roles_negative.py
index c9af7c6..23a1958 100644
--- a/tempest/api/identity/admin/v2/test_roles_negative.py
+++ b/tempest/api/identity/admin/v2/test_roles_negative.py
@@ -27,9 +27,9 @@
def _get_role_params(self):
self.data.setup_test_user()
self.data.setup_test_role()
- user = self.get_user_by_name(self.data.test_user)
- tenant = self.get_tenant_by_name(self.data.test_tenant)
- role = self.get_role_by_name(self.data.test_role)
+ user = self.get_user_by_name(self.data.user['name'])
+ tenant = self.get_tenant_by_name(self.data.tenant['name'])
+ role = self.get_role_by_name(self.data.role['name'])
return (user, tenant, role)
@test.attr(type=['negative'])
diff --git a/tempest/api/identity/admin/v2/test_users.py b/tempest/api/identity/admin/v2/test_users.py
index 4497575..60c4e97 100644
--- a/tempest/api/identity/admin/v2/test_users.py
+++ b/tempest/api/identity/admin/v2/test_users.py
@@ -95,27 +95,29 @@
# Valid user's token is authenticated
self.data.setup_test_user()
# Get a token
- self.token_client.auth(self.data.test_user, self.data.test_password,
- self.data.test_tenant)
+ self.token_client.auth(self.data.user['name'],
+ self.data.user_password,
+ self.data.tenant['name'])
# Re-auth
- self.token_client.auth(self.data.test_user,
- self.data.test_password,
- self.data.test_tenant)
+ self.token_client.auth(self.data.user['name'],
+ self.data.user_password,
+ self.data.tenant['name'])
@test.idempotent_id('5d1fa498-4c2d-4732-a8fe-2b054598cfdd')
def test_authentication_request_without_token(self):
# Request for token authentication with a valid token in header
self.data.setup_test_user()
- self.token_client.auth(self.data.test_user, self.data.test_password,
- self.data.test_tenant)
+ self.token_client.auth(self.data.user['name'],
+ self.data.user_password,
+ self.data.tenant['name'])
# Get the token of the current client
token = self.client.auth_provider.get_token()
# Delete the token from database
self.client.delete_token(token)
# Re-auth
- self.token_client.auth(self.data.test_user,
- self.data.test_password,
- self.data.test_tenant)
+ self.token_client.auth(self.data.user['name'],
+ self.data.user_password,
+ self.data.tenant['name'])
self.client.auth_provider.clear_auth()
@test.idempotent_id('a149c02e-e5e0-4b89-809e-7e8faf33ccda')
@@ -124,8 +126,8 @@
self.data.setup_test_user()
users = self.users_client.list_users()['users']
self.assertThat([u['name'] for u in users],
- matchers.Contains(self.data.test_user),
- "Could not find %s" % self.data.test_user)
+ matchers.Contains(self.data.user['name']),
+ "Could not find %s" % self.data.user['name'])
@test.idempotent_id('6e317209-383a-4bed-9f10-075b7c82c79a')
def test_list_users_for_tenant(self):
@@ -164,9 +166,9 @@
# Return list of users on tenant when roles are assigned to users
self.data.setup_test_user()
self.data.setup_test_role()
- user = self.get_user_by_name(self.data.test_user)
- tenant = self.get_tenant_by_name(self.data.test_tenant)
- role = self.get_role_by_name(self.data.test_role)
+ user = self.get_user_by_name(self.data.user['name'])
+ tenant = self.get_tenant_by_name(self.data.tenant['name'])
+ role = self.get_role_by_name(self.data.role['name'])
# Assigning roles to two users
user_ids = list()
fetched_user_ids = list()
@@ -208,6 +210,6 @@
# Validate the updated password
# Get a token
- body = self.token_client.auth(self.data.test_user, new_pass,
- self.data.test_tenant)
+ body = self.token_client.auth(self.data.user['name'], new_pass,
+ self.data.tenant['name'])
self.assertTrue('id' in body['token'])
diff --git a/tempest/api/identity/admin/v2/test_users_negative.py b/tempest/api/identity/admin/v2/test_users_negative.py
index c5248fd..0a5d0c9 100644
--- a/tempest/api/identity/admin/v2/test_users_negative.py
+++ b/tempest/api/identity/admin/v2/test_users_negative.py
@@ -66,8 +66,8 @@
# Duplicate user should not be created
self.data.setup_test_user()
self.assertRaises(lib_exc.Conflict, self.users_client.create_user,
- self.data.test_user, self.data.test_password,
- self.data.tenant['id'], self.data.test_email)
+ self.data.user['name'], self.data.user_password,
+ self.data.tenant['id'], self.data.user['email'])
@test.attr(type=['negative'])
@test.idempotent_id('0132cc22-7c4f-42e1-9e50-ac6aad31d59a')
@@ -173,22 +173,22 @@
def test_authentication_for_disabled_user(self):
# Disabled user's token should not get authenticated
self.data.setup_test_user()
- self.disable_user(self.data.test_user)
+ self.disable_user(self.data.user['name'])
self.assertRaises(lib_exc.Unauthorized, self.token_client.auth,
- self.data.test_user,
- self.data.test_password,
- self.data.test_tenant)
+ self.data.user['name'],
+ self.data.user_password,
+ self.data.tenant['name'])
@test.attr(type=['negative'])
@test.idempotent_id('440a7a8d-9328-4b7b-83e0-d717010495e4')
def test_authentication_when_tenant_is_disabled(self):
# User's token for a disabled tenant should not be authenticated
self.data.setup_test_user()
- self.disable_tenant(self.data.test_tenant)
+ self.disable_tenant(self.data.tenant['name'])
self.assertRaises(lib_exc.Unauthorized, self.token_client.auth,
- self.data.test_user,
- self.data.test_password,
- self.data.test_tenant)
+ self.data.user['name'],
+ self.data.user_password,
+ self.data.tenant['name'])
@test.attr(type=['negative'])
@test.idempotent_id('921f1ad6-7907-40b8-853f-637e7ee52178')
@@ -196,8 +196,8 @@
# User's token for an invalid tenant should not be authenticated
self.data.setup_test_user()
self.assertRaises(lib_exc.Unauthorized, self.token_client.auth,
- self.data.test_user,
- self.data.test_password,
+ self.data.user['name'],
+ self.data.user_password,
'junktenant1234')
@test.attr(type=['negative'])
@@ -206,8 +206,8 @@
# Non-existent user's token should not get authenticated
self.data.setup_test_user()
self.assertRaises(lib_exc.Unauthorized, self.token_client.auth,
- 'junkuser123', self.data.test_password,
- self.data.test_tenant)
+ 'junkuser123', self.data.user_password,
+ self.data.tenant['name'])
@test.attr(type=['negative'])
@test.idempotent_id('d5308b33-3574-43c3-8d87-1c090c5e1eca')
@@ -215,8 +215,8 @@
# User's token with invalid password should not be authenticated
self.data.setup_test_user()
self.assertRaises(lib_exc.Unauthorized, self.token_client.auth,
- self.data.test_user, 'junkpass1234',
- self.data.test_tenant)
+ self.data.user['name'], 'junkpass1234',
+ self.data.tenant['name'])
@test.attr(type=['negative'])
@test.idempotent_id('284192ce-fb7c-4909-a63b-9a502e0ddd11')
diff --git a/tempest/api/identity/admin/v3/test_users_negative.py b/tempest/api/identity/admin/v3/test_users_negative.py
index b2fb6e0..39c89a5 100644
--- a/tempest/api/identity/admin/v3/test_users_negative.py
+++ b/tempest/api/identity/admin/v3/test_users_negative.py
@@ -39,8 +39,8 @@
def test_authentication_for_disabled_user(self):
# Attempt to authenticate for disabled user should fail
self.data.setup_test_user()
- self.disable_user(self.data.test_user)
+ self.disable_user(self.data.user['name'])
self.assertRaises(lib_exc.Unauthorized, self.token.auth,
- username=self.data.test_user,
- password=self.data.test_password,
+ username=self.data.user['name'],
+ password=self.data.user_password,
user_domain_id='default')
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 028e9f2..91d620c 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -104,6 +104,7 @@
cls.users_client = cls.os_adm.users_client
cls.non_admin_users_client = cls.os.users_client
cls.services_client = cls.os_adm.services_v2_client
+ cls.endpoints_client = cls.os_adm.endpoints_v2_client
@classmethod
def resource_setup(cls):
@@ -204,13 +205,7 @@
self.users_client = users_client or client
self.roles_client = roles_client or client
- self.test_user = ''
- self.test_password = ''
- self.test_tenant = ''
- self.test_project = ''
- self.test_role = ''
- self.test_email = ''
-
+ self.user_password = None
self.user = None
self.tenant = None
self.project = None
@@ -224,18 +219,17 @@
self.domains = []
def _create_test_user(self, **kwargs):
- self.test_user = data_utils.rand_name('test_user')
- self.test_password = data_utils.rand_password()
- self.test_email = self.test_user + '@testmail.tm'
+ username = data_utils.rand_name('test_user')
+ self.user_password = data_utils.rand_password()
self.user = self.users_client.create_user(
- self.test_user, password=self.test_password,
- email=self.test_email, **kwargs)['user']
+ username, password=self.user_password,
+ email=username + '@testmail.tm', **kwargs)['user']
self.users.append(self.user)
def setup_test_role(self):
"""Set up a test role."""
- self.test_role = data_utils.rand_name('role')
- self.role = self.roles_client.create_role(name=self.test_role)['role']
+ self.role = self.roles_client.create_role(
+ name=data_utils.rand_name('test_role'))['role']
self.roles.append(self.role)
@staticmethod
@@ -271,9 +265,8 @@
def setup_test_tenant(self):
"""Set up a test tenant."""
- self.test_tenant = data_utils.rand_name('test_tenant')
self.tenant = self.projects_client.create_tenant(
- name=self.test_tenant,
+ name=data_utils.rand_name('test_tenant'),
description=data_utils.rand_name('desc'))['tenant']
self.tenants.append(self.tenant)
@@ -287,9 +280,8 @@
def setup_test_project(self):
"""Set up a test project."""
- self.test_project = data_utils.rand_name('test_project')
self.project = self.projects_client.create_project(
- name=self.test_project,
+ name=data_utils.rand_name('test_project'),
description=data_utils.rand_name('desc'))['project']
self.projects.append(self.project)
diff --git a/tempest/api/telemetry/base.py b/tempest/api/telemetry/base.py
index bbf6db2..ff06810 100644
--- a/tempest/api/telemetry/base.py
+++ b/tempest/api/telemetry/base.py
@@ -17,6 +17,7 @@
from tempest.common import compute
from tempest.common.utils import data_utils
+from tempest.common import waiters
from tempest import config
from tempest import exceptions
import tempest.test
@@ -97,8 +98,14 @@
pass
@classmethod
+ def wait_for_server_termination(cls, server_id):
+ waiters.wait_for_server_termination(cls.servers_client,
+ server_id)
+
+ @classmethod
def resource_cleanup(cls):
cls.cleanup_resources(cls.servers_client.delete_server, cls.server_ids)
+ cls.cleanup_resources(cls.wait_for_server_termination, cls.server_ids)
cls.cleanup_resources(cls.image_client.delete_image, cls.image_ids)
super(BaseTelemetryTest, cls).resource_cleanup()
diff --git a/tempest/clients.py b/tempest/clients.py
index 9135891..50aa6f4 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -94,6 +94,8 @@
DatabaseLimitsClient
from tempest.services.database.json.versions_client import \
DatabaseVersionsClient
+from tempest.services.identity.v2.json.endpoints_client import \
+ EndpointsClient as EndpointsV2Client
from tempest.services.identity.v2.json.identity_client import \
IdentityClient
from tempest.services.identity.v2.json.roles_client import \
@@ -502,6 +504,8 @@
params_v2_admin = params.copy()
params_v2_admin['endpoint_type'] = CONF.identity.v2_admin_endpoint_type
# Client uses admin endpoint type of Keystone API v2
+ self.endpoints_v2_client = EndpointsV2Client(self.auth_provider,
+ **params_v2_admin)
self.identity_client = IdentityClient(self.auth_provider,
**params_v2_admin)
self.tenants_client = TenantsClient(self.auth_provider,
diff --git a/tempest/services/identity/v2/json/endpoints_client.py b/tempest/services/identity/v2/json/endpoints_client.py
new file mode 100644
index 0000000..ff9907d
--- /dev/null
+++ b/tempest/services/identity/v2/json/endpoints_client.py
@@ -0,0 +1,50 @@
+# Copyright 2016 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from oslo_serialization import jsonutils as json
+
+from tempest.common import service_client
+
+
+class EndpointsClient(service_client.ServiceClient):
+ api_version = "v2.0"
+
+ def create_endpoint(self, service_id, region_id, **kwargs):
+ """Create an endpoint for service."""
+ post_body = {
+ 'service_id': service_id,
+ 'region': region_id,
+ 'publicurl': kwargs.get('publicurl'),
+ 'adminurl': kwargs.get('adminurl'),
+ 'internalurl': kwargs.get('internalurl')
+ }
+ post_body = json.dumps({'endpoint': post_body})
+ resp, body = self.post('/endpoints', post_body)
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return service_client.ResponseBody(resp, body)
+
+ def list_endpoints(self):
+ """List Endpoints - Returns Endpoints."""
+ resp, body = self.get('/endpoints')
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return service_client.ResponseBody(resp, body)
+
+ def delete_endpoint(self, endpoint_id):
+ """Delete an endpoint."""
+ url = '/endpoints/%s' % endpoint_id
+ resp, body = self.delete(url)
+ self.expected_success(204, resp.status)
+ return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/identity/v2/json/identity_client.py b/tempest/services/identity/v2/json/identity_client.py
index db334a6..f045bb7 100644
--- a/tempest/services/identity/v2/json/identity_client.py
+++ b/tempest/services/identity/v2/json/identity_client.py
@@ -39,35 +39,6 @@
self.expected_success(204, resp.status)
return service_client.ResponseBody(resp, body)
- def create_endpoint(self, service_id, region_id, **kwargs):
- """Create an endpoint for service."""
- post_body = {
- 'service_id': service_id,
- 'region': region_id,
- 'publicurl': kwargs.get('publicurl'),
- 'adminurl': kwargs.get('adminurl'),
- 'internalurl': kwargs.get('internalurl')
- }
- post_body = json.dumps({'endpoint': post_body})
- resp, body = self.post('/endpoints', post_body)
- self.expected_success(200, resp.status)
- body = json.loads(body)
- return service_client.ResponseBody(resp, body)
-
- def list_endpoints(self):
- """List Endpoints - Returns Endpoints."""
- resp, body = self.get('/endpoints')
- self.expected_success(200, resp.status)
- body = json.loads(body)
- return service_client.ResponseBody(resp, body)
-
- def delete_endpoint(self, endpoint_id):
- """Delete an endpoint."""
- url = '/endpoints/%s' % endpoint_id
- resp, body = self.delete(url)
- self.expected_success(204, resp.status)
- return service_client.ResponseBody(resp, body)
-
def list_extensions(self):
"""List all the extensions."""
resp, body = self.get('/extensions')
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index 6531059..02cb901 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -154,9 +154,11 @@
projects_client = None
roles_client = None
users_client = None
+ domain = (identity_client.auth_provider.credentials.
+ get('project_domain_name', 'Default'))
credentials_client = cred_client.get_creds_client(
identity_client, projects_client, roles_client,
- users_client)
+ users_client, project_domain_name=domain)
project = credentials_client.create_project(
name=tenant_name, description=tenant_name)
user = credentials_client.create_user(username, password,
diff --git a/tempest/stress/etc/sample-unit-test.json b/tempest/stress/etc/sample-unit-test.json
index b388bfe..54433d5 100644
--- a/tempest/stress/etc/sample-unit-test.json
+++ b/tempest/stress/etc/sample-unit-test.json
@@ -1,7 +1,7 @@
[{"action": "tempest.stress.actions.unit_test.UnitTest",
"threads": 8,
- "use_admin": false,
- "use_isolated_tenants": false,
+ "use_admin": true,
+ "use_isolated_tenants": true,
"kwargs": {"test_method": "tempest.cli.simple_read_only.test_glance.SimpleReadOnlyGlanceClientTest.test_glance_fake_action",
"class_setup_per": "process"}
}
diff --git a/tempest/stress/etc/server-create-destroy-test.json b/tempest/stress/etc/server-create-destroy-test.json
index 17d5e1a..bbb5352 100644
--- a/tempest/stress/etc/server-create-destroy-test.json
+++ b/tempest/stress/etc/server-create-destroy-test.json
@@ -1,7 +1,7 @@
[{"action": "tempest.stress.actions.server_create_destroy.ServerCreateDestroyTest",
"threads": 8,
- "use_admin": false,
- "use_isolated_tenants": false,
+ "use_admin": true,
+ "use_isolated_tenants": true,
"kwargs": {}
}
]
diff --git a/tempest/stress/etc/ssh_floating.json b/tempest/stress/etc/ssh_floating.json
index e03fd4f..c502e96 100644
--- a/tempest/stress/etc/ssh_floating.json
+++ b/tempest/stress/etc/ssh_floating.json
@@ -1,7 +1,7 @@
[{"action": "tempest.stress.actions.ssh_floating.FloatingStress",
"threads": 8,
- "use_admin": false,
- "use_isolated_tenants": false,
+ "use_admin": true,
+ "use_isolated_tenants": true,
"kwargs": {"vm_extra_args": {},
"new_vm": true,
"new_sec_group": true,
diff --git a/tempest/stress/etc/stress-tox-job.json b/tempest/stress/etc/stress-tox-job.json
index 9cee316..bfa448d 100644
--- a/tempest/stress/etc/stress-tox-job.json
+++ b/tempest/stress/etc/stress-tox-job.json
@@ -1,25 +1,25 @@
[{"action": "tempest.stress.actions.server_create_destroy.ServerCreateDestroyTest",
"threads": 8,
- "use_admin": false,
- "use_isolated_tenants": false,
+ "use_admin": true,
+ "use_isolated_tenants": true,
"kwargs": {}
},
{"action": "tempest.stress.actions.volume_create_delete.VolumeCreateDeleteTest",
"threads": 4,
- "use_admin": false,
- "use_isolated_tenants": false,
+ "use_admin": true,
+ "use_isolated_tenants": true,
"kwargs": {}
},
{"action": "tempest.stress.actions.volume_attach_delete.VolumeAttachDeleteTest",
"threads": 2,
- "use_admin": false,
- "use_isolated_tenants": false,
+ "use_admin": true,
+ "use_isolated_tenants": true,
"kwargs": {}
},
{"action": "tempest.stress.actions.unit_test.UnitTest",
"threads": 4,
- "use_admin": false,
- "use_isolated_tenants": false,
+ "use_admin": true,
+ "use_isolated_tenants": true,
"required_services": ["neutron"],
"kwargs": {"test_method": "tempest.scenario.test_network_advanced_server_ops.TestNetworkAdvancedServerOps.test_server_connectivity_stop_start",
"class_setup_per": "process"}
diff --git a/tempest/stress/etc/volume-attach-delete-test.json b/tempest/stress/etc/volume-attach-delete-test.json
index 4553ff8..d468967 100644
--- a/tempest/stress/etc/volume-attach-delete-test.json
+++ b/tempest/stress/etc/volume-attach-delete-test.json
@@ -1,7 +1,7 @@
[{"action": "tempest.stress.actions.volume_attach_delete.VolumeAttachDeleteTest",
"threads": 4,
- "use_admin": false,
- "use_isolated_tenants": false,
+ "use_admin": true,
+ "use_isolated_tenants": true,
"kwargs": {}
}
]
diff --git a/tempest/stress/etc/volume-attach-verify.json b/tempest/stress/etc/volume-attach-verify.json
index 731f5ed..d8c96fd 100644
--- a/tempest/stress/etc/volume-attach-verify.json
+++ b/tempest/stress/etc/volume-attach-verify.json
@@ -1,7 +1,7 @@
[{"action": "tempest.stress.actions.volume_attach_verify.VolumeVerifyStress",
"threads": 1,
- "use_admin": false,
- "use_isolated_tenants": false,
+ "use_admin": true,
+ "use_isolated_tenants": true,
"kwargs": {"vm_extra_args": {},
"new_volume": true,
"new_server": false,
diff --git a/tempest/stress/etc/volume-create-delete-test.json b/tempest/stress/etc/volume-create-delete-test.json
index e8a58f7..a60cde6 100644
--- a/tempest/stress/etc/volume-create-delete-test.json
+++ b/tempest/stress/etc/volume-create-delete-test.json
@@ -1,7 +1,7 @@
[{"action": "tempest.stress.actions.volume_create_delete.VolumeCreateDeleteTest",
"threads": 4,
- "use_admin": false,
- "use_isolated_tenants": false,
+ "use_admin": true,
+ "use_isolated_tenants": true,
"kwargs": {}
}
]
diff --git a/tempest/tests/common/test_api_version_utils.py b/tempest/tests/common/test_api_version_utils.py
index babf965..a24bc65 100644
--- a/tempest/tests/common/test_api_version_utils.py
+++ b/tempest/tests/common/test_api_version_utils.py
@@ -12,146 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-from oslo_config import cfg
import testtools
-from tempest.api.compute import base as compute_base
from tempest.common import api_version_utils
-from tempest import config
from tempest import exceptions
from tempest.tests import base
-from tempest.tests import fake_config
-
-
-class VersionTestNoneTolatest(compute_base.BaseV2ComputeTest):
- min_microversion = None
- max_microversion = 'latest'
-
-
-class VersionTestNoneTo2_2(compute_base.BaseV2ComputeTest):
- min_microversion = None
- max_microversion = '2.2'
-
-
-class VersionTest2_3ToLatest(compute_base.BaseV2ComputeTest):
- min_microversion = '2.3'
- max_microversion = 'latest'
-
-
-class VersionTest2_5To2_10(compute_base.BaseV2ComputeTest):
- min_microversion = '2.5'
- max_microversion = '2.10'
-
-
-class VersionTest2_10To2_10(compute_base.BaseV2ComputeTest):
- min_microversion = '2.10'
- max_microversion = '2.10'
-
-
-class InvalidVersionTest(compute_base.BaseV2ComputeTest):
- min_microversion = '2.11'
- max_microversion = '2.1'
-
-
-class TestMicroversionsTestsClass(base.TestCase):
-
- def setUp(self):
- super(TestMicroversionsTestsClass, self).setUp()
- self.useFixture(fake_config.ConfigFixture())
- self.stubs.Set(config, 'TempestConfigPrivate',
- fake_config.FakePrivate)
-
- def _test_version(self, cfg_min, cfg_max,
- expected_pass_tests,
- expected_skip_tests):
- cfg.CONF.set_default('min_microversion',
- cfg_min, group='compute-feature-enabled')
- cfg.CONF.set_default('max_microversion',
- cfg_max, group='compute-feature-enabled')
- try:
- for test_class in expected_pass_tests:
- test_class.skip_checks()
- for test_class in expected_skip_tests:
- self.assertRaises(testtools.TestCase.skipException,
- test_class.skip_checks)
- except testtools.TestCase.skipException as e:
- raise testtools.TestCase.failureException(e.message)
-
- def test_config_version_none_none(self):
- expected_pass_tests = [VersionTestNoneTolatest, VersionTestNoneTo2_2]
- expected_skip_tests = [VersionTest2_3ToLatest, VersionTest2_5To2_10,
- VersionTest2_10To2_10]
- self._test_version(None, None,
- expected_pass_tests,
- expected_skip_tests)
-
- def test_config_version_none_23(self):
- expected_pass_tests = [VersionTestNoneTolatest, VersionTestNoneTo2_2,
- VersionTest2_3ToLatest]
- expected_skip_tests = [VersionTest2_5To2_10, VersionTest2_10To2_10]
- self._test_version(None, '2.3',
- expected_pass_tests,
- expected_skip_tests)
-
- def test_config_version_22_latest(self):
- expected_pass_tests = [VersionTestNoneTolatest, VersionTestNoneTo2_2,
- VersionTest2_3ToLatest, VersionTest2_5To2_10,
- VersionTest2_10To2_10]
- expected_skip_tests = []
- self._test_version('2.2', 'latest',
- expected_pass_tests,
- expected_skip_tests)
-
- def test_config_version_22_23(self):
- expected_pass_tests = [VersionTestNoneTolatest, VersionTestNoneTo2_2,
- VersionTest2_3ToLatest]
- expected_skip_tests = [VersionTest2_5To2_10, VersionTest2_10To2_10]
- self._test_version('2.2', '2.3',
- expected_pass_tests,
- expected_skip_tests)
-
- def test_config_version_210_210(self):
- expected_pass_tests = [VersionTestNoneTolatest,
- VersionTest2_3ToLatest,
- VersionTest2_5To2_10,
- VersionTest2_10To2_10]
- expected_skip_tests = [VersionTestNoneTo2_2]
- self._test_version('2.10', '2.10',
- expected_pass_tests,
- expected_skip_tests)
-
- def test_config_version_none_latest(self):
- expected_pass_tests = [VersionTestNoneTolatest, VersionTestNoneTo2_2,
- VersionTest2_3ToLatest, VersionTest2_5To2_10,
- VersionTest2_10To2_10]
- expected_skip_tests = []
- self._test_version(None, 'latest',
- expected_pass_tests,
- expected_skip_tests)
-
- def test_config_version_latest_latest(self):
- expected_pass_tests = [VersionTestNoneTolatest, VersionTest2_3ToLatest]
- expected_skip_tests = [VersionTestNoneTo2_2, VersionTest2_5To2_10,
- VersionTest2_10To2_10]
- self._test_version('latest', 'latest',
- expected_pass_tests,
- expected_skip_tests)
-
- def test_config_invalid_version(self):
- cfg.CONF.set_default('min_microversion',
- '2.5', group='compute-feature-enabled')
- cfg.CONF.set_default('max_microversion',
- '2.1', group='compute-feature-enabled')
- self.assertRaises(exceptions.InvalidConfiguration,
- VersionTestNoneTolatest.skip_checks)
-
- def test_config_version_invalid_test_version(self):
- cfg.CONF.set_default('min_microversion',
- None, group='compute-feature-enabled')
- cfg.CONF.set_default('max_microversion',
- '2.13', group='compute-feature-enabled')
- self.assertRaises(exceptions.InvalidConfiguration,
- InvalidVersionTest.skip_checks)
class TestVersionSkipLogic(base.TestCase):
diff --git a/tempest/tests/test_microversions.py b/tempest/tests/test_microversions.py
new file mode 100644
index 0000000..fc37af4
--- /dev/null
+++ b/tempest/tests/test_microversions.py
@@ -0,0 +1,153 @@
+# Copyright 2015 NEC Corporation. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from oslo_config import cfg
+import testtools
+
+from tempest.api.compute import base as compute_base
+from tempest import config
+from tempest import exceptions
+from tempest.tests import base
+from tempest.tests import fake_config
+
+
+class VersionTestNoneTolatest(compute_base.BaseV2ComputeTest):
+ min_microversion = None
+ max_microversion = 'latest'
+
+
+class VersionTestNoneTo2_2(compute_base.BaseV2ComputeTest):
+ min_microversion = None
+ max_microversion = '2.2'
+
+
+class VersionTest2_3ToLatest(compute_base.BaseV2ComputeTest):
+ min_microversion = '2.3'
+ max_microversion = 'latest'
+
+
+class VersionTest2_5To2_10(compute_base.BaseV2ComputeTest):
+ min_microversion = '2.5'
+ max_microversion = '2.10'
+
+
+class VersionTest2_10To2_10(compute_base.BaseV2ComputeTest):
+ min_microversion = '2.10'
+ max_microversion = '2.10'
+
+
+class InvalidVersionTest(compute_base.BaseV2ComputeTest):
+ min_microversion = '2.11'
+ max_microversion = '2.1'
+
+
+class TestMicroversionsTestsClass(base.TestCase):
+
+ def setUp(self):
+ super(TestMicroversionsTestsClass, self).setUp()
+ self.useFixture(fake_config.ConfigFixture())
+ self.stubs.Set(config, 'TempestConfigPrivate',
+ fake_config.FakePrivate)
+
+ def _test_version(self, cfg_min, cfg_max,
+ expected_pass_tests,
+ expected_skip_tests):
+ cfg.CONF.set_default('min_microversion',
+ cfg_min, group='compute-feature-enabled')
+ cfg.CONF.set_default('max_microversion',
+ cfg_max, group='compute-feature-enabled')
+ try:
+ for test_class in expected_pass_tests:
+ test_class.skip_checks()
+ for test_class in expected_skip_tests:
+ self.assertRaises(testtools.TestCase.skipException,
+ test_class.skip_checks)
+ except testtools.TestCase.skipException as e:
+ raise testtools.TestCase.failureException(e.message)
+
+ def test_config_version_none_none(self):
+ expected_pass_tests = [VersionTestNoneTolatest, VersionTestNoneTo2_2]
+ expected_skip_tests = [VersionTest2_3ToLatest, VersionTest2_5To2_10,
+ VersionTest2_10To2_10]
+ self._test_version(None, None,
+ expected_pass_tests,
+ expected_skip_tests)
+
+ def test_config_version_none_23(self):
+ expected_pass_tests = [VersionTestNoneTolatest, VersionTestNoneTo2_2,
+ VersionTest2_3ToLatest]
+ expected_skip_tests = [VersionTest2_5To2_10, VersionTest2_10To2_10]
+ self._test_version(None, '2.3',
+ expected_pass_tests,
+ expected_skip_tests)
+
+ def test_config_version_22_latest(self):
+ expected_pass_tests = [VersionTestNoneTolatest, VersionTestNoneTo2_2,
+ VersionTest2_3ToLatest, VersionTest2_5To2_10,
+ VersionTest2_10To2_10]
+ expected_skip_tests = []
+ self._test_version('2.2', 'latest',
+ expected_pass_tests,
+ expected_skip_tests)
+
+ def test_config_version_22_23(self):
+ expected_pass_tests = [VersionTestNoneTolatest, VersionTestNoneTo2_2,
+ VersionTest2_3ToLatest]
+ expected_skip_tests = [VersionTest2_5To2_10, VersionTest2_10To2_10]
+ self._test_version('2.2', '2.3',
+ expected_pass_tests,
+ expected_skip_tests)
+
+ def test_config_version_210_210(self):
+ expected_pass_tests = [VersionTestNoneTolatest,
+ VersionTest2_3ToLatest,
+ VersionTest2_5To2_10,
+ VersionTest2_10To2_10]
+ expected_skip_tests = [VersionTestNoneTo2_2]
+ self._test_version('2.10', '2.10',
+ expected_pass_tests,
+ expected_skip_tests)
+
+ def test_config_version_none_latest(self):
+ expected_pass_tests = [VersionTestNoneTolatest, VersionTestNoneTo2_2,
+ VersionTest2_3ToLatest, VersionTest2_5To2_10,
+ VersionTest2_10To2_10]
+ expected_skip_tests = []
+ self._test_version(None, 'latest',
+ expected_pass_tests,
+ expected_skip_tests)
+
+ def test_config_version_latest_latest(self):
+ expected_pass_tests = [VersionTestNoneTolatest, VersionTest2_3ToLatest]
+ expected_skip_tests = [VersionTestNoneTo2_2, VersionTest2_5To2_10,
+ VersionTest2_10To2_10]
+ self._test_version('latest', 'latest',
+ expected_pass_tests,
+ expected_skip_tests)
+
+ def test_config_invalid_version(self):
+ cfg.CONF.set_default('min_microversion',
+ '2.5', group='compute-feature-enabled')
+ cfg.CONF.set_default('max_microversion',
+ '2.1', group='compute-feature-enabled')
+ self.assertRaises(exceptions.InvalidConfiguration,
+ VersionTestNoneTolatest.skip_checks)
+
+ def test_config_version_invalid_test_version(self):
+ cfg.CONF.set_default('min_microversion',
+ None, group='compute-feature-enabled')
+ cfg.CONF.set_default('max_microversion',
+ '2.13', group='compute-feature-enabled')
+ self.assertRaises(exceptions.InvalidConfiguration,
+ InvalidVersionTest.skip_checks)