Merge "Support for ipv6 in compute response JSON schema"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 4fe7044..1095e77 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -39,8 +39,8 @@
# Deprecated group/name - [DEFAULT]/logdir
#log_dir = <None>
-# Use syslog for logging. Existing syslog format is DEPRECATED during
-# I, and changed in J to honor RFC5424. (boolean value)
+# Use syslog for logging. Existing syslog format is DEPRECATED and
+# will be changed later to honor RFC5424. (boolean value)
#use_syslog = false
# (Optional) Enables or disables syslog rfc5424 format for logging. If
@@ -77,9 +77,6 @@
# Enables or disables publication of error events. (boolean value)
#publish_errors = false
-# Enables or disables fatal status of deprecations. (boolean value)
-#fatal_deprecations = false
-
# The format for an instance that is passed with the log message.
# (string value)
#instance_format = "[instance: %(uuid)s] "
@@ -91,6 +88,15 @@
# Enables or disables fatal status of deprecations. (boolean value)
#fatal_deprecations = false
+#
+# From tempest.config
+#
+
+# Prefix to be added when generating the name for test resources. It
+# can be used to discover all resources associated with a specific
+# test run when running tempest on a real-life cloud (string value)
+#resources_prefix = tempest
+
[auth]
@@ -284,18 +290,10 @@
# (integer value)
#ping_count = 1
-# Timeout in seconds to wait for authentication to succeed. (integer
-# value)
-#ssh_timeout = 300
-
# Additional wait time for clean state, when there is no OS-EXT-STS
# extension available (integer value)
#ready_wait = 0
-# Timeout in seconds to wait for output from ssh channel. (integer
-# value)
-#ssh_channel_timeout = 60
-
# Name of the fixed network that is visible to all test tenants. If
# multiple networks are available for a tenant this is the network
# which will be used for creating servers if tempest does not create a
@@ -307,9 +305,6 @@
# use_floatingip_for_ssh=true or run_validation=false. (string value)
#network_for_ssh = public
-# IP version used for SSH connections. (integer value)
-#ip_version_for_ssh = 4
-
# Does SSH use Floating IPs? (boolean value)
#use_floatingip_for_ssh = true
@@ -431,6 +426,12 @@
# value)
#preserve_ports = false
+# Does the test environment support attaching an encrypted volume to a
+# running server instance? This may depend on the combination of
+# compute_driver in nova and the volume_driver(s) in cinder. (boolean
+# value)
+#attach_encrypted_volume = true
+
[dashboard]
@@ -801,7 +802,8 @@
# A list of enabled network extensions with a special entry all which
# indicates every extension is enabled. Empty list indicates all
-# extensions are disabled (list value)
+# extensions are disabled. To get the list of extensions run: 'neutron
+# ext-list' (list value)
#api_extensions = all
# Allow the execution of IPv6 subnet tests that use the extended IPv6
@@ -1115,6 +1117,7 @@
#auth_method = keypair
# Default IP version for ssh connections. (integer value)
+# Deprecated group/name - [compute]/ip_version_for_ssh
#ip_version_for_ssh = 4
# Timeout in seconds to wait for ping to succeed. (integer value)
@@ -1122,9 +1125,11 @@
# Timeout in seconds to wait for the TCP connection to be successful.
# (integer value)
+# Deprecated group/name - [compute]/ssh_channel_timeout
#connect_timeout = 60
# Timeout in seconds to wait for the ssh banner. (integer value)
+# Deprecated group/name - [compute]/ssh_timeout
#ssh_timeout = 300
diff --git a/requirements.txt b/requirements.txt
index 1d512a0..d15a5a1 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,6 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pbr<2.0,>=0.11
+cliff>=1.13.0 # Apache-2.0
anyjson>=0.3.3
httplib2>=0.7.5
jsonschema!=2.5.0,<3.0.0,>=2.0.0
@@ -11,7 +12,7 @@
netaddr>=0.7.12
testrepository>=0.0.18
pyOpenSSL>=0.11
-oslo.concurrency>=2.0.0 # Apache-2.0
+oslo.concurrency>=2.1.0 # Apache-2.0
oslo.config>=1.11.0 # Apache-2.0
oslo.i18n>=1.5.0 # Apache-2.0
oslo.log>=1.2.0 # Apache-2.0
@@ -19,7 +20,7 @@
oslo.utils>=1.6.0 # Apache-2.0
six>=1.9.0
iso8601>=0.1.9
-fixtures>=0.3.14
+fixtures>=1.3.1
testscenarios>=0.4
-tempest-lib>=0.5.0
+tempest-lib>=0.6.1
PyYAML>=3.1.0
diff --git a/setup.cfg b/setup.cfg
index 3a14bba..5c78632 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -25,6 +25,7 @@
run-tempest-stress = tempest.cmd.run_stress:main
tempest-cleanup = tempest.cmd.cleanup:main
tempest-account-generator = tempest.cmd.account_generator:main
+ tempest = tempest.cmd.main:main
oslo.config.opts =
tempest.config = tempest.config:list_opts
diff --git a/tempest/api/baremetal/admin/base.py b/tempest/api/baremetal/admin/base.py
index 0b5d7d9..d7d2efe 100644
--- a/tempest/api/baremetal/admin/base.py
+++ b/tempest/api/baremetal/admin/base.py
@@ -12,9 +12,9 @@
import functools
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/baremetal/admin/test_chassis.py b/tempest/api/baremetal/admin/test_chassis.py
index 5ad05cc..29fc64c 100644
--- a/tempest/api/baremetal/admin/test_chassis.py
+++ b/tempest/api/baremetal/admin/test_chassis.py
@@ -12,10 +12,10 @@
# under the License.
import six
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.baremetal.admin import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/baremetal/admin/test_nodes.py b/tempest/api/baremetal/admin/test_nodes.py
index 6b963c7..4830dcd 100644
--- a/tempest/api/baremetal/admin/test_nodes.py
+++ b/tempest/api/baremetal/admin/test_nodes.py
@@ -11,10 +11,10 @@
# under the License.
import six
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.baremetal.admin import base
+from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import test
diff --git a/tempest/api/baremetal/admin/test_ports.py b/tempest/api/baremetal/admin/test_ports.py
index ece4471..5eaf641 100644
--- a/tempest/api/baremetal/admin/test_ports.py
+++ b/tempest/api/baremetal/admin/test_ports.py
@@ -11,11 +11,11 @@
# under the License.
import six
-from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
from tempest_lib import exceptions as lib_exc
from tempest.api.baremetal.admin import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/baremetal/admin/test_ports_negative.py b/tempest/api/baremetal/admin/test_ports_negative.py
index 3d80ee4..610758a 100644
--- a/tempest/api/baremetal/admin/test_ports_negative.py
+++ b/tempest/api/baremetal/admin/test_ports_negative.py
@@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.baremetal.admin import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/admin/test_agents.py b/tempest/api/compute/admin/test_agents.py
index c9a73c7..1aa1615 100644
--- a/tempest/api/compute/admin/test_agents.py
+++ b/tempest/api/compute/admin/test_agents.py
@@ -13,10 +13,10 @@
# under the License.
from oslo_log import log
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
LOG = log.getLogger(__name__)
diff --git a/tempest/api/compute/admin/test_aggregates.py b/tempest/api/compute/admin/test_aggregates.py
index 35a6479..91e55d6 100644
--- a/tempest/api/compute/admin/test_aggregates.py
+++ b/tempest/api/compute/admin/test_aggregates.py
@@ -13,11 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
from tempest.common import tempest_fixtures as fixtures
+from tempest.common.utils import data_utils
from tempest import test
@@ -211,5 +211,5 @@
server = self.create_test_server(name=server_name,
availability_zone=az_name,
wait_until='ACTIVE')
- body = admin_servers_client.get_server(server['id'])
+ body = admin_servers_client.show_server(server['id'])
self.assertEqual(self.host, body[self._host_key])
diff --git a/tempest/api/compute/admin/test_aggregates_negative.py b/tempest/api/compute/admin/test_aggregates_negative.py
index 6942fdb..74a8547 100644
--- a/tempest/api/compute/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/admin/test_aggregates_negative.py
@@ -13,11 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
from tempest.common import tempest_fixtures as fixtures
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/admin/test_fixed_ips.py b/tempest/api/compute/admin/test_fixed_ips.py
index a65fda6..dc9a7ef 100644
--- a/tempest/api/compute/admin/test_fixed_ips.py
+++ b/tempest/api/compute/admin/test_fixed_ips.py
@@ -38,7 +38,7 @@
def resource_setup(cls):
super(FixedIPsTestJson, cls).resource_setup()
server = cls.create_test_server(wait_until='ACTIVE')
- server = cls.servers_client.get_server(server['id'])
+ server = cls.servers_client.show_server(server['id'])
for ip_set in server['addresses']:
for ip in server['addresses'][ip_set]:
if ip['OS-EXT-IPS:type'] == 'fixed':
diff --git a/tempest/api/compute/admin/test_fixed_ips_negative.py b/tempest/api/compute/admin/test_fixed_ips_negative.py
index 35c719d..6698638 100644
--- a/tempest/api/compute/admin/test_fixed_ips_negative.py
+++ b/tempest/api/compute/admin/test_fixed_ips_negative.py
@@ -40,7 +40,7 @@
def resource_setup(cls):
super(FixedIPsNegativeTestJson, cls).resource_setup()
server = cls.create_test_server(wait_until='ACTIVE')
- server = cls.servers_client.get_server(server['id'])
+ server = cls.servers_client.show_server(server['id'])
for ip_set in server['addresses']:
for ip in server['addresses'][ip_set]:
if ip['OS-EXT-IPS:type'] == 'fixed':
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index f12784e..364d080 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -15,10 +15,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
@@ -125,7 +125,7 @@
self.addCleanup(self.flavor_clean_up, flavor['id'])
flag = False
# Verify flavor is retrieved
- flavors = self.client.list_flavors_with_detail()
+ flavors = self.client.list_flavors(detail=True)
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -165,7 +165,7 @@
verify_flavor_response_extension(flavor)
# Check if flavor is present in list
- flavors = self.user_client.list_flavors_with_detail()
+ flavors = self.user_client.list_flavors(detail=True)
for flavor in flavors:
if flavor['name'] == flavor_name:
verify_flavor_response_extension(flavor)
@@ -190,7 +190,7 @@
self.addCleanup(self.flavor_clean_up, flavor['id'])
# Verify flavor is retrieved
flag = False
- flavors = self.client.list_flavors_with_detail()
+ flavors = self.client.list_flavors(detail=True)
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -198,7 +198,7 @@
# Verify flavor is not retrieved with other user
flag = False
- flavors = self.user_client.list_flavors_with_detail()
+ flavors = self.user_client.list_flavors(detail=True)
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -240,7 +240,7 @@
flag = False
self.new_client = self.flavors_client
# Verify flavor is retrieved with new user
- flavors = self.new_client.list_flavors_with_detail()
+ flavors = self.new_client.list_flavors(detail=True)
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -278,7 +278,7 @@
def _test_string_variations(variations, flavor_name):
for string in variations:
params = {'is_public': string}
- flavors = self.client.list_flavors_with_detail(params)
+ flavors = self.client.list_flavors(detail=True, **params)
flavor = _flavor_lookup(flavors, flavor_name)
self.assertIsNotNone(flavor)
diff --git a/tempest/api/compute/admin/test_flavors_access.py b/tempest/api/compute/admin/test_flavors_access.py
index 61d3dc6..2baa53e 100644
--- a/tempest/api/compute/admin/test_flavors_access.py
+++ b/tempest/api/compute/admin/test_flavors_access.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
@@ -87,7 +86,7 @@
self.assertIn(resp_body, add_body)
# The flavor is present in list.
- flavors = self.flavors_client.list_flavors_with_detail()
+ flavors = self.flavors_client.list_flavors(detail=True)
self.assertIn(new_flavor['id'], map(lambda x: x['id'], flavors))
# Remove flavor access from a tenant.
@@ -96,5 +95,5 @@
self.assertNotIn(resp_body, remove_body)
# The flavor is not present in list.
- flavors = self.flavors_client.list_flavors_with_detail()
+ flavors = self.flavors_client.list_flavors(detail=True)
self.assertNotIn(new_flavor['id'], map(lambda x: x['id'], flavors))
diff --git a/tempest/api/compute/admin/test_flavors_access_negative.py b/tempest/api/compute/admin/test_flavors_access_negative.py
index be5e6cc..e5ae23b 100644
--- a/tempest/api/compute/admin/test_flavors_access_negative.py
+++ b/tempest/api/compute/admin/test_flavors_access_negative.py
@@ -15,10 +15,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs.py b/tempest/api/compute/admin/test_flavors_extra_specs.py
index a14a61f..6866c1a 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
index ba05c7f..8c5a103 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
@@ -14,10 +14,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/admin/test_hosts_negative.py b/tempest/api/compute/admin/test_hosts_negative.py
index 930d686..b2d2a04 100644
--- a/tempest/api/compute/admin/test_hosts_negative.py
+++ b/tempest/api/compute/admin/test_hosts_negative.py
@@ -12,10 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/admin/test_hypervisor_negative.py b/tempest/api/compute/admin/test_hypervisor_negative.py
index a5c2f0d..701b4bb 100644
--- a/tempest/api/compute/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/admin/test_hypervisor_negative.py
@@ -15,10 +15,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log.py b/tempest/api/compute/admin/test_instance_usage_audit_log.py
index 9da7901..189c316 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log.py
@@ -44,7 +44,7 @@
def test_get_instance_usage_audit_log(self):
# Get instance usage audit log before specified time
now = datetime.datetime.now()
- body = self.adm_client.get_instance_usage_audit_log(
+ body = self.adm_client.show_instance_usage_audit_log(
urllib.quote(now.strftime("%Y-%m-%d %H:%M:%S")))
expected_items = ['total_errors', 'total_instances', 'log',
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py b/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
index 97d665b..eea3103 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
@@ -39,12 +39,12 @@
now = datetime.datetime.now()
self.assertRaises(lib_exc.Forbidden,
self.instance_usages_audit_log_client.
- get_instance_usage_audit_log,
+ show_instance_usage_audit_log,
urllib.quote(now.strftime("%Y-%m-%d %H:%M:%S")))
@test.attr(type=['negative'])
@test.idempotent_id('9b952047-3641-41c7-ba91-a809fc5974c8')
def test_get_instance_usage_audit_logs_with_invalid_time(self):
self.assertRaises(lib_exc.BadRequest,
- self.adm_client.get_instance_usage_audit_log,
+ self.adm_client.show_instance_usage_audit_log,
"invalid_time")
diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py
index a03439a..548cd4f 100644
--- a/tempest/api/compute/admin/test_live_migration.py
+++ b/tempest/api/compute/admin/test_live_migration.py
@@ -47,7 +47,7 @@
]
def _get_server_details(self, server_id):
- body = self.admin_servers_client.get_server(server_id)
+ body = self.admin_servers_client.show_server(server_id)
return body
def _get_host_for_server(self, server_id):
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index 01db25c..47bdfa6 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -15,11 +15,11 @@
from oslo_log import log as logging
import six
-from tempest_lib.common.utils import data_utils
from testtools import matchers
from tempest.api.compute import base
from tempest.common import tempest_fixtures as fixtures
+from tempest.common.utils import data_utils
from tempest import test
LOG = logging.getLogger(__name__)
@@ -58,7 +58,7 @@
def test_get_default_quotas(self):
# Admin can get the default resource quota set for a tenant
expected_quota_set = self.default_quota_set | set(['id'])
- quota_set = self.adm_client.get_default_quota_set(
+ quota_set = self.adm_client.show_default_quota_set(
self.demo_tenant_id)
self.assertEqual(quota_set['id'], self.demo_tenant_id)
for quota in expected_quota_set:
@@ -67,7 +67,7 @@
@test.idempotent_id('55fbe2bf-21a9-435b-bbd2-4162b0ed799a')
def test_update_all_quota_resources_for_tenant(self):
# Admin can update all the resource quota limits for a tenant
- default_quota_set = self.adm_client.get_default_quota_set(
+ default_quota_set = self.adm_client.show_default_quota_set(
self.demo_tenant_id)
new_quota_set = {'injected_file_content_bytes': 20480,
'metadata_items': 256, 'injected_files': 10,
@@ -107,7 +107,7 @@
self.addCleanup(identity_client.delete_tenant, tenant_id)
self.adm_client.update_quota_set(tenant_id, ram='5120')
- quota_set = self.adm_client.get_quota_set(tenant_id)
+ quota_set = self.adm_client.show_quota_set(tenant_id)
self.assertEqual(5120, quota_set['ram'])
# Verify that GET shows the updated quota set of user
@@ -124,8 +124,8 @@
self.adm_client.update_quota_set(tenant_id,
user_id=user_id,
ram='2048')
- quota_set = self.adm_client.get_quota_set(tenant_id,
- user_id=user_id)
+ quota_set = self.adm_client.show_quota_set(tenant_id,
+ user_id=user_id)
self.assertEqual(2048, quota_set['ram'])
@test.idempotent_id('389d04f0-3a41-405f-9317-e5f86e3c44f0')
@@ -138,14 +138,14 @@
description=tenant_desc)
tenant_id = tenant['id']
self.addCleanup(identity_client.delete_tenant, tenant_id)
- quota_set_default = self.adm_client.get_quota_set(tenant_id)
+ quota_set_default = self.adm_client.show_quota_set(tenant_id)
ram_default = quota_set_default['ram']
self.adm_client.update_quota_set(tenant_id, ram='5120')
self.adm_client.delete_quota_set(tenant_id)
- quota_set_new = self.adm_client.get_quota_set(tenant_id)
+ quota_set_new = self.adm_client.show_quota_set(tenant_id)
self.assertEqual(ram_default, quota_set_new['ram'])
@@ -176,7 +176,7 @@
@test.idempotent_id('7932ab0f-5136-4075-b201-c0e2338df51a')
def test_update_default_quotas(self):
LOG.debug("get the current 'default' quota class values")
- body = self.adm_client.get_quota_class_set('default')
+ body = self.adm_client.show_quota_class_set('default')
self.assertIn('id', body)
self.assertEqual('default', body.pop('id'))
# restore the defaults when the test is done
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
index d20ebf3..20aa440 100644
--- a/tempest/api/compute/admin/test_quotas_negative.py
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -54,7 +54,7 @@
@test.idempotent_id('91058876-9947-4807-9f22-f6eb17140d9b')
def test_create_server_when_cpu_quota_is_full(self):
# Disallow server creation when tenant's vcpu quota is full
- quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+ quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
default_vcpu_quota = quota_set['cores']
vcpu_quota = 0 # Set the quota to zero to conserve resources
@@ -71,7 +71,7 @@
@test.idempotent_id('6fdd7012-584d-4327-a61c-49122e0d5864')
def test_create_server_when_memory_quota_is_full(self):
# Disallow server creation when tenant's memory quota is full
- quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+ quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
default_mem_quota = quota_set['ram']
mem_quota = 0 # Set the quota to zero to conserve resources
@@ -88,7 +88,7 @@
@test.idempotent_id('7c6be468-0274-449a-81c3-ac1c32ee0161')
def test_create_server_when_instances_quota_is_full(self):
# Once instances quota limit is reached, disallow server creation
- quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+ quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
default_instances_quota = quota_set['instances']
instances_quota = 0 # Set quota to zero to disallow server creation
@@ -107,7 +107,7 @@
def test_security_groups_exceed_limit(self):
# Negative test: Creation Security Groups over limit should FAIL
- quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+ quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
default_sg_quota = quota_set['security_groups']
sg_quota = 0 # Set the quota to zero to conserve resources
@@ -136,7 +136,7 @@
# Negative test: Creation of Security Group Rules should FAIL
# when we reach limit maxSecurityGroupRules
- quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+ quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
default_sg_rules_quota = quota_set['security_group_rules']
sg_rules_quota = 0 # Set the quota to zero to conserve resources
diff --git a/tempest/api/compute/admin/test_security_group_default_rules.py b/tempest/api/compute/admin/test_security_group_default_rules.py
index c1fe18c..13d6cc0 100644
--- a/tempest/api/compute/admin/test_security_group_default_rules.py
+++ b/tempest/api/compute/admin/test_security_group_default_rules.py
@@ -64,7 +64,7 @@
# Delete Security Group default rule
self.adm_client.delete_security_group_default_rule(rule['id'])
self.assertRaises(lib_exc.NotFound,
- self.adm_client.get_security_group_default_rule,
+ self.adm_client.show_security_group_default_rule,
rule['id'])
@test.idempotent_id('4d752e0a-33a1-4c3a-b498-ff8667ca22e5')
@@ -125,6 +125,6 @@
cidr)
self.addCleanup(self.adm_client.delete_security_group_default_rule,
rule['id'])
- fetched_rule = self.adm_client.get_security_group_default_rule(
+ fetched_rule = self.adm_client.show_security_group_default_rule(
rule['id'])
self.assertEqual(rule, fetched_rule)
diff --git a/tempest/api/compute/admin/test_security_groups.py b/tempest/api/compute/admin/test_security_groups.py
index d8679e0..2c3c629 100644
--- a/tempest/api/compute/admin/test_security_groups.py
+++ b/tempest/api/compute/admin/test_security_groups.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
import testtools
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 9c53e71..0062c1e 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
from tempest.api.compute import base
from tempest.common import fixed_network
+from tempest.common.utils import data_utils
from tempest import test
@@ -65,7 +65,7 @@
# Reset server's state to 'active'
self.client.reset_state(self.s1_id, state='active')
# Verify server's state
- server = self.client.get_server(self.s1_id)
+ server = self.client.show_server(self.s1_id)
self.assertEqual(server['status'], 'ACTIVE')
servers = body['servers']
# Verify error server in list result
@@ -114,7 +114,7 @@
**network_kwargs)
self.addCleanup(self.client.delete_server, test_server['id'])
self.client.wait_for_server_status(test_server['id'], 'ACTIVE')
- server = self.client.get_server(test_server['id'])
+ server = self.client.show_server(test_server['id'])
self.assertEqual(server['status'], 'ACTIVE')
hostname = server[self._host_key]
params = {'host': hostname}
@@ -133,14 +133,14 @@
self.client.reset_state(self.s1_id)
# Verify server's state
- server = self.client.get_server(self.s1_id)
+ server = self.client.show_server(self.s1_id)
self.assertEqual(server['status'], 'ERROR')
# Reset server's state to 'active'
self.client.reset_state(self.s1_id, state='active')
# Verify server's state
- server = self.client.get_server(self.s1_id)
+ server = self.client.show_server(self.s1_id)
self.assertEqual(server['status'], 'ACTIVE')
@decorators.skip_because(bug="1240043")
@@ -177,7 +177,7 @@
'ACTIVE',
raise_on_error=False)
# Verify the server properties after rebuilding
- server = self.non_admin_client.get_server(rebuilt_server['id'])
+ server = self.non_admin_client.show_server(rebuilt_server['id'])
rebuilt_image_id = server['image']['id']
self.assertEqual(self.image_ref_alt, rebuilt_image_id)
diff --git a/tempest/api/compute/admin/test_servers_negative.py b/tempest/api/compute/admin/test_servers_negative.py
index d325bd7..6d3c4a3 100644
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -14,12 +14,12 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
import testtools
from tempest.api.compute import base
from tempest.common import tempest_fixtures as fixtures
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -68,7 +68,7 @@
self.useFixture(fixtures.LockFixture('compute_quotas'))
flavor_name = data_utils.rand_name("flavor")
flavor_id = self._get_unused_flavor_id()
- quota_set = self.quotas_client.get_default_quota_set(self.tenant_id)
+ quota_set = self.quotas_client.show_default_quota_set(self.tenant_id)
ram = int(quota_set['ram']) + 1
vcpus = 8
disk = 10
@@ -91,7 +91,7 @@
flavor_name = data_utils.rand_name("flavor")
flavor_id = self._get_unused_flavor_id()
ram = 512
- quota_set = self.quotas_client.get_default_quota_set(self.tenant_id)
+ quota_set = self.quotas_client.show_default_quota_set(self.tenant_id)
vcpus = int(quota_set['cores']) + 1
disk = 10
flavor_ref = self.flavors_client.create_flavor(flavor_name,
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage.py b/tempest/api/compute/admin/test_simple_tenant_usage.py
index 98b7c5f..02085e8 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage.py
@@ -60,7 +60,7 @@
# Get usage for a specific tenant
params = {'start': self.start,
'end': self.end}
- tenant_usage = self.adm_client.get_tenant_usage(
+ tenant_usage = self.adm_client.show_tenant_usage(
self.tenant_id, params)
self.assertEqual(len(tenant_usage), 8)
@@ -70,7 +70,7 @@
# Get usage for a specific tenant with non admin user
params = {'start': self.start,
'end': self.end}
- tenant_usage = self.client.get_tenant_usage(
+ tenant_usage = self.client.show_tenant_usage(
self.tenant_id, params)
self.assertEqual(len(tenant_usage), 8)
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage_negative.py b/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
index 5a3c9a4..3c66859 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
@@ -47,7 +47,7 @@
params = {'start': self.start,
'end': self.end}
self.assertRaises(lib_exc.NotFound,
- self.adm_client.get_tenant_usage,
+ self.adm_client.show_tenant_usage,
'', params)
@test.attr(type=['negative'])
@@ -57,7 +57,7 @@
params = {'start': self.end,
'end': self.start}
self.assertRaises(lib_exc.BadRequest,
- self.adm_client.get_tenant_usage,
+ self.adm_client.show_tenant_usage,
self.client.tenant_id, params)
@test.attr(type=['negative'])
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index a1f6f99..04b909a 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -16,10 +16,10 @@
import time
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.common import compute
+from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
import tempest.test
diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py
index 251f4ec..728fefb 100644
--- a/tempest/api/compute/flavors/test_flavors.py
+++ b/tempest/api/compute/flavors/test_flavors.py
@@ -41,7 +41,7 @@
@test.idempotent_id('6e85fde4-b3cd-4137-ab72-ed5f418e8c24')
def test_list_flavors_with_detail(self):
# Detailed list of all flavors should contain the expected flavor
- flavors = self.client.list_flavors_with_detail()
+ flavors = self.client.list_flavors(detail=True)
flavor = self.client.show_flavor(self.flavor_ref)
self.assertIn(flavor, flavors)
@@ -56,14 +56,14 @@
def test_list_flavors_limit_results(self):
# Only the expected number of flavors should be returned
params = {'limit': 1}
- flavors = self.client.list_flavors(params)
+ flavors = self.client.list_flavors(**params)
self.assertEqual(1, len(flavors))
@test.idempotent_id('b26f6327-2886-467a-82be-cef7a27709cb')
def test_list_flavors_detailed_limit_results(self):
# Only the expected number of flavors (detailed) should be returned
params = {'limit': 1}
- flavors = self.client.list_flavors_with_detail(params)
+ flavors = self.client.list_flavors(detail=True, **params)
self.assertEqual(1, len(flavors))
@test.idempotent_id('e800f879-9828-4bd0-8eae-4f17189951fb')
@@ -73,7 +73,7 @@
flavor_id = flavor['id']
params = {'marker': flavor_id}
- flavors = self.client.list_flavors(params)
+ flavors = self.client.list_flavors(**params)
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
'The list of flavors did not start after the marker.')
@@ -84,7 +84,7 @@
flavor_id = flavor['id']
params = {'marker': flavor_id}
- flavors = self.client.list_flavors_with_detail(params)
+ flavors = self.client.list_flavors(detail=True, **params)
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
'The list of flavors did not start after the marker.')
@@ -95,7 +95,7 @@
flavor_id = flavor['id']
params = {self._min_disk: flavor['disk'] + 1}
- flavors = self.client.list_flavors_with_detail(params)
+ flavors = self.client.list_flavors(detail=True, **params)
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('09fe7509-b4ee-4b34-bf8b-39532dc47292')
@@ -105,7 +105,7 @@
flavor_id = flavor['id']
params = {self._min_ram: flavor['ram'] + 1}
- flavors = self.client.list_flavors_with_detail(params)
+ flavors = self.client.list_flavors(detail=True, **params)
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('10645a4d-96f5-443f-831b-730711e11dd4')
@@ -115,7 +115,7 @@
flavor_id = flavor['id']
params = {self._min_disk: flavor['disk'] + 1}
- flavors = self.client.list_flavors(params)
+ flavors = self.client.list_flavors(**params)
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('935cf550-e7c8-4da6-8002-00f92d5edfaa')
@@ -125,5 +125,5 @@
flavor_id = flavor['id']
params = {self._min_ram: flavor['ram'] + 1}
- flavors = self.client.list_flavors(params)
+ flavors = self.client.list_flavors(**params)
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions.py b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
index 093f16b..2cc1b59 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute.floating_ips import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
index d22d334..c07af72 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
@@ -15,10 +15,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute.floating_ips import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py b/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py
index 05d3d05..75b6b55 100644
--- a/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py
+++ b/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py
@@ -15,10 +15,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index 9664c61..b307b59 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -15,9 +15,8 @@
import six
-from tempest_lib.common.utils import data_utils
-
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -93,8 +92,8 @@
@test.idempotent_id('4f5db52f-6685-4c75-b848-f4bb363f9aa6')
def test_get_image_metadata_item(self):
# The value for a specific metadata key should be returned
- meta = self.client.get_image_metadata_item(self.image_id,
- 'os_distro')
+ meta = self.client.show_image_metadata_item(self.image_id,
+ 'os_distro')
self.assertEqual('value2', meta['os_distro'])
@test.idempotent_id('f2de776a-4778-4d90-a5da-aae63aee64ae')
diff --git a/tempest/api/compute/images/test_image_metadata_negative.py b/tempest/api/compute/images/test_image_metadata_negative.py
index e44fbfc..0f02166 100644
--- a/tempest/api/compute/images/test_image_metadata_negative.py
+++ b/tempest/api/compute/images/test_image_metadata_negative.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
@@ -49,7 +49,7 @@
def test_get_nonexistent_image_metadata_item(self):
# Negative test: Get on non-existent image should not happen
self.assertRaises(lib_exc.NotFound,
- self.client.get_image_metadata_item,
+ self.client.show_image_metadata_item,
data_utils.rand_uuid(), 'os_version')
@test.attr(type=['negative'])
diff --git a/tempest/api/compute/images/test_images.py b/tempest/api/compute/images/test_images.py
index 2896f14..0324df2 100644
--- a/tempest/api/compute/images/test_images.py
+++ b/tempest/api/compute/images/test_images.py
@@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/images/test_images_negative.py b/tempest/api/compute/images/test_images_negative.py
index 54a82e9..07eca9e 100644
--- a/tempest/api/compute/images/test_images_negative.py
+++ b/tempest/api/compute/images/test_images_negative.py
@@ -12,10 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index 1fd165b..38fed25 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -14,9 +14,9 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/images/test_images_oneserver_negative.py b/tempest/api/compute/images/test_images_oneserver_negative.py
index 8a39d90..1cd1ab7 100644
--- a/tempest/api/compute/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/images/test_images_oneserver_negative.py
@@ -15,10 +15,10 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index e2d4bd9..cc59084 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -17,10 +17,10 @@
from oslo_log import log as logging
import six
-from tempest_lib.common.utils import data_utils
import testtools
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -105,7 +105,7 @@
# The list of images should contain only images with the
# provided status
params = {'status': 'ACTIVE'}
- images = self.client.list_images(params)
+ images = self.client.list_images(**params)
self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
@@ -116,7 +116,7 @@
# List of all images should contain the expected images filtered
# by name
params = {'name': self.image1['name']}
- images = self.client.list_images(params)
+ images = self.client.list_images(**params)
self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
@@ -128,7 +128,7 @@
def test_list_images_filter_by_server_id(self):
# The images should contain images filtered by server id
params = {'server': self.server1['id']}
- images = self.client.list_images(params)
+ images = self.client.list_images(**params)
self.assertTrue(any([i for i in images
if i['id'] == self.snapshot1_id]),
@@ -149,7 +149,7 @@
# Try all server link types
for link in server_links:
params = {'server': link['href']}
- images = self.client.list_images(params)
+ images = self.client.list_images(**params)
self.assertFalse(any([i for i in images
if i['id'] == self.snapshot1_id]))
@@ -164,7 +164,7 @@
def test_list_images_filter_by_type(self):
# The list of servers should be filtered by image type
params = {'type': 'snapshot'}
- images = self.client.list_images(params)
+ images = self.client.list_images(**params)
self.assertTrue(any([i for i in images
if i['id'] == self.snapshot1_id]))
@@ -179,7 +179,7 @@
def test_list_images_limit_results(self):
# Verify only the expected number of results are returned
params = {'limit': '1'}
- images = self.client.list_images(params)
+ images = self.client.list_images(**params)
self.assertEqual(1, len([x for x in images if 'id' in x]))
@test.idempotent_id('18bac3ae-da27-436c-92a9-b22474d13aab')
@@ -189,7 +189,7 @@
# Becoming ACTIVE will modify the updated time
# Filter by the image's created time
params = {'changes-since': self.image3['created']}
- images = self.client.list_images(params)
+ images = self.client.list_images(**params)
found = any([i for i in images if i['id'] == self.image3_id])
self.assertTrue(found)
@@ -198,7 +198,7 @@
# Detailed list of all images should only contain images
# with the provided status
params = {'status': 'ACTIVE'}
- images = self.client.list_images_with_detail(params)
+ images = self.client.list_images(detail=True, **params)
self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
@@ -209,7 +209,7 @@
# Detailed list of all images should contain the expected
# images filtered by name
params = {'name': self.image1['name']}
- images = self.client.list_images_with_detail(params)
+ images = self.client.list_images(detail=True, **params)
self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
@@ -220,7 +220,7 @@
# Verify only the expected number of results (with full details)
# are returned
params = {'limit': '1'}
- images = self.client.list_images_with_detail(params)
+ images = self.client.list_images(detail=True, **params)
self.assertEqual(1, len(images))
@test.idempotent_id('8c78f822-203b-4bf6-8bba-56ebd551cf84')
@@ -233,7 +233,7 @@
# Try all server link types
for link in server_links:
params = {'server': link['href']}
- images = self.client.list_images_with_detail(params)
+ images = self.client.list_images(detail=True, **params)
self.assertFalse(any([i for i in images
if i['id'] == self.snapshot1_id]))
@@ -248,7 +248,7 @@
def test_list_images_with_detail_filter_by_type(self):
# The detailed list of servers should be filtered by image type
params = {'type': 'snapshot'}
- images = self.client.list_images_with_detail(params)
+ images = self.client.list_images(detail=True, **params)
self.client.show_image(self.image_ref)
self.assertTrue(any([i for i in images
@@ -267,5 +267,5 @@
# Becoming ACTIVE will modify the updated time
# Filter by the image's created time
params = {'changes-since': self.image1['created']}
- images = self.client.list_images_with_detail(params)
+ images = self.client.list_images(detail=True, **params)
self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
diff --git a/tempest/api/compute/images/test_list_image_filters_negative.py b/tempest/api/compute/images/test_list_image_filters_negative.py
index 4110619..82062bd 100644
--- a/tempest/api/compute/images/test_list_image_filters_negative.py
+++ b/tempest/api/compute/images/test_list_image_filters_negative.py
@@ -12,10 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/images/test_list_images.py b/tempest/api/compute/images/test_list_images.py
index 5b80c72..b67378c 100644
--- a/tempest/api/compute/images/test_list_images.py
+++ b/tempest/api/compute/images/test_list_images.py
@@ -50,6 +50,6 @@
@test.idempotent_id('9f94cb6b-7f10-48c5-b911-a0b84d7d4cd6')
def test_list_images_with_detail(self):
# Detailed list of all images should contain the expected images
- images = self.client.list_images_with_detail()
+ images = self.client.list_images(detail=True)
found = any([i for i in images if i['id'] == self.image_ref])
self.assertTrue(found)
diff --git a/tempest/api/compute/keypairs/test_keypairs.py b/tempest/api/compute/keypairs/test_keypairs.py
index 01e3c86..45eaa97 100644
--- a/tempest/api/compute/keypairs/test_keypairs.py
+++ b/tempest/api/compute/keypairs/test_keypairs.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
@@ -82,7 +81,7 @@
# Keypair should be created, Got details by name and deleted
k_name = data_utils.rand_name('keypair')
self._create_keypair(k_name)
- keypair_detail = self.client.get_keypair(k_name)
+ keypair_detail = self.client.show_keypair(k_name)
self.assertIn('name', keypair_detail)
self.assertIn('public_key', keypair_detail)
self.assertEqual(keypair_detail['name'], k_name,
diff --git a/tempest/api/compute/keypairs/test_keypairs_negative.py b/tempest/api/compute/keypairs/test_keypairs_negative.py
index 78db74e..54b07f0 100644
--- a/tempest/api/compute/keypairs/test_keypairs_negative.py
+++ b/tempest/api/compute/keypairs/test_keypairs_negative.py
@@ -14,10 +14,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/security_groups/test_security_group_rules_negative.py b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
index c654172..15e79ac 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules_negative.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute.security_groups import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py
index 0ce26a3..491e52e 100644
--- a/tempest/api/compute/security_groups/test_security_groups.py
+++ b/tempest/api/compute/security_groups/test_security_groups.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute.security_groups import base
+from tempest.common.utils import data_utils
from tempest import test
@@ -75,7 +75,7 @@
"not equal to the requested name")
# Now fetch the created Security Group by its 'id'
fetched_group = \
- self.client.get_security_group(securitygroup['id'])
+ self.client.show_security_group(securitygroup['id'])
self.assertEqual(securitygroup, fetched_group,
"The fetched Security Group is different "
"from the created Group")
@@ -141,6 +141,6 @@
description=s_new_des)
# get the security group
fetched_group = \
- self.client.get_security_group(securitygroup_id)
+ self.client.show_security_group(securitygroup_id)
self.assertEqual(s_new_name, fetched_group['name'])
self.assertEqual(s_new_des, fetched_group['description'])
diff --git a/tempest/api/compute/security_groups/test_security_groups_negative.py b/tempest/api/compute/security_groups/test_security_groups_negative.py
index 06e073d..d8cbe3d 100644
--- a/tempest/api/compute/security_groups/test_security_groups_negative.py
+++ b/tempest/api/compute/security_groups/test_security_groups_negative.py
@@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
from tempest_lib import exceptions as lib_exc
import testtools
from tempest.api.compute.security_groups import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -58,7 +58,7 @@
# Negative test:Should not be able to GET the details
# of non-existent Security Group
non_exist_id = self._generate_a_non_existent_security_group_id()
- self.assertRaises(lib_exc.NotFound, self.client.get_security_group,
+ self.assertRaises(lib_exc.NotFound, self.client.show_security_group,
non_exist_id)
@decorators.skip_because(bug="1161411",
diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py
index 7ce6269..c3c50d6 100644
--- a/tempest/api/compute/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/servers/test_attach_interfaces.py
@@ -159,7 +159,7 @@
network_id = ifs[0]['net_id']
self.client.add_fixed_ip(server['id'], network_id)
# Remove the fixed IP from server.
- server_detail = self.os.servers_client.get_server(
+ server_detail = self.os.servers_client.show_server(
server['id'])
# Get the Fixed IP from server.
fixed_ip = None
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index 408d4ee..8b0e1a4 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -16,10 +16,10 @@
import base64
import netaddr
-from tempest_lib.common.utils import data_utils
import testtools
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest.common.utils.linux import remote_client
from tempest import config
from tempest import test
@@ -63,7 +63,7 @@
personality=personality,
disk_config=disk_config)
cls.password = cls.server_initial['adminPass']
- cls.server = cls.client.get_server(cls.server_initial['id'])
+ cls.server = cls.client.show_server(cls.server_initial['id'])
@test.attr(type='smoke')
@test.idempotent_id('5de47127-9977-400a-936f-abcfbec1218f')
@@ -265,13 +265,13 @@
adminPass=admin_pass,
flavor=flavor_with_eph_disk_id))
# Get partition number of server without extra specs.
- server_no_eph_disk = self.client.get_server(
+ server_no_eph_disk = self.client.show_server(
server_no_eph_disk['id'])
linux_client = remote_client.RemoteClient(server_no_eph_disk,
self.ssh_user, admin_pass)
partition_num = len(linux_client.get_partitions().split('\n'))
- server_with_eph_disk = self.client.get_server(
+ server_with_eph_disk = self.client.show_server(
server_with_eph_disk['id'])
linux_client = remote_client.RemoteClient(server_with_eph_disk,
self.ssh_user, admin_pass)
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
index ac6ef4c..b36b721 100644
--- a/tempest/api/compute/servers/test_delete_server.py
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -144,7 +144,7 @@
server = self.create_test_server(wait_until='ACTIVE')
self.admin_client.reset_state(server['id'], state='error')
# Verify server's state
- server = self.non_admin_client.get_server(server['id'])
+ server = self.non_admin_client.show_server(server['id'])
self.assertEqual(server['status'], 'ERROR')
self.non_admin_client.delete_server(server['id'])
self.servers_client.wait_for_server_termination(server['id'],
diff --git a/tempest/api/compute/servers/test_disk_config.py b/tempest/api/compute/servers/test_disk_config.py
index 8482802..00aa510 100644
--- a/tempest/api/compute/servers/test_disk_config.py
+++ b/tempest/api/compute/servers/test_disk_config.py
@@ -43,12 +43,12 @@
cls.server_id = server['id']
def _update_server_with_disk_config(self, disk_config):
- server = self.client.get_server(self.server_id)
+ server = self.client.show_server(self.server_id)
if disk_config != server['OS-DCF:diskConfig']:
server = self.client.update_server(self.server_id,
disk_config=disk_config)
self.client.wait_for_server_status(server['id'], 'ACTIVE')
- server = self.client.get_server(server['id'])
+ server = self.client.show_server(server['id'])
self.assertEqual(disk_config, server['OS-DCF:diskConfig'])
@test.idempotent_id('bef56b09-2e8c-4883-a370-4950812f430e')
@@ -64,7 +64,7 @@
self.client.wait_for_server_status(server['id'], 'ACTIVE')
# Verify the specified attributes are set correctly
- server = self.client.get_server(server['id'])
+ server = self.client.show_server(server['id'])
self.assertEqual('MANUAL', server['OS-DCF:diskConfig'])
@test.idempotent_id('9c9fae77-4feb-402f-8450-bf1c8b609713')
@@ -80,11 +80,11 @@
self.client.wait_for_server_status(server['id'], 'ACTIVE')
# Verify the specified attributes are set correctly
- server = self.client.get_server(server['id'])
+ server = self.client.show_server(server['id'])
self.assertEqual('AUTO', server['OS-DCF:diskConfig'])
def _get_alternative_flavor(self):
- server = self.client.get_server(self.server_id)
+ server = self.client.show_server(self.server_id)
if server['flavor']['id'] == self.flavor_ref:
return self.flavor_ref_alt
@@ -105,7 +105,7 @@
self.client.confirm_resize(self.server_id)
self.client.wait_for_server_status(self.server_id, 'ACTIVE')
- server = self.client.get_server(self.server_id)
+ server = self.client.show_server(self.server_id)
self.assertEqual('AUTO', server['OS-DCF:diskConfig'])
@test.idempotent_id('693d16f3-556c-489a-8bac-3d0ca2490bad')
@@ -122,7 +122,7 @@
self.client.confirm_resize(self.server_id)
self.client.wait_for_server_status(self.server_id, 'ACTIVE')
- server = self.client.get_server(self.server_id)
+ server = self.client.show_server(self.server_id)
self.assertEqual('MANUAL', server['OS-DCF:diskConfig'])
@test.idempotent_id('5ef18867-358d-4de9-b3c9-94d4ba35742f')
@@ -136,5 +136,5 @@
self.client.wait_for_server_status(server['id'], 'ACTIVE')
# Verify the disk_config attribute is set correctly
- server = self.client.get_server(server['id'])
+ server = self.client.show_server(server['id'])
self.assertEqual('MANUAL', server['OS-DCF:diskConfig'])
diff --git a/tempest/api/compute/servers/test_instance_actions_negative.py b/tempest/api/compute/servers/test_instance_actions_negative.py
index afd3b7a..6567da1 100644
--- a/tempest/api/compute/servers/test_instance_actions_negative.py
+++ b/tempest/api/compute/servers/test_instance_actions_negative.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/servers/test_list_server_filters.py b/tempest/api/compute/servers/test_list_server_filters.py
index 7a91cab..326334c 100644
--- a/tempest/api/compute/servers/test_list_server_filters.py
+++ b/tempest/api/compute/servers/test_list_server_filters.py
@@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
from tempest.api import utils
from tempest.common import fixed_network
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -273,7 +273,7 @@
if not self.fixed_network_name:
msg = 'fixed_network_name needs to be configured to run this test'
raise self.skipException(msg)
- self.s1 = self.client.get_server(self.s1['id'])
+ self.s1 = self.client.show_server(self.s1['id'])
for addr_spec in self.s1['addresses'][self.fixed_network_name]:
ip = addr_spec['addr']
if addr_spec['version'] == 4:
@@ -297,7 +297,7 @@
if not self.fixed_network_name:
msg = 'fixed_network_name needs to be configured to run this test'
raise self.skipException(msg)
- self.s1 = self.client.get_server(self.s1['id'])
+ self.s1 = self.client.show_server(self.s1['id'])
addr_spec = self.s1['addresses'][self.fixed_network_name][0]
ip = addr_spec['addr'][0:-3]
if addr_spec['version'] == 4:
diff --git a/tempest/api/compute/servers/test_multiple_create.py b/tempest/api/compute/servers/test_multiple_create.py
index 11b457b..a945411 100644
--- a/tempest/api/compute/servers/test_multiple_create.py
+++ b/tempest/api/compute/servers/test_multiple_create.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/servers/test_multiple_create_negative.py b/tempest/api/compute/servers/test_multiple_create_negative.py
index bfc98ff..8135768 100644
--- a/tempest/api/compute/servers/test_multiple_create_negative.py
+++ b/tempest/api/compute/servers/test_multiple_create_negative.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 10b08a1..3aff595 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -17,12 +17,12 @@
import logging
from six.moves.urllib import parse as urlparse
-from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
from tempest_lib import exceptions as lib_exc
import testtools
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest.common.utils.linux import remote_client
from tempest import config
from tempest import test
@@ -76,7 +76,7 @@
if self.run_ssh:
# Verify that the user can authenticate with the new password
- server = self.client.get_server(self.server_id)
+ server = self.client.show_server(self.server_id)
linux_client = remote_client.RemoteClient(server, self.ssh_user,
new_password)
linux_client.validate_authentication()
@@ -84,7 +84,7 @@
def _test_reboot_server(self, reboot_type):
if self.run_ssh:
# Get the time the server was last rebooted,
- server = self.client.get_server(self.server_id)
+ server = self.client.show_server(self.server_id)
linux_client = remote_client.RemoteClient(server, self.ssh_user,
self.password)
boot_time = linux_client.get_boot_time()
@@ -149,7 +149,7 @@
# Verify the server properties after the rebuild completes
self.client.wait_for_server_status(rebuilt_server['id'], 'ACTIVE')
- server = self.client.get_server(rebuilt_server['id'])
+ server = self.client.show_server(rebuilt_server['id'])
rebuilt_image_id = server['image']['id']
self.assertTrue(self.image_ref_alt.endswith(rebuilt_image_id))
self.assertEqual(new_name, server['name'])
@@ -164,7 +164,7 @@
def test_rebuild_server_in_stop_state(self):
# The server in stop state should be rebuilt using the provided
# image and remain in SHUTOFF state
- server = self.client.get_server(self.server_id)
+ server = self.client.show_server(self.server_id)
old_image = server['image']['id']
new_image = (self.image_ref_alt
if old_image == self.image_ref else self.image_ref)
@@ -184,7 +184,7 @@
# Verify the server properties after the rebuild completes
self.client.wait_for_server_status(rebuilt_server['id'], 'SHUTOFF')
- server = self.client.get_server(rebuilt_server['id'])
+ server = self.client.show_server(rebuilt_server['id'])
rebuilt_image_id = server['image']['id']
self.assertEqual(new_image, rebuilt_image_id)
@@ -206,7 +206,7 @@
expected_status = 'SHUTOFF' if stop else 'ACTIVE'
self.client.wait_for_server_status(self.server_id, expected_status)
- server = self.client.get_server(self.server_id)
+ server = self.client.show_server(self.server_id)
self.assertEqual(self.flavor_ref_alt, server['flavor']['id'])
if stop:
@@ -242,7 +242,7 @@
self.client.revert_resize(self.server_id)
self.client.wait_for_server_status(self.server_id, 'ACTIVE')
- server = self.client.get_server(self.server_id)
+ server = self.client.show_server(self.server_id)
self.assertEqual(self.flavor_ref, server['flavor']['id'])
@test.idempotent_id('b963d4f1-94b3-4c40-9e97-7b583f46e470')
@@ -427,10 +427,10 @@
self.client.wait_for_server_status(self.server_id,
'SHELVED_OFFLOADED')
- server = self.client.get_server(self.server_id)
+ server = self.client.show_server(self.server_id)
image_name = server['name'] + '-shelved'
params = {'name': image_name}
- images = self.images_client.list_images(params)
+ images = self.images_client.list_images(**params)
self.assertEqual(1, len(images))
self.assertEqual(image_name, images[0]['name'])
@@ -448,7 +448,7 @@
def test_lock_unlock_server(self):
# Lock the server,try server stop(exceptions throw),unlock it and retry
self.servers_client.lock_server(self.server_id)
- server = self.servers_client.get_server(self.server_id)
+ server = self.servers_client.show_server(self.server_id)
self.assertEqual(server['status'], 'ACTIVE')
# Locked server is not allowed to be stopped by non-admin user
self.assertRaises(lib_exc.Conflict,
diff --git a/tempest/api/compute/servers/test_server_group.py b/tempest/api/compute/servers/test_server_group.py
index ca808dd..f6dd5e3 100644
--- a/tempest/api/compute/servers/test_server_group.py
+++ b/tempest/api/compute/servers/test_server_group.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py
index 1a977ab..c42ec3d 100644
--- a/tempest/api/compute/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
@@ -137,7 +137,7 @@
# A 403 Forbidden or 413 Overlimit (old behaviour) exception
# will be raised while exceeding metadata items limit for
# tenant.
- quota_set = self.quotas.get_quota_set(self.tenant_id)
+ quota_set = self.quotas.show_quota_set(self.tenant_id)
quota_metadata = quota_set['metadata_items']
if quota_metadata == -1:
raise self.skipException("No limit for metadata_items")
diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py
index 4e3ce47..20bc77f 100644
--- a/tempest/api/compute/servers/test_server_rescue.py
+++ b/tempest/api/compute/servers/test_server_rescue.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/servers/test_server_rescue_negative.py b/tempest/api/compute/servers/test_server_rescue_negative.py
index 7798005..9cc9e9b 100644
--- a/tempest/api/compute/servers/test_server_rescue_negative.py
+++ b/tempest/api/compute/servers/test_server_rescue_negative.py
@@ -13,11 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
import testtools
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index 31078e3..a7ebc09 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import test
@@ -52,9 +51,9 @@
wait_until='ACTIVE')
id2 = server['id']
self.assertNotEqual(id1, id2, "Did not create a new server")
- server = self.client.get_server(id1)
+ server = self.client.show_server(id1)
name1 = server['name']
- server = self.client.get_server(id2)
+ server = self.client.show_server(id2)
name2 = server['name']
self.assertEqual(name1, name2)
@@ -68,7 +67,7 @@
self.keypairs_client.list_keypairs()
server = self.create_test_server(key_name=key_name)
self.client.wait_for_server_status(server['id'], 'ACTIVE')
- server = self.client.get_server(server['id'])
+ server = self.client.show_server(server['id'])
self.assertEqual(key_name, server['key_name'])
def _update_server_name(self, server_id, status):
@@ -80,7 +79,7 @@
self.client.wait_for_server_status(server_id, status)
# Verify the name of the server has changed
- server = self.client.get_server(server_id)
+ server = self.client.show_server(server_id)
self.assertEqual(new_name, server['name'])
return server
@@ -112,7 +111,7 @@
self.client.wait_for_server_status(server['id'], 'ACTIVE')
# Verify the access addresses have been updated
- server = self.client.get_server(server['id'])
+ server = self.client.show_server(server['id'])
self.assertEqual('1.1.1.1', server['accessIPv4'])
self.assertEqual('::babe:202:202', server['accessIPv6'])
@@ -121,5 +120,5 @@
# Create a server without an IPv4 address(only IPv6 address).
server = self.create_test_server(accessIPv6='2001:2001::3')
self.client.wait_for_server_status(server['id'], 'ACTIVE')
- server = self.client.get_server(server['id'])
+ server = self.client.show_server(server['id'])
self.assertEqual('2001:2001::3', server['accessIPv6'])
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index 82ef7f5..d13d9d6 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -15,11 +15,11 @@
import sys
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
import testtools
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -326,7 +326,7 @@
def test_get_non_existent_server(self):
# Get a non existent server details
nonexistent_server = data_utils.rand_uuid()
- self.assertRaises(lib_exc.NotFound, self.client.get_server,
+ self.assertRaises(lib_exc.NotFound, self.client.show_server,
nonexistent_server)
@test.attr(type=['negative'])
@@ -472,10 +472,10 @@
self.client.wait_for_server_status(self.server_id,
'SHELVED')
- server = self.client.get_server(self.server_id)
+ server = self.client.show_server(self.server_id)
image_name = server['name'] + '-shelved'
params = {'name': image_name}
- images = self.images_client.list_images(params)
+ images = self.images_client.list_images(**params)
self.assertEqual(1, len(images))
self.assertEqual(image_name, images[0]['name'])
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index 63b78a0..58c2206 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -16,10 +16,10 @@
import six
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -62,7 +62,7 @@
def resource_setup(cls):
super(AuthorizationTestJSON, cls).resource_setup()
server = cls.create_test_server(wait_until='ACTIVE')
- cls.server = cls.client.get_server(server['id'])
+ cls.server = cls.client.show_server(server['id'])
name = data_utils.rand_name('image')
body = cls.glance_client.create_image(name=name,
@@ -103,7 +103,7 @@
@test.idempotent_id('56816e4a-bd34-47b5-aee9-268c3efeb5d4')
def test_get_server_for_alt_account_fails(self):
# A GET request for a server on another user's account should fail
- self.assertRaises(lib_exc.NotFound, self.alt_client.get_server,
+ self.assertRaises(lib_exc.NotFound, self.alt_client.show_server,
self.server['id'])
@test.idempotent_id('fb8a4870-6d9d-44ad-8375-95d52e98d9f6')
@@ -219,7 +219,7 @@
def test_get_keypair_of_alt_account_fails(self):
# A GET request for another user's keypair should fail
self.assertRaises(lib_exc.NotFound,
- self.alt_keypairs_client.get_keypair,
+ self.alt_keypairs_client.show_keypair,
self.keypairname)
@test.idempotent_id('6d841683-a8e0-43da-a1b8-b339f7692b61')
@@ -271,7 +271,7 @@
def test_get_security_group_of_alt_account_fails(self):
# A GET request for another user's security group should fail
self.assertRaises(lib_exc.NotFound,
- self.alt_security_client.get_security_group,
+ self.alt_security_client.show_security_group,
self.security_group['id'])
@test.idempotent_id('155387a5-2bbc-4acf-ab06-698dae537ea5')
@@ -356,7 +356,7 @@
self.images_client.set_image_metadata(self.image['id'],
req_metadata)
self.assertRaises(lib_exc.NotFound,
- self.alt_images_client.get_image_metadata_item,
+ self.alt_images_client.show_image_metadata_item,
self.image['id'], 'meta1')
@test.idempotent_id('79531e2e-e721-493c-8b30-a35db36fdaa6')
diff --git a/tempest/api/compute/test_live_block_migration_negative.py b/tempest/api/compute/test_live_block_migration_negative.py
index 5ee76ca..47251b2 100644
--- a/tempest/api/compute/test_live_block_migration_negative.py
+++ b/tempest/api/compute/test_live_block_migration_negative.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/compute/test_quotas.py b/tempest/api/compute/test_quotas.py
index a6e877c..e302798 100644
--- a/tempest/api/compute/test_quotas.py
+++ b/tempest/api/compute/test_quotas.py
@@ -47,14 +47,14 @@
def test_get_quotas(self):
# User can get the quota set for it's tenant
expected_quota_set = self.default_quota_set | set(['id'])
- quota_set = self.client.get_quota_set(self.tenant_id)
+ quota_set = self.client.show_quota_set(self.tenant_id)
self.assertEqual(quota_set['id'], self.tenant_id)
for quota in expected_quota_set:
self.assertIn(quota, quota_set.keys())
# get the quota set using user id
- quota_set = self.client.get_quota_set(self.tenant_id,
- self.user_id)
+ quota_set = self.client.show_quota_set(self.tenant_id,
+ self.user_id)
self.assertEqual(quota_set['id'], self.tenant_id)
for quota in expected_quota_set:
self.assertIn(quota, quota_set.keys())
@@ -63,7 +63,7 @@
def test_get_default_quotas(self):
# User can get the default quota set for it's tenant
expected_quota_set = self.default_quota_set | set(['id'])
- quota_set = self.client.get_default_quota_set(self.tenant_id)
+ quota_set = self.client.show_default_quota_set(self.tenant_id)
self.assertEqual(quota_set['id'], self.tenant_id)
for quota in expected_quota_set:
self.assertIn(quota, quota_set.keys())
@@ -72,6 +72,6 @@
def test_compare_tenant_quotas_with_default_quotas(self):
# Tenants are created with the default quota values
defualt_quota_set = \
- self.client.get_default_quota_set(self.tenant_id)
- tenant_quota_set = self.client.get_quota_set(self.tenant_id)
+ self.client.show_default_quota_set(self.tenant_id)
+ tenant_quota_set = self.client.show_quota_set(self.tenant_id)
self.assertEqual(defualt_quota_set, tenant_quota_set)
diff --git a/tempest/api/compute/test_tenant_networks.py b/tempest/api/compute/test_tenant_networks.py
index a37dce1..ad5adaa 100644
--- a/tempest/api/compute/test_tenant_networks.py
+++ b/tempest/api/compute/test_tenant_networks.py
@@ -29,5 +29,5 @@
self.assertNotEmpty(tenant_networks, "No tenant networks found.")
for net in tenant_networks:
- tenant_network = self.client.get_tenant_network(net['id'])
+ tenant_network = self.client.show_tenant_network(net['id'])
self.assertEqual(net['id'], tenant_network['id'])
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index d96dcc2..1a64b22 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from testtools import matchers
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -58,7 +58,7 @@
# Wait for Volume status to become ACTIVE
self.client.wait_for_volume_status(volume['id'], 'available')
# GET Volume
- fetched_volume = self.client.get_volume(volume['id'])
+ fetched_volume = self.client.show_volume(volume['id'])
# Verification of details of fetched Volume
self.assertEqual(v_name,
fetched_volume['displayName'],
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
index fdece0c..7ba62b0 100644
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -57,7 +56,7 @@
volume = cls.client.create_volume(display_name=v_name,
metadata=metadata)
cls.client.wait_for_volume_status(volume['id'], 'available')
- volume = cls.client.get_volume(volume['id'])
+ volume = cls.client.show_volume(volume['id'])
cls.volume_list.append(volume)
cls.volume_id_list.append(volume['id'])
except Exception:
@@ -102,7 +101,7 @@
def test_volume_list_with_details(self):
# Should return the list of Volumes with details
# Fetch all Volumes
- fetched_list = self.client.list_volumes_with_detail()
+ fetched_list = self.client.list_volumes(detail=True)
# Now check if all the Volumes created in setup are in fetched list
missing_volumes = [
v for v in self.volume_list if v not in fetched_list
@@ -117,7 +116,7 @@
def test_volume_list_param_limit(self):
# Return the list of volumes based on limit set
params = {'limit': 2}
- fetched_vol_list = self.client.list_volumes(params=params)
+ fetched_vol_list = self.client.list_volumes(**params)
self.assertEqual(len(fetched_vol_list), params['limit'],
"Failed to list volumes by limit set")
@@ -126,7 +125,7 @@
def test_volume_list_with_detail_param_limit(self):
# Return the list of volumes with details based on limit set.
params = {'limit': 2}
- fetched_vol_list = self.client.list_volumes_with_detail(params=params)
+ fetched_vol_list = self.client.list_volumes(detail=True, **params)
self.assertEqual(len(fetched_vol_list), params['limit'],
"Failed to list volume details by limit set")
@@ -137,7 +136,7 @@
# get all volumes list
all_vol_list = self.client.list_volumes()
params = {'offset': 1, 'limit': 1}
- fetched_vol_list = self.client.list_volumes(params=params)
+ fetched_vol_list = self.client.list_volumes(**params)
# Validating length of the fetched volumes
self.assertEqual(len(fetched_vol_list), params['limit'],
@@ -152,9 +151,9 @@
def test_volume_list_with_detail_param_offset_and_limit(self):
# Return the list of volumes details based on offset and limit set.
# get all volumes list
- all_vol_list = self.client.list_volumes_with_detail()
+ all_vol_list = self.client.list_volumes(detail=True)
params = {'offset': 1, 'limit': 1}
- fetched_vol_list = self.client.list_volumes_with_detail(params=params)
+ fetched_vol_list = self.client.list_volumes(detail=True, **params)
# Validating length of the fetched volumes
self.assertEqual(len(fetched_vol_list), params['limit'],
diff --git a/tempest/api/compute/volumes/test_volumes_negative.py b/tempest/api/compute/volumes/test_volumes_negative.py
index 65d9def..01a0baf 100644
--- a/tempest/api/compute/volumes/test_volumes_negative.py
+++ b/tempest/api/compute/volumes/test_volumes_negative.py
@@ -15,10 +15,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -45,7 +45,7 @@
# Negative: Should not be able to get details of nonexistent volume
# Creating a nonexistent volume id
# Trying to GET a non existent volume
- self.assertRaises(lib_exc.NotFound, self.client.get_volume,
+ self.assertRaises(lib_exc.NotFound, self.client.show_volume,
str(uuid.uuid4()))
@test.attr(type=['negative'])
@@ -91,13 +91,13 @@
def test_get_invalid_volume_id(self):
# Negative: Should not be able to get volume with invalid id
self.assertRaises(lib_exc.NotFound,
- self.client.get_volume, '#$%%&^&^')
+ self.client.show_volume, '#$%%&^&^')
@test.attr(type=['negative'])
@test.idempotent_id('62bab09a-4c03-4617-8cca-8572bc94af9b')
def test_get_volume_without_passing_volume_id(self):
# Negative: Should not be able to get volume when empty ID is passed
- self.assertRaises(lib_exc.NotFound, self.client.get_volume, '')
+ self.assertRaises(lib_exc.NotFound, self.client.show_volume, '')
@test.attr(type=['negative'])
@test.idempotent_id('62972737-124b-4513-b6cf-2f019f178494')
diff --git a/tempest/api/data_processing/test_cluster_templates.py b/tempest/api/data_processing/test_cluster_templates.py
index cebf493..e357a85 100644
--- a/tempest/api/data_processing/test_cluster_templates.py
+++ b/tempest/api/data_processing/test_cluster_templates.py
@@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.data_processing import base as dp_base
+from tempest.common.utils import data_utils
from tempest import exceptions
from tempest import test
diff --git a/tempest/api/data_processing/test_data_sources.py b/tempest/api/data_processing/test_data_sources.py
index 5d2ed2d..dd16b2f 100644
--- a/tempest/api/data_processing/test_data_sources.py
+++ b/tempest/api/data_processing/test_data_sources.py
@@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.data_processing import base as dp_base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/data_processing/test_job_binaries.py b/tempest/api/data_processing/test_job_binaries.py
index 694cf25..fb21270 100644
--- a/tempest/api/data_processing/test_job_binaries.py
+++ b/tempest/api/data_processing/test_job_binaries.py
@@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.data_processing import base as dp_base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/data_processing/test_job_binary_internals.py b/tempest/api/data_processing/test_job_binary_internals.py
index ee4e68a..3d76ebe 100644
--- a/tempest/api/data_processing/test_job_binary_internals.py
+++ b/tempest/api/data_processing/test_job_binary_internals.py
@@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.data_processing import base as dp_base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/data_processing/test_jobs.py b/tempest/api/data_processing/test_jobs.py
index b155615..83eb54d 100644
--- a/tempest/api/data_processing/test_jobs.py
+++ b/tempest/api/data_processing/test_jobs.py
@@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.data_processing import base as dp_base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/data_processing/test_node_group_templates.py b/tempest/api/data_processing/test_node_group_templates.py
index 4068027..102799d 100644
--- a/tempest/api/data_processing/test_node_group_templates.py
+++ b/tempest/api/data_processing/test_node_group_templates.py
@@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.data_processing import base as dp_base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/database/flavors/test_flavors.py b/tempest/api/database/flavors/test_flavors.py
index eeb472c..e698baa 100644
--- a/tempest/api/database/flavors/test_flavors.py
+++ b/tempest/api/database/flavors/test_flavors.py
@@ -58,7 +58,7 @@
@test.services('compute')
def test_compare_db_flavors_with_os(self):
db_flavors = self.client.list_db_flavors()
- os_flavors = self.os_flavors_client.list_flavors_with_detail()
+ os_flavors = self.os_flavors_client.list_flavors(detail=True)
self.assertEqual(len(os_flavors), len(db_flavors),
"OS flavors %s do not match DB flavors %s" %
(os_flavors, db_flavors))
diff --git a/tempest/api/identity/admin/v2/test_roles.py b/tempest/api/identity/admin/v2/test_roles.py
index 4e89bfe..1babc45 100644
--- a/tempest/api/identity/admin/v2/test_roles.py
+++ b/tempest/api/identity/admin/v2/test_roles.py
@@ -14,9 +14,9 @@
# under the License.
from six import moves
-from tempest_lib.common.utils import data_utils
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v2/test_roles_negative.py b/tempest/api/identity/admin/v2/test_roles_negative.py
index 3654f9c..b38b7dd 100644
--- a/tempest/api/identity/admin/v2/test_roles_negative.py
+++ b/tempest/api/identity/admin/v2/test_roles_negative.py
@@ -15,10 +15,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v2/test_services.py b/tempest/api/identity/admin/v2/test_services.py
index de1d091..ef93981 100644
--- a/tempest/api/identity/admin/v2/test_services.py
+++ b/tempest/api/identity/admin/v2/test_services.py
@@ -14,10 +14,10 @@
# under the License.
from six import moves
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v2/test_tenant_negative.py b/tempest/api/identity/admin/v2/test_tenant_negative.py
index 367b699..bccb5ca 100644
--- a/tempest/api/identity/admin/v2/test_tenant_negative.py
+++ b/tempest/api/identity/admin/v2/test_tenant_negative.py
@@ -15,10 +15,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v2/test_tenants.py b/tempest/api/identity/admin/v2/test_tenants.py
index cfd3d7f..f828f66 100644
--- a/tempest/api/identity/admin/v2/test_tenants.py
+++ b/tempest/api/identity/admin/v2/test_tenants.py
@@ -14,9 +14,9 @@
# under the License.
from six import moves
-from tempest_lib.common.utils import data_utils
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v2/test_tokens.py b/tempest/api/identity/admin/v2/test_tokens.py
index ee2530b..66d00d1 100644
--- a/tempest/api/identity/admin/v2/test_tokens.py
+++ b/tempest/api/identity/admin/v2/test_tokens.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v2/test_users.py b/tempest/api/identity/admin/v2/test_users.py
index 8eac80c..bfbcfe7 100644
--- a/tempest/api/identity/admin/v2/test_users.py
+++ b/tempest/api/identity/admin/v2/test_users.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from testtools import matchers
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v2/test_users_negative.py b/tempest/api/identity/admin/v2/test_users_negative.py
index 3c15006..85f7411 100644
--- a/tempest/api/identity/admin/v2/test_users_negative.py
+++ b/tempest/api/identity/admin/v2/test_users_negative.py
@@ -15,10 +15,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index 98ab093..662d06c 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_default_project_id.py b/tempest/api/identity/admin/v3/test_default_project_id.py
index 0b9d60e..98fff09 100644
--- a/tempest/api/identity/admin/v3/test_default_project_id.py
+++ b/tempest/api/identity/admin/v3/test_default_project_id.py
@@ -11,10 +11,10 @@
# under the License.
from tempest_lib import auth
-from tempest_lib.common.utils import data_utils
from tempest.api.identity import base
from tempest import clients
+from tempest.common.utils import data_utils
from tempest import config
from tempest import manager
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_domains.py b/tempest/api/identity/admin/v3/test_domains.py
index 94aab5b..5bfb981 100644
--- a/tempest/api/identity/admin/v3/test_domains.py
+++ b/tempest/api/identity/admin/v3/test_domains.py
@@ -14,11 +14,10 @@
# under the License.
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
-from tempest_lib.common.utils import data_utils
-
CONF = config.CONF
diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py
index 9ca10a4..9a8104f 100644
--- a/tempest/api/identity/admin/v3/test_endpoints.py
+++ b/tempest/api/identity/admin/v3/test_endpoints.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_endpoints_negative.py b/tempest/api/identity/admin/v3/test_endpoints_negative.py
index 7972dbb..b043415 100644
--- a/tempest/api/identity/admin/v3/test_endpoints_negative.py
+++ b/tempest/api/identity/admin/v3/test_endpoints_negative.py
@@ -14,10 +14,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index fed4dc2..88e2959 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_list_projects.py b/tempest/api/identity/admin/v3/test_list_projects.py
index d88b00d..12d80bb 100644
--- a/tempest/api/identity/admin/v3/test_list_projects.py
+++ b/tempest/api/identity/admin/v3/test_list_projects.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_list_users.py b/tempest/api/identity/admin/v3/test_list_users.py
index eeee3bb..d3d51b4 100644
--- a/tempest/api/identity/admin/v3/test_list_users.py
+++ b/tempest/api/identity/admin/v3/test_list_users.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_policies.py b/tempest/api/identity/admin/v3/test_policies.py
index 6c5599a..8b67945 100644
--- a/tempest/api/identity/admin/v3/test_policies.py
+++ b/tempest/api/identity/admin/v3/test_policies.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index 41cf840..17712f3 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_projects_negative.py b/tempest/api/identity/admin/v3/test_projects_negative.py
index 37ec071..d5ee5a7 100644
--- a/tempest/api/identity/admin/v3/test_projects_negative.py
+++ b/tempest/api/identity/admin/v3/test_projects_negative.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_regions.py b/tempest/api/identity/admin/v3/test_regions.py
index 986007a..7eb92bc 100644
--- a/tempest/api/identity/admin/v3/test_regions.py
+++ b/tempest/api/identity/admin/v3/test_regions.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py
index 7857e11..f58a5c5 100644
--- a/tempest/api/identity/admin/v3/test_roles.py
+++ b/tempest/api/identity/admin/v3/test_roles.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_services.py b/tempest/api/identity/admin/v3/test_services.py
index b2a75aa..95a7dcc 100644
--- a/tempest/api/identity/admin/v3/test_services.py
+++ b/tempest/api/identity/admin/v3/test_services.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_tokens.py b/tempest/api/identity/admin/v3/test_tokens.py
index 41d67c7..951bc78 100644
--- a/tempest/api/identity/admin/v3/test_tokens.py
+++ b/tempest/api/identity/admin/v3/test_tokens.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index 8a2d797..1ac34eb 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -14,12 +14,12 @@
import re
from oslo_utils import timeutils
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
from tempest import clients
from tempest.common import cred_provider
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index c2456c4..19cb24e 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.identity import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 913e807..0654f37 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -14,10 +14,10 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.common import cred_provider
+from tempest.common.utils import data_utils
from tempest import config
import tempest.test
diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
index dc38cab..87013db 100644
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -14,9 +14,9 @@
from oslo_log import log as logging
from six import moves
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
+from tempest.common.utils import data_utils
from tempest import config
import tempest.test
diff --git a/tempest/api/image/v1/test_image_members_negative.py b/tempest/api/image/v1/test_image_members_negative.py
index df0e88a..50f5048 100644
--- a/tempest/api/image/v1/test_image_members_negative.py
+++ b/tempest/api/image/v1/test_image_members_negative.py
@@ -12,10 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.image import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index 3f71fcb..8beed32 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -14,9 +14,9 @@
# under the License.
from six import moves
-from tempest_lib.common.utils import data_utils
from tempest.api.image import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/image/v2/test_images.py b/tempest/api/image/v2/test_images.py
index 2859cfe..20e9bca 100644
--- a/tempest/api/image/v2/test_images.py
+++ b/tempest/api/image/v2/test_images.py
@@ -17,9 +17,9 @@
import random
from six import moves
-from tempest_lib.common.utils import data_utils
from tempest.api.image import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/image/v2/test_images_tags.py b/tempest/api/image/v2/test_images_tags.py
index e38136e..42a4b87 100644
--- a/tempest/api/image/v2/test_images_tags.py
+++ b/tempest/api/image/v2/test_images_tags.py
@@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.image import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/image/v2/test_images_tags_negative.py b/tempest/api/image/v2/test_images_tags_negative.py
index 571b1f7..a3f4ca8 100644
--- a/tempest/api/image/v2/test_images_tags_negative.py
+++ b/tempest/api/image/v2/test_images_tags_negative.py
@@ -14,10 +14,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.image import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/messaging/base.py b/tempest/api/messaging/base.py
index 34ac860..64a7fd5 100644
--- a/tempest/api/messaging/base.py
+++ b/tempest/api/messaging/base.py
@@ -14,8 +14,8 @@
# limitations under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/messaging/test_claims.py b/tempest/api/messaging/test_claims.py
index 34e1fe8..e54bed1 100644
--- a/tempest/api/messaging/test_claims.py
+++ b/tempest/api/messaging/test_claims.py
@@ -16,10 +16,10 @@
import logging
from six.moves.urllib import parse as urlparse
-from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
from tempest.api.messaging import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/messaging/test_messages.py b/tempest/api/messaging/test_messages.py
index c8640b3..efbbf56 100644
--- a/tempest/api/messaging/test_messages.py
+++ b/tempest/api/messaging/test_messages.py
@@ -15,9 +15,8 @@
import logging
-from tempest_lib.common.utils import data_utils
-
from tempest.api.messaging import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/messaging/test_queues.py b/tempest/api/messaging/test_queues.py
index a3541b3..df49663 100644
--- a/tempest/api/messaging/test_queues.py
+++ b/tempest/api/messaging/test_queues.py
@@ -16,11 +16,11 @@
import logging
from six import moves
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from testtools import matchers
from tempest.api.messaging import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/network/admin/test_external_network_extension.py b/tempest/api/network/admin/test_external_network_extension.py
index 75f2719..d942641 100644
--- a/tempest/api/network/admin/test_external_network_extension.py
+++ b/tempest/api/network/admin/test_external_network_extension.py
@@ -10,9 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.network import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/network/admin/test_floating_ips_admin_actions.py b/tempest/api/network/admin/test_floating_ips_admin_actions.py
index d4e94ca..dfe7307 100644
--- a/tempest/api/network/admin/test_floating_ips_admin_actions.py
+++ b/tempest/api/network/admin/test_floating_ips_admin_actions.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.network import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/network/admin/test_l3_agent_scheduler.py b/tempest/api/network/admin/test_l3_agent_scheduler.py
index 38d68c2..d5556b8 100644
--- a/tempest/api/network/admin/test_l3_agent_scheduler.py
+++ b/tempest/api/network/admin/test_l3_agent_scheduler.py
@@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.network import base
+from tempest.common.utils import data_utils
from tempest import exceptions
from tempest import test
diff --git a/tempest/api/network/admin/test_lbaas_agent_scheduler.py b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
deleted file mode 100644
index 7234348..0000000
--- a/tempest/api/network/admin/test_lbaas_agent_scheduler.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright 2013 IBM Corp.
-#
-# 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 tempest_lib.common.utils import data_utils
-
-from tempest.api.network import base
-from tempest import test
-
-
-class LBaaSAgentSchedulerTestJSON(base.BaseAdminNetworkTest):
- """
- Tests the following operations in the Neutron API using the REST client for
- Neutron:
-
- List pools the given LBaaS agent is hosting.
- Show a LBaaS agent hosting the given pool.
-
- v2.0 of the Neutron API is assumed. It is also assumed that the following
- options are defined in the [networki-feature-enabled] section of
- etc/tempest.conf:
-
- api_extensions
- """
-
- @classmethod
- def skip_checks(cls):
- super(LBaaSAgentSchedulerTestJSON, cls).skip_checks()
- if not test.is_extension_enabled('lbaas_agent_scheduler', 'network'):
- msg = "LBaaS Agent Scheduler Extension not enabled."
- raise cls.skipException(msg)
-
- @classmethod
- def resource_setup(cls):
- super(LBaaSAgentSchedulerTestJSON, cls).resource_setup()
- cls.network = cls.create_network()
- cls.subnet = cls.create_subnet(cls.network)
- pool_name = data_utils.rand_name('pool-')
- cls.pool = cls.create_pool(pool_name, "ROUND_ROBIN",
- "HTTP", cls.subnet)
-
- @test.idempotent_id('e5ea8b15-4f44-4350-963c-e0fcb533ee79')
- def test_list_pools_on_lbaas_agent(self):
- found = False
- body = self.admin_client.list_agents(
- agent_type="Loadbalancer agent")
- agents = body['agents']
- for a in agents:
- msg = 'Load Balancer agent expected'
- self.assertEqual(a['agent_type'], 'Loadbalancer agent', msg)
- body = (
- self.admin_client.list_pools_hosted_by_one_lbaas_agent(
- a['id']))
- pools = body['pools']
- if self.pool['id'] in [p['id'] for p in pools]:
- found = True
- msg = 'Unable to find Load Balancer agent hosting pool'
- self.assertTrue(found, msg)
-
- @test.idempotent_id('e2745593-fd79-4b98-a262-575fd7865796')
- def test_show_lbaas_agent_hosting_pool(self):
- body = self.admin_client.show_lbaas_agent_hosting_pool(
- self.pool['id'])
- self.assertEqual('Loadbalancer agent', body['agent']['agent_type'])
diff --git a/tempest/api/network/admin/test_load_balancer_admin_actions.py b/tempest/api/network/admin/test_load_balancer_admin_actions.py
deleted file mode 100644
index 24a04be..0000000
--- a/tempest/api/network/admin/test_load_balancer_admin_actions.py
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright 2014 Mirantis.inc
-# 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 tempest_lib.common.utils import data_utils
-
-from tempest.api.network import base
-from tempest import test
-
-
-class LoadBalancerAdminTestJSON(base.BaseAdminNetworkTest):
- """
- Test admin actions for load balancer.
-
- Create VIP for another tenant
- Create health monitor for another tenant
- """
-
- force_tenant_isolation = True
-
- @classmethod
- def skip_checks(cls):
- super(LoadBalancerAdminTestJSON, cls).skip_checks()
- if not test.is_extension_enabled('lbaas', 'network'):
- msg = "lbaas extension not enabled."
- raise cls.skipException(msg)
-
- @classmethod
- def setup_clients(cls):
- super(LoadBalancerAdminTestJSON, cls).setup_clients()
- cls.client = cls.manager.network_client
-
- @classmethod
- def resource_setup(cls):
- super(LoadBalancerAdminTestJSON, cls).resource_setup()
- cls.tenant_id = cls.os.credentials.tenant_id
- cls.network = cls.create_network()
- cls.subnet = cls.create_subnet(cls.network)
- cls.pool = cls.create_pool(data_utils.rand_name('pool-'),
- "ROUND_ROBIN", "HTTP", cls.subnet)
-
- @test.idempotent_id('6b0a20d8-4fcd-455e-b54f-ec4db5199518')
- def test_create_vip_as_admin_for_another_tenant(self):
- name = data_utils.rand_name('vip-')
- body = self.admin_client.create_pool(
- name=data_utils.rand_name('pool-'),
- lb_method="ROUND_ROBIN",
- protocol="HTTP",
- subnet_id=self.subnet['id'],
- tenant_id=self.tenant_id)
- pool = body['pool']
- self.addCleanup(self.admin_client.delete_pool, pool['id'])
- body = self.admin_client.create_vip(name=name,
- protocol="HTTP",
- protocol_port=80,
- subnet_id=self.subnet['id'],
- pool_id=pool['id'],
- tenant_id=self.tenant_id)
- vip = body['vip']
- self.addCleanup(self.admin_client.delete_vip, vip['id'])
- self.assertIsNotNone(vip['id'])
- self.assertEqual(self.tenant_id, vip['tenant_id'])
- body = self.client.show_vip(vip['id'])
- show_vip = body['vip']
- self.assertEqual(vip['id'], show_vip['id'])
- self.assertEqual(vip['name'], show_vip['name'])
-
- @test.idempotent_id('74552cfc-ab78-4fb6-825b-f67bca379921')
- def test_create_health_monitor_as_admin_for_another_tenant(self):
- body = (
- self.admin_client.create_health_monitor(delay=4,
- max_retries=3,
- type="TCP",
- timeout=1,
- tenant_id=self.tenant_id))
- health_monitor = body['health_monitor']
- self.addCleanup(self.admin_client.delete_health_monitor,
- health_monitor['id'])
- self.assertIsNotNone(health_monitor['id'])
- self.assertEqual(self.tenant_id, health_monitor['tenant_id'])
- body = self.client.show_health_monitor(health_monitor['id'])
- show_health_monitor = body['health_monitor']
- self.assertEqual(health_monitor['id'], show_health_monitor['id'])
-
- @test.idempotent_id('266a192d-3c22-46c4-a8fb-802450301e82')
- def test_create_pool_from_admin_user_other_tenant(self):
- body = self.admin_client.create_pool(
- name=data_utils.rand_name('pool-'),
- lb_method="ROUND_ROBIN",
- protocol="HTTP",
- subnet_id=self.subnet['id'],
- tenant_id=self.tenant_id)
- pool = body['pool']
- self.addCleanup(self.admin_client.delete_pool, pool['id'])
- self.assertIsNotNone(pool['id'])
- self.assertEqual(self.tenant_id, pool['tenant_id'])
-
- @test.idempotent_id('158bb272-b9ed-4cfc-803c-661dac46f783')
- def test_create_member_from_admin_user_other_tenant(self):
- body = self.admin_client.create_member(address="10.0.9.47",
- protocol_port=80,
- pool_id=self.pool['id'],
- tenant_id=self.tenant_id)
- member = body['member']
- self.addCleanup(self.admin_client.delete_member, member['id'])
- self.assertIsNotNone(member['id'])
- self.assertEqual(self.tenant_id, member['tenant_id'])
diff --git a/tempest/api/network/admin/test_quotas.py b/tempest/api/network/admin/test_quotas.py
index 46d6651..cb113a7 100644
--- a/tempest/api/network/admin/test_quotas.py
+++ b/tempest/api/network/admin/test_quotas.py
@@ -14,9 +14,9 @@
# under the License.
import six
-from tempest_lib.common.utils import data_utils
from tempest.api.network import base
+from tempest.common.utils import data_utils
from tempest import test
@@ -90,10 +90,3 @@
def test_quotas(self):
new_quotas = {'network': 0, 'security_group': 0}
self._check_quotas(new_quotas)
-
- @test.idempotent_id('a7add2b1-691e-44d6-875f-697d9685f091')
- @test.requires_ext(extension='lbaas', service='network')
- def test_lbaas_quotas(self):
- new_quotas = {'vip': 1, 'pool': 2,
- 'member': 3, 'health_monitor': 4}
- self._check_quotas(new_quotas)
diff --git a/tempest/api/network/admin/test_routers_dvr.py b/tempest/api/network/admin/test_routers_dvr.py
index e59be02..9e2d080 100644
--- a/tempest/api/network/admin/test_routers_dvr.py
+++ b/tempest/api/network/admin/test_routers_dvr.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.network import base_routers as base
+from tempest.common.utils import data_utils
from tempest import test
@@ -36,10 +35,10 @@
super(RoutersTestDVR, cls).resource_setup()
name = data_utils.rand_name('pretest-check')
router = cls.admin_client.create_router(name)
- if 'distributed' not in router['router']:
- msg = "'distributed' attribute not found. DVR Possibly not enabled"
- raise cls.skipException(msg)
cls.admin_client.delete_router(router['router']['id'])
+ if 'distributed' not in router['router']:
+ msg = "'distributed' flag not found. DVR Possibly not enabled"
+ raise cls.skipException(msg)
@test.idempotent_id('08a2a0a8-f1e4-4b34-8e30-e522e836c44e')
def test_distributed_router_creation(self):
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index f864f95..fda8fc3 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -15,9 +15,9 @@
import netaddr
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
+from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
import tempest.test
@@ -82,64 +82,19 @@
cls.subnets = []
cls.ports = []
cls.routers = []
- cls.pools = []
- cls.vips = []
- cls.members = []
- cls.health_monitors = []
- cls.vpnservices = []
- cls.ikepolicies = []
cls.floating_ips = []
cls.metering_labels = []
cls.metering_label_rules = []
- cls.fw_rules = []
- cls.fw_policies = []
- cls.ipsecpolicies = []
cls.ethertype = "IPv" + str(cls._ip_version)
@classmethod
def resource_cleanup(cls):
if CONF.service_available.neutron:
- # Clean up ipsec policies
- for ipsecpolicy in cls.ipsecpolicies:
- cls._try_delete_resource(cls.client.delete_ipsecpolicy,
- ipsecpolicy['id'])
- # Clean up firewall policies
- for fw_policy in cls.fw_policies:
- cls._try_delete_resource(cls.client.delete_firewall_policy,
- fw_policy['id'])
- # Clean up firewall rules
- for fw_rule in cls.fw_rules:
- cls._try_delete_resource(cls.client.delete_firewall_rule,
- fw_rule['id'])
- # Clean up ike policies
- for ikepolicy in cls.ikepolicies:
- cls._try_delete_resource(cls.client.delete_ikepolicy,
- ikepolicy['id'])
- # Clean up vpn services
- for vpnservice in cls.vpnservices:
- cls._try_delete_resource(cls.client.delete_vpnservice,
- vpnservice['id'])
# Clean up floating IPs
for floating_ip in cls.floating_ips:
cls._try_delete_resource(cls.client.delete_floatingip,
floating_ip['id'])
- # Clean up health monitors
- for health_monitor in cls.health_monitors:
- cls._try_delete_resource(cls.client.delete_health_monitor,
- health_monitor['id'])
- # Clean up members
- for member in cls.members:
- cls._try_delete_resource(cls.client.delete_member,
- member['id'])
- # Clean up vips
- for vip in cls.vips:
- cls._try_delete_resource(cls.client.delete_vip,
- vip['id'])
- # Clean up pools
- for pool in cls.pools:
- cls._try_delete_resource(cls.client.delete_pool,
- pool['id'])
# Clean up metering label rules
for metering_label_rule in cls.metering_label_rules:
cls._try_delete_resource(
@@ -284,78 +239,6 @@
return fip
@classmethod
- def create_pool(cls, name, lb_method, protocol, subnet):
- """Wrapper utility that returns a test pool."""
- body = cls.client.create_pool(
- name=name,
- lb_method=lb_method,
- protocol=protocol,
- subnet_id=subnet['id'])
- pool = body['pool']
- cls.pools.append(pool)
- return pool
-
- @classmethod
- def update_pool(cls, name):
- """Wrapper utility that returns a test pool."""
- body = cls.client.update_pool(name=name)
- pool = body['pool']
- return pool
-
- @classmethod
- def create_vip(cls, name, protocol, protocol_port, subnet, pool):
- """Wrapper utility that returns a test vip."""
- body = cls.client.create_vip(name=name,
- protocol=protocol,
- protocol_port=protocol_port,
- subnet_id=subnet['id'],
- pool_id=pool['id'])
- vip = body['vip']
- cls.vips.append(vip)
- return vip
-
- @classmethod
- def update_vip(cls, name):
- body = cls.client.update_vip(name=name)
- vip = body['vip']
- return vip
-
- @classmethod
- def create_member(cls, protocol_port, pool, ip_version=None):
- """Wrapper utility that returns a test member."""
- ip_version = ip_version if ip_version is not None else cls._ip_version
- member_address = "fd00::abcd" if ip_version == 6 else "10.0.9.46"
- body = cls.client.create_member(address=member_address,
- protocol_port=protocol_port,
- pool_id=pool['id'])
- member = body['member']
- cls.members.append(member)
- return member
-
- @classmethod
- def update_member(cls, admin_state_up):
- body = cls.client.update_member(admin_state_up=admin_state_up)
- member = body['member']
- return member
-
- @classmethod
- def create_health_monitor(cls, delay, max_retries, Type, timeout):
- """Wrapper utility that returns a test health monitor."""
- body = cls.client.create_health_monitor(delay=delay,
- max_retries=max_retries,
- type=Type,
- timeout=timeout)
- health_monitor = body['health_monitor']
- cls.health_monitors.append(health_monitor)
- return health_monitor
-
- @classmethod
- def update_health_monitor(cls, admin_state_up):
- body = cls.client.update_vip(admin_state_up=admin_state_up)
- health_monitor = body['health_monitor']
- return health_monitor
-
- @classmethod
def create_router_interface(cls, router_id, subnet_id):
"""Wrapper utility that returns a router interface."""
interface = cls.client.add_router_interface_with_subnet_id(
@@ -363,44 +246,6 @@
return interface
@classmethod
- def create_vpnservice(cls, subnet_id, router_id):
- """Wrapper utility that returns a test vpn service."""
- body = cls.client.create_vpnservice(
- subnet_id=subnet_id, router_id=router_id, admin_state_up=True,
- name=data_utils.rand_name("vpnservice-"))
- vpnservice = body['vpnservice']
- cls.vpnservices.append(vpnservice)
- return vpnservice
-
- @classmethod
- def create_ikepolicy(cls, name):
- """Wrapper utility that returns a test ike policy."""
- body = cls.client.create_ikepolicy(name=name)
- ikepolicy = body['ikepolicy']
- cls.ikepolicies.append(ikepolicy)
- return ikepolicy
-
- @classmethod
- def create_firewall_rule(cls, action, protocol):
- """Wrapper utility that returns a test firewall rule."""
- body = cls.client.create_firewall_rule(
- name=data_utils.rand_name("fw-rule"),
- action=action,
- protocol=protocol)
- fw_rule = body['firewall_rule']
- cls.fw_rules.append(fw_rule)
- return fw_rule
-
- @classmethod
- def create_firewall_policy(cls):
- """Wrapper utility that returns a test firewall policy."""
- body = cls.client.create_firewall_policy(
- name=data_utils.rand_name("fw-policy"))
- fw_policy = body['firewall_policy']
- cls.fw_policies.append(fw_policy)
- return fw_policy
-
- @classmethod
def delete_router(cls, router):
body = cls.client.list_router_interfaces(router['id'])
interfaces = body['ports']
@@ -412,14 +257,6 @@
pass
cls.client.delete_router(router['id'])
- @classmethod
- def create_ipsecpolicy(cls, name):
- """Wrapper utility that returns a test ipsec policy."""
- body = cls.client.create_ipsecpolicy(name=name)
- ipsecpolicy = body['ipsecpolicy']
- cls.ipsecpolicies.append(ipsecpolicy)
- return ipsecpolicy
-
class BaseAdminNetworkTest(BaseNetworkTest):
diff --git a/tempest/api/network/base_security_groups.py b/tempest/api/network/base_security_groups.py
index 6699bf7..1cef2cc 100644
--- a/tempest/api/network/base_security_groups.py
+++ b/tempest/api/network/base_security_groups.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.network import base
+from tempest.common.utils import data_utils
class BaseSecGroupTest(base.BaseNetworkTest):
diff --git a/tempest/api/network/test_dhcp_ipv6.py b/tempest/api/network/test_dhcp_ipv6.py
index 5d798e3..f362f85 100644
--- a/tempest/api/network/test_dhcp_ipv6.py
+++ b/tempest/api/network/test_dhcp_ipv6.py
@@ -17,10 +17,10 @@
import random
import six
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.network import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/network/test_extra_dhcp_options.py b/tempest/api/network/test_extra_dhcp_options.py
index 72ac821..87e3413 100644
--- a/tempest/api/network/test_extra_dhcp_options.py
+++ b/tempest/api/network/test_extra_dhcp_options.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.network import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/network/test_floating_ips.py b/tempest/api/network/test_floating_ips.py
index 57dab5f..f0923d2 100644
--- a/tempest/api/network/test_floating_ips.py
+++ b/tempest/api/network/test_floating_ips.py
@@ -14,9 +14,9 @@
# under the License.
import netaddr
-from tempest_lib.common.utils import data_utils
from tempest.api.network import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/network/test_floating_ips_negative.py b/tempest/api/network/test_floating_ips_negative.py
index 8790102..e8624d8 100644
--- a/tempest/api/network/test_floating_ips_negative.py
+++ b/tempest/api/network/test_floating_ips_negative.py
@@ -14,10 +14,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.network import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/network/test_fwaas_extensions.py b/tempest/api/network/test_fwaas_extensions.py
deleted file mode 100644
index 651b4ab..0000000
--- a/tempest/api/network/test_fwaas_extensions.py
+++ /dev/null
@@ -1,333 +0,0 @@
-# Copyright 2014 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.
-
-import six
-from tempest_lib.common.utils import data_utils
-from tempest_lib import exceptions as lib_exc
-
-from tempest.api.network import base
-from tempest import config
-from tempest import exceptions
-from tempest import test
-
-CONF = config.CONF
-
-
-class FWaaSExtensionTestJSON(base.BaseNetworkTest):
- """
- Tests the following operations in the Neutron API using the REST client for
- Neutron:
-
- List firewall rules
- Create firewall rule
- Update firewall rule
- Delete firewall rule
- Show firewall rule
- List firewall policies
- Create firewall policy
- Update firewall policy
- Insert firewall rule to policy
- Remove firewall rule from policy
- Insert firewall rule after/before rule in policy
- Update firewall policy audited attribute
- Delete firewall policy
- Show firewall policy
- List firewall
- Create firewall
- Update firewall
- Delete firewall
- Show firewall
- """
-
- @classmethod
- def skip_checks(cls):
- super(FWaaSExtensionTestJSON, cls).skip_checks()
- if not test.is_extension_enabled('fwaas', 'network'):
- msg = "FWaaS Extension not enabled."
- raise cls.skipException(msg)
-
- @classmethod
- def resource_setup(cls):
- super(FWaaSExtensionTestJSON, cls).resource_setup()
- cls.fw_rule = cls.create_firewall_rule("allow", "tcp")
- cls.fw_policy = cls.create_firewall_policy()
-
- def _try_delete_policy(self, policy_id):
- # delete policy, if it exists
- try:
- self.client.delete_firewall_policy(policy_id)
- # if policy is not found, this means it was deleted in the test
- except lib_exc.NotFound:
- pass
-
- def _try_delete_rule(self, rule_id):
- # delete rule, if it exists
- try:
- self.client.delete_firewall_rule(rule_id)
- # if rule is not found, this means it was deleted in the test
- except lib_exc.NotFound:
- pass
-
- def _try_delete_firewall(self, fw_id):
- # delete firewall, if it exists
- try:
- self.client.delete_firewall(fw_id)
- # if firewall is not found, this means it was deleted in the test
- except lib_exc.NotFound:
- pass
-
- self.client.wait_for_resource_deletion('firewall', fw_id)
-
- def _wait_until_ready(self, fw_id):
- target_states = ('ACTIVE', 'CREATED')
-
- def _wait():
- firewall = self.client.show_firewall(fw_id)
- firewall = firewall['firewall']
- return firewall['status'] in target_states
-
- if not test.call_until_true(_wait, CONF.network.build_timeout,
- CONF.network.build_interval):
- status = self.client.show_firewall(fw_id)['firewall']['status']
- m = ("Timed out waiting for firewall %s to reach %s state(s) "
- "after %ss, currently in %s state." %
- (fw_id,
- target_states,
- CONF.network.build_interval,
- status))
- raise exceptions.TimeoutException(m)
-
- @test.idempotent_id('1b84cf01-9c09-4ce7-bc72-b15e39076468')
- def test_list_firewall_rules(self):
- # List firewall rules
- fw_rules = self.client.list_firewall_rules()
- fw_rules = fw_rules['firewall_rules']
- self.assertIn((self.fw_rule['id'],
- self.fw_rule['name'],
- self.fw_rule['action'],
- self.fw_rule['protocol'],
- self.fw_rule['ip_version'],
- self.fw_rule['enabled']),
- [(m['id'],
- m['name'],
- m['action'],
- m['protocol'],
- m['ip_version'],
- m['enabled']) for m in fw_rules])
-
- @test.idempotent_id('563564f7-7077-4f5e-8cdc-51f37ae5a2b9')
- def test_create_update_delete_firewall_rule(self):
- # Create firewall rule
- body = self.client.create_firewall_rule(
- name=data_utils.rand_name("fw-rule"),
- action="allow",
- protocol="tcp")
- fw_rule_id = body['firewall_rule']['id']
-
- # Update firewall rule
- body = self.client.update_firewall_rule(fw_rule_id,
- shared=True)
- self.assertTrue(body["firewall_rule"]['shared'])
-
- # Delete firewall rule
- self.client.delete_firewall_rule(fw_rule_id)
- # Confirm deletion
- fw_rules = self.client.list_firewall_rules()
- self.assertNotIn(fw_rule_id,
- [m['id'] for m in fw_rules['firewall_rules']])
-
- @test.idempotent_id('3ff8c08e-26ff-4034-ae48-810ed213a998')
- def test_show_firewall_rule(self):
- # show a created firewall rule
- fw_rule = self.client.show_firewall_rule(self.fw_rule['id'])
- for key, value in six.iteritems(fw_rule['firewall_rule']):
- self.assertEqual(self.fw_rule[key], value)
-
- @test.idempotent_id('1086dd93-a4c0-4bbb-a1bd-6d4bc62c199f')
- def test_list_firewall_policies(self):
- fw_policies = self.client.list_firewall_policies()
- fw_policies = fw_policies['firewall_policies']
- self.assertIn((self.fw_policy['id'],
- self.fw_policy['name'],
- self.fw_policy['firewall_rules']),
- [(m['id'],
- m['name'],
- m['firewall_rules']) for m in fw_policies])
-
- @test.idempotent_id('bbf37b6c-498c-421e-9c95-45897d3ed775')
- def test_create_update_delete_firewall_policy(self):
- # Create firewall policy
- body = self.client.create_firewall_policy(
- name=data_utils.rand_name("fw-policy"))
- fw_policy_id = body['firewall_policy']['id']
- self.addCleanup(self._try_delete_policy, fw_policy_id)
-
- # Update firewall policy
- body = self.client.update_firewall_policy(fw_policy_id,
- shared=True,
- name="updated_policy")
- updated_fw_policy = body["firewall_policy"]
- self.assertTrue(updated_fw_policy['shared'])
- self.assertEqual("updated_policy", updated_fw_policy['name'])
-
- # Delete firewall policy
- self.client.delete_firewall_policy(fw_policy_id)
- # Confirm deletion
- fw_policies = self.client.list_firewall_policies()
- fw_policies = fw_policies['firewall_policies']
- self.assertNotIn(fw_policy_id, [m['id'] for m in fw_policies])
-
- @test.idempotent_id('1df59b3a-517e-41d4-96f6-fc31cf4ecff2')
- def test_show_firewall_policy(self):
- # show a created firewall policy
- fw_policy = self.client.show_firewall_policy(self.fw_policy['id'])
- fw_policy = fw_policy['firewall_policy']
- for key, value in six.iteritems(fw_policy):
- self.assertEqual(self.fw_policy[key], value)
-
- @test.idempotent_id('02082a03-3cdd-4789-986a-1327dd80bfb7')
- def test_create_show_delete_firewall(self):
- # Create tenant network resources required for an ACTIVE firewall
- network = self.create_network()
- subnet = self.create_subnet(network)
- router = self.create_router(
- data_utils.rand_name('router-'),
- admin_state_up=True)
- self.client.add_router_interface_with_subnet_id(
- router['id'], subnet['id'])
-
- # Create firewall
- body = self.client.create_firewall(
- name=data_utils.rand_name("firewall"),
- firewall_policy_id=self.fw_policy['id'])
- created_firewall = body['firewall']
- firewall_id = created_firewall['id']
- self.addCleanup(self._try_delete_firewall, firewall_id)
-
- # Wait for the firewall resource to become ready
- self._wait_until_ready(firewall_id)
-
- # show a created firewall
- firewall = self.client.show_firewall(firewall_id)
- firewall = firewall['firewall']
-
- for key, value in six.iteritems(firewall):
- if key == 'status':
- continue
- self.assertEqual(created_firewall[key], value)
-
- # list firewall
- firewalls = self.client.list_firewalls()
- firewalls = firewalls['firewalls']
- self.assertIn((created_firewall['id'],
- created_firewall['name'],
- created_firewall['firewall_policy_id']),
- [(m['id'],
- m['name'],
- m['firewall_policy_id']) for m in firewalls])
-
- # Delete firewall
- self.client.delete_firewall(firewall_id)
-
- @test.idempotent_id('53305b4b-9897-4e01-87c0-2ae386083180')
- def test_firewall_rule_insertion_position_removal_rule_from_policy(self):
- # Create firewall rule
- body = self.client.create_firewall_rule(
- name=data_utils.rand_name("fw-rule"),
- action="allow",
- protocol="tcp")
- fw_rule_id1 = body['firewall_rule']['id']
- self.addCleanup(self._try_delete_rule, fw_rule_id1)
- # Create firewall policy
- body = self.client.create_firewall_policy(
- name=data_utils.rand_name("fw-policy"))
- fw_policy_id = body['firewall_policy']['id']
- self.addCleanup(self._try_delete_policy, fw_policy_id)
-
- # Insert rule to firewall policy
- self.client.insert_firewall_rule_in_policy(
- fw_policy_id, fw_rule_id1, '', '')
-
- # Verify insertion of rule in policy
- self.assertIn(fw_rule_id1, self._get_list_fw_rule_ids(fw_policy_id))
- # Create another firewall rule
- body = self.client.create_firewall_rule(
- name=data_utils.rand_name("fw-rule"),
- action="allow",
- protocol="icmp")
- fw_rule_id2 = body['firewall_rule']['id']
- self.addCleanup(self._try_delete_rule, fw_rule_id2)
-
- # Insert rule to firewall policy after the first rule
- self.client.insert_firewall_rule_in_policy(
- fw_policy_id, fw_rule_id2, fw_rule_id1, '')
-
- # Verify the posiition of rule after insertion
- fw_rule = self.client.show_firewall_rule(
- fw_rule_id2)
-
- self.assertEqual(int(fw_rule['firewall_rule']['position']), 2)
- # Remove rule from the firewall policy
- self.client.remove_firewall_rule_from_policy(
- fw_policy_id, fw_rule_id2)
- # Insert rule to firewall policy before the first rule
- self.client.insert_firewall_rule_in_policy(
- fw_policy_id, fw_rule_id2, '', fw_rule_id1)
- # Verify the posiition of rule after insertion
- fw_rule = self.client.show_firewall_rule(
- fw_rule_id2)
- self.assertEqual(int(fw_rule['firewall_rule']['position']), 1)
- # Remove rule from the firewall policy
- self.client.remove_firewall_rule_from_policy(
- fw_policy_id, fw_rule_id2)
- # Verify removal of rule from firewall policy
- self.assertNotIn(fw_rule_id2, self._get_list_fw_rule_ids(fw_policy_id))
-
- # Remove rule from the firewall policy
- self.client.remove_firewall_rule_from_policy(
- fw_policy_id, fw_rule_id1)
-
- # Verify removal of rule from firewall policy
- self.assertNotIn(fw_rule_id1, self._get_list_fw_rule_ids(fw_policy_id))
-
- def _get_list_fw_rule_ids(self, fw_policy_id):
- fw_policy = self.client.show_firewall_policy(
- fw_policy_id)
- return [ruleid for ruleid in fw_policy['firewall_policy']
- ['firewall_rules']]
-
- @test.idempotent_id('8515ca8a-0d2f-4298-b5ff-6f924e4587ca')
- def test_update_firewall_policy_audited_attribute(self):
- # Create firewall rule
- body = self.client.create_firewall_rule(
- name=data_utils.rand_name("fw-rule"),
- action="allow",
- protocol="icmp")
- fw_rule_id = body['firewall_rule']['id']
- self.addCleanup(self._try_delete_rule, fw_rule_id)
- # Create firewall policy
- body = self.client.create_firewall_policy(
- name=data_utils.rand_name('fw-policy'))
- fw_policy_id = body['firewall_policy']['id']
- self.addCleanup(self._try_delete_policy, fw_policy_id)
- self.assertFalse(body['firewall_policy']['audited'])
- # Update firewall policy audited attribute to ture
- self.client.update_firewall_policy(fw_policy_id,
- audited=True)
- # Insert Firewall rule to firewall policy
- self.client.insert_firewall_rule_in_policy(
- fw_policy_id, fw_rule_id, '', '')
- body = self.client.show_firewall_policy(
- fw_policy_id)
- self.assertFalse(body['firewall_policy']['audited'])
diff --git a/tempest/api/network/test_load_balancer.py b/tempest/api/network/test_load_balancer.py
deleted file mode 100644
index 38a6fe9..0000000
--- a/tempest/api/network/test_load_balancer.py
+++ /dev/null
@@ -1,432 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# 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.
-
-import six
-from tempest_lib.common.utils import data_utils
-from tempest_lib import decorators
-
-from tempest.api.network import base
-from tempest import test
-
-
-class LoadBalancerTestJSON(base.BaseNetworkTest):
- """
- Tests the following operations in the Neutron API using the REST client for
- Neutron:
-
- create vIP, and Pool
- show vIP
- list vIP
- update vIP
- delete vIP
- update pool
- delete pool
- show pool
- list pool
- health monitoring operations
- """
-
- @classmethod
- def skip_checks(cls):
- super(LoadBalancerTestJSON, cls).skip_checks()
- if not test.is_extension_enabled('lbaas', 'network'):
- msg = "lbaas extension not enabled."
- raise cls.skipException(msg)
-
- @classmethod
- def resource_setup(cls):
- super(LoadBalancerTestJSON, cls).resource_setup()
- cls.network = cls.create_network()
- cls.name = cls.network['name']
- cls.subnet = cls.create_subnet(cls.network)
- pool_name = data_utils.rand_name('pool-')
- vip_name = data_utils.rand_name('vip-')
- cls.pool = cls.create_pool(pool_name, "ROUND_ROBIN",
- "HTTP", cls.subnet)
- cls.vip = cls.create_vip(name=vip_name,
- protocol="HTTP",
- protocol_port=80,
- subnet=cls.subnet,
- pool=cls.pool)
- cls.member = cls.create_member(80, cls.pool, cls._ip_version)
- cls.member_address = ("10.0.9.47" if cls._ip_version == 4
- else "2015::beef")
- cls.health_monitor = cls.create_health_monitor(delay=4,
- max_retries=3,
- Type="TCP",
- timeout=1)
-
- def _check_list_with_filter(self, obj_name, attr_exceptions, **kwargs):
- create_obj = getattr(self.client, 'create_' + obj_name)
- delete_obj = getattr(self.client, 'delete_' + obj_name)
- list_objs = getattr(self.client, 'list_' + obj_name + 's')
-
- body = create_obj(**kwargs)
- obj = body[obj_name]
- self.addCleanup(delete_obj, obj['id'])
- for key, value in six.iteritems(obj):
- # It is not relevant to filter by all arguments. That is why
- # there is a list of attr to except
- if key not in attr_exceptions:
- body = list_objs(**{key: value})
- objs = [v[key] for v in body[obj_name + 's']]
- self.assertIn(value, objs)
-
- @test.idempotent_id('c96dbfab-4a80-4e74-a535-e950b5bedd47')
- def test_list_vips(self):
- # Verify the vIP exists in the list of all vIPs
- body = self.client.list_vips()
- vips = body['vips']
- self.assertIn(self.vip['id'], [v['id'] for v in vips])
-
- @test.idempotent_id('b8853f65-5089-4e69-befd-041a143427ff')
- def test_list_vips_with_filter(self):
- name = data_utils.rand_name('vip-')
- body = self.client.create_pool(name=data_utils.rand_name("pool-"),
- lb_method="ROUND_ROBIN",
- protocol="HTTPS",
- subnet_id=self.subnet['id'])
- pool = body['pool']
- self.addCleanup(self.client.delete_pool, pool['id'])
- attr_exceptions = ['status', 'session_persistence',
- 'status_description']
- self._check_list_with_filter(
- 'vip', attr_exceptions, name=name, protocol="HTTPS",
- protocol_port=81, subnet_id=self.subnet['id'], pool_id=pool['id'],
- description=data_utils.rand_name('description-'),
- admin_state_up=False)
-
- @test.idempotent_id('27f56083-9af9-4a48-abe9-ca1bcc6c9035')
- def test_create_update_delete_pool_vip(self):
- # Creates a vip
- name = data_utils.rand_name('vip-')
- address = self.subnet['allocation_pools'][0]['end']
- body = self.client.create_pool(
- name=data_utils.rand_name("pool-"),
- lb_method='ROUND_ROBIN',
- protocol='HTTP',
- subnet_id=self.subnet['id'])
- pool = body['pool']
- body = self.client.create_vip(name=name,
- protocol="HTTP",
- protocol_port=80,
- subnet_id=self.subnet['id'],
- pool_id=pool['id'],
- address=address)
- vip = body['vip']
- vip_id = vip['id']
- # Confirm VIP's address correctness with a show
- body = self.client.show_vip(vip_id)
- vip = body['vip']
- self.assertEqual(address, vip['address'])
- # Verification of vip update
- new_name = "New_vip"
- new_description = "New description"
- persistence_type = "HTTP_COOKIE"
- update_data = {"session_persistence": {
- "type": persistence_type}}
- body = self.client.update_vip(vip_id,
- name=new_name,
- description=new_description,
- connection_limit=10,
- admin_state_up=False,
- **update_data)
- updated_vip = body['vip']
- self.assertEqual(new_name, updated_vip['name'])
- self.assertEqual(new_description, updated_vip['description'])
- self.assertEqual(10, updated_vip['connection_limit'])
- self.assertFalse(updated_vip['admin_state_up'])
- self.assertEqual(persistence_type,
- updated_vip['session_persistence']['type'])
- self.client.delete_vip(vip['id'])
- self.client.wait_for_resource_deletion('vip', vip['id'])
- # Verification of pool update
- new_name = "New_pool"
- body = self.client.update_pool(pool['id'],
- name=new_name,
- description="new_description",
- lb_method='LEAST_CONNECTIONS')
- updated_pool = body['pool']
- self.assertEqual(new_name, updated_pool['name'])
- self.assertEqual('new_description', updated_pool['description'])
- self.assertEqual('LEAST_CONNECTIONS', updated_pool['lb_method'])
- self.client.delete_pool(pool['id'])
-
- @test.idempotent_id('0435a95e-1d19-4d90-9e9f-3b979e9ad089')
- def test_show_vip(self):
- # Verifies the details of a vip
- body = self.client.show_vip(self.vip['id'])
- vip = body['vip']
- for key, value in six.iteritems(vip):
- # 'status' should not be confirmed in api tests
- if key != 'status':
- self.assertEqual(self.vip[key], value)
-
- @test.idempotent_id('6e7a7d31-8451-456d-b24a-e50479ce42a7')
- def test_show_pool(self):
- # Here we need to new pool without any dependence with vips
- body = self.client.create_pool(name=data_utils.rand_name("pool-"),
- lb_method='ROUND_ROBIN',
- protocol='HTTP',
- subnet_id=self.subnet['id'])
- pool = body['pool']
- self.addCleanup(self.client.delete_pool, pool['id'])
- # Verifies the details of a pool
- body = self.client.show_pool(pool['id'])
- shown_pool = body['pool']
- for key, value in six.iteritems(pool):
- # 'status' should not be confirmed in api tests
- if key != 'status':
- self.assertEqual(value, shown_pool[key])
-
- @test.idempotent_id('d1ab1ffa-e06a-487f-911f-56418cb27727')
- def test_list_pools(self):
- # Verify the pool exists in the list of all pools
- body = self.client.list_pools()
- pools = body['pools']
- self.assertIn(self.pool['id'], [p['id'] for p in pools])
-
- @test.idempotent_id('27cc4c1a-caac-4273-b983-2acb4afaad4f')
- def test_list_pools_with_filters(self):
- attr_exceptions = ['status', 'vip_id', 'members', 'provider',
- 'status_description']
- self._check_list_with_filter(
- 'pool', attr_exceptions, name=data_utils.rand_name("pool-"),
- lb_method="ROUND_ROBIN", protocol="HTTPS",
- subnet_id=self.subnet['id'],
- description=data_utils.rand_name('description-'),
- admin_state_up=False)
-
- @test.idempotent_id('282d0dfd-5c3a-4c9b-b39c-c99782f39193')
- def test_list_members(self):
- # Verify the member exists in the list of all members
- body = self.client.list_members()
- members = body['members']
- self.assertIn(self.member['id'], [m['id'] for m in members])
-
- @test.idempotent_id('243b5126-24c6-4879-953e-7c7e32d8a57f')
- def test_list_members_with_filters(self):
- attr_exceptions = ['status', 'status_description']
- self._check_list_with_filter('member', attr_exceptions,
- address=self.member_address,
- protocol_port=80,
- pool_id=self.pool['id'])
-
- @test.idempotent_id('fb833ee8-9e69-489f-b540-a409762b78b2')
- def test_create_update_delete_member(self):
- # Creates a member
- body = self.client.create_member(address=self.member_address,
- protocol_port=80,
- pool_id=self.pool['id'])
- member = body['member']
- # Verification of member update
- body = self.client.update_member(member['id'],
- admin_state_up=False)
- updated_member = body['member']
- self.assertFalse(updated_member['admin_state_up'])
- # Verification of member delete
- self.client.delete_member(member['id'])
-
- @test.idempotent_id('893cd71f-a7dd-4485-b162-f6ab9a534914')
- def test_show_member(self):
- # Verifies the details of a member
- body = self.client.show_member(self.member['id'])
- member = body['member']
- for key, value in six.iteritems(member):
- # 'status' should not be confirmed in api tests
- if key != 'status':
- self.assertEqual(self.member[key], value)
-
- @test.idempotent_id('8e5822c5-68a4-4224-8d6c-a617741ebc2d')
- def test_list_health_monitors(self):
- # Verify the health monitor exists in the list of all health monitors
- body = self.client.list_health_monitors()
- health_monitors = body['health_monitors']
- self.assertIn(self.health_monitor['id'],
- [h['id'] for h in health_monitors])
-
- @test.idempotent_id('49bac58a-511c-4875-b794-366698211d25')
- def test_list_health_monitors_with_filters(self):
- attr_exceptions = ['status', 'status_description', 'pools']
- self._check_list_with_filter('health_monitor', attr_exceptions,
- delay=5, max_retries=4, type="TCP",
- timeout=2)
-
- @test.idempotent_id('e8ce05c4-d554-4d1e-a257-ad32ce134bb5')
- def test_create_update_delete_health_monitor(self):
- # Creates a health_monitor
- body = self.client.create_health_monitor(delay=4,
- max_retries=3,
- type="TCP",
- timeout=1)
- health_monitor = body['health_monitor']
- # Verification of health_monitor update
- body = (self.client.update_health_monitor
- (health_monitor['id'],
- admin_state_up=False))
- updated_health_monitor = body['health_monitor']
- self.assertFalse(updated_health_monitor['admin_state_up'])
- # Verification of health_monitor delete
- body = self.client.delete_health_monitor(health_monitor['id'])
-
- @test.idempotent_id('d3e1aebc-06c2-49b3-9816-942af54012eb')
- def test_create_health_monitor_http_type(self):
- hm_type = "HTTP"
- body = self.client.create_health_monitor(delay=4,
- max_retries=3,
- type=hm_type,
- timeout=1)
- health_monitor = body['health_monitor']
- self.addCleanup(self.client.delete_health_monitor,
- health_monitor['id'])
- self.assertEqual(hm_type, health_monitor['type'])
-
- @test.idempotent_id('0eff9f67-90fb-4bb1-b4ed-c5fda99fff0c')
- def test_update_health_monitor_http_method(self):
- body = self.client.create_health_monitor(delay=4,
- max_retries=3,
- type="HTTP",
- timeout=1)
- health_monitor = body['health_monitor']
- self.addCleanup(self.client.delete_health_monitor,
- health_monitor['id'])
- body = (self.client.update_health_monitor
- (health_monitor['id'],
- http_method="POST",
- url_path="/home/user",
- expected_codes="290"))
- updated_health_monitor = body['health_monitor']
- self.assertEqual("POST", updated_health_monitor['http_method'])
- self.assertEqual("/home/user", updated_health_monitor['url_path'])
- self.assertEqual("290", updated_health_monitor['expected_codes'])
-
- @test.idempotent_id('08e126ab-1407-483f-a22e-b11cc032ca7c')
- def test_show_health_monitor(self):
- # Verifies the details of a health_monitor
- body = self.client.show_health_monitor(self.health_monitor['id'])
- health_monitor = body['health_monitor']
- for key, value in six.iteritems(health_monitor):
- # 'status' should not be confirmed in api tests
- if key != 'status':
- self.assertEqual(self.health_monitor[key], value)
-
- @test.idempotent_id('87f7628e-8918-493d-af50-0602845dbb5b')
- def test_associate_disassociate_health_monitor_with_pool(self):
- # Verify that a health monitor can be associated with a pool
- self.client.associate_health_monitor_with_pool(
- self.health_monitor['id'], self.pool['id'])
- body = self.client.show_health_monitor(
- self.health_monitor['id'])
- health_monitor = body['health_monitor']
- body = self.client.show_pool(self.pool['id'])
- pool = body['pool']
- self.assertIn(pool['id'],
- [p['pool_id'] for p in health_monitor['pools']])
- self.assertIn(health_monitor['id'], pool['health_monitors'])
- # Verify that a health monitor can be disassociated from a pool
- (self.client.disassociate_health_monitor_with_pool
- (self.health_monitor['id'], self.pool['id']))
- body = self.client.show_pool(self.pool['id'])
- pool = body['pool']
- body = self.client.show_health_monitor(
- self.health_monitor['id'])
- health_monitor = body['health_monitor']
- self.assertNotIn(health_monitor['id'], pool['health_monitors'])
- self.assertNotIn(pool['id'],
- [p['pool_id'] for p in health_monitor['pools']])
-
- @test.idempotent_id('525fc7dc-be24-408d-938d-822e9783e027')
- def test_get_lb_pool_stats(self):
- # Verify the details of pool stats
- body = self.client.list_lb_pool_stats(self.pool['id'])
- stats = body['stats']
- self.assertIn("bytes_in", stats)
- self.assertIn("total_connections", stats)
- self.assertIn("active_connections", stats)
- self.assertIn("bytes_out", stats)
-
- @test.idempotent_id('66236be2-5121-4047-8cde-db4b83b110a5')
- def test_update_list_of_health_monitors_associated_with_pool(self):
- (self.client.associate_health_monitor_with_pool
- (self.health_monitor['id'], self.pool['id']))
- self.client.update_health_monitor(
- self.health_monitor['id'], admin_state_up=False)
- body = self.client.show_pool(self.pool['id'])
- health_monitors = body['pool']['health_monitors']
- for health_monitor_id in health_monitors:
- body = self.client.show_health_monitor(health_monitor_id)
- self.assertFalse(body['health_monitor']['admin_state_up'])
- (self.client.disassociate_health_monitor_with_pool
- (self.health_monitor['id'], self.pool['id']))
-
- @test.idempotent_id('44ec9b40-b501-41e2-951f-4fc673b15ac0')
- def test_update_admin_state_up_of_pool(self):
- self.client.update_pool(self.pool['id'],
- admin_state_up=False)
- body = self.client.show_pool(self.pool['id'])
- pool = body['pool']
- self.assertFalse(pool['admin_state_up'])
-
- @test.idempotent_id('466a9d4c-37c6-4ea2-b807-133437beb48c')
- def test_show_vip_associated_with_pool(self):
- body = self.client.show_pool(self.pool['id'])
- pool = body['pool']
- body = self.client.show_vip(pool['vip_id'])
- vip = body['vip']
- self.assertEqual(self.vip['name'], vip['name'])
- self.assertEqual(self.vip['id'], vip['id'])
-
- @test.idempotent_id('7b97694e-69d0-4151-b265-e1052a465aa8')
- def test_show_members_associated_with_pool(self):
- body = self.client.show_pool(self.pool['id'])
- members = body['pool']['members']
- for member_id in members:
- body = self.client.show_member(member_id)
- self.assertIsNotNone(body['member']['status'])
- self.assertEqual(member_id, body['member']['id'])
- self.assertIsNotNone(body['member']['admin_state_up'])
-
- @test.idempotent_id('73ed6f27-595b-4b2c-969c-dbdda6b8ab34')
- def test_update_pool_related_to_member(self):
- # Create new pool
- body = self.client.create_pool(name=data_utils.rand_name("pool-"),
- lb_method='ROUND_ROBIN',
- protocol='HTTP',
- subnet_id=self.subnet['id'])
- new_pool = body['pool']
- self.addCleanup(self.client.delete_pool, new_pool['id'])
- # Update member with new pool's id
- body = self.client.update_member(self.member['id'],
- pool_id=new_pool['id'])
- # Confirm with show that pool_id change
- body = self.client.show_member(self.member['id'])
- member = body['member']
- self.assertEqual(member['pool_id'], new_pool['id'])
- # Update member with old pool id, this is needed for clean up
- body = self.client.update_member(self.member['id'],
- pool_id=self.pool['id'])
-
- @test.idempotent_id('cf63f071-bbe3-40ba-97a0-a33e11923162')
- def test_update_member_weight(self):
- self.client.update_member(self.member['id'],
- weight=2)
- body = self.client.show_member(self.member['id'])
- member = body['member']
- self.assertEqual(2, member['weight'])
-
-
-@decorators.skip_because(bug="1402007")
-class LoadBalancerIpV6TestJSON(LoadBalancerTestJSON):
- _ip_version = 6
diff --git a/tempest/api/network/test_metering_extensions.py b/tempest/api/network/test_metering_extensions.py
index 68bc3cd..ee0dcb0 100644
--- a/tempest/api/network/test_metering_extensions.py
+++ b/tempest/api/network/test_metering_extensions.py
@@ -13,9 +13,9 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest.api.network import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index 7a96f34..842a56d 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -16,11 +16,11 @@
import netaddr
import six
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.network import base
from tempest.common import custom_matchers
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/network/test_networks_negative.py b/tempest/api/network/test_networks_negative.py
index ae530c2..520342e 100644
--- a/tempest/api/network/test_networks_negative.py
+++ b/tempest/api/network/test_networks_negative.py
@@ -14,10 +14,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.network import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/network/test_ports.py b/tempest/api/network/test_ports.py
index 29600c5..4f54562 100644
--- a/tempest/api/network/test_ports.py
+++ b/tempest/api/network/test_ports.py
@@ -16,11 +16,11 @@
import socket
import netaddr
-from tempest_lib.common.utils import data_utils
from tempest.api.network import base
from tempest.api.network import base_security_groups as sec_base
from tempest.common import custom_matchers
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
@@ -344,8 +344,6 @@
super(PortsAdminExtendedAttrsTestJSON, cls).resource_setup()
cls.network = cls.create_network()
cls.host_id = socket.gethostname()
- cls.tenant = cls.identity_client.get_tenant_by_name(
- CONF.identity.tenant_name)
@test.idempotent_id('8e8569c1-9ac7-44db-8bc1-f5fb2814f29b')
def test_create_port_binding_ext_attr(self):
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index 35072b4..50671d0 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -15,9 +15,9 @@
import netaddr
import six
-from tempest_lib.common.utils import data_utils
from tempest.api.network import base_routers as base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/network/test_routers_negative.py b/tempest/api/network/test_routers_negative.py
index d2afcba..90da6fd 100644
--- a/tempest/api/network/test_routers_negative.py
+++ b/tempest/api/network/test_routers_negative.py
@@ -14,10 +14,10 @@
# under the License.
import netaddr
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.network import base_routers as base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/network/test_security_groups.py b/tempest/api/network/test_security_groups.py
index 05f0de4..ccc5232 100644
--- a/tempest/api/network/test_security_groups.py
+++ b/tempest/api/network/test_security_groups.py
@@ -14,9 +14,9 @@
# under the License.
import six
-from tempest_lib.common.utils import data_utils
from tempest.api.network import base_security_groups as base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/network/test_vpnaas_extensions.py b/tempest/api/network/test_vpnaas_extensions.py
deleted file mode 100644
index 9fe2a56..0000000
--- a/tempest/api/network/test_vpnaas_extensions.py
+++ /dev/null
@@ -1,319 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# 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.
-
-import six
-from tempest_lib.common.utils import data_utils
-from tempest_lib import exceptions as lib_exc
-
-from tempest.api.network import base
-from tempest import config
-from tempest import test
-
-CONF = config.CONF
-
-
-class VPNaaSTestJSON(base.BaseAdminNetworkTest):
- """
- Tests the following operations in the Neutron API using the REST client for
- Neutron:
- List, Show, Create, Delete, and Update VPN Service
- List, Show, Create, Delete, and Update IKE policy
- List, Show, Create, Delete, and Update IPSec policy
- """
-
- @classmethod
- def skip_checks(cls):
- super(VPNaaSTestJSON, cls).skip_checks()
- if not test.is_extension_enabled('vpnaas', 'network'):
- msg = "vpnaas extension not enabled."
- raise cls.skipException(msg)
-
- @classmethod
- def resource_setup(cls):
- super(VPNaaSTestJSON, cls).resource_setup()
- cls.ext_net_id = CONF.network.public_network_id
- cls.network = cls.create_network()
- cls.subnet = cls.create_subnet(cls.network)
- cls.router = cls.create_router(
- data_utils.rand_name("router"),
- external_network_id=CONF.network.public_network_id)
- cls.create_router_interface(cls.router['id'], cls.subnet['id'])
- cls.vpnservice = cls.create_vpnservice(cls.subnet['id'],
- cls.router['id'])
-
- cls.ikepolicy = cls.create_ikepolicy(
- data_utils.rand_name("ike-policy-"))
- cls.ipsecpolicy = cls.create_ipsecpolicy(
- data_utils.rand_name("ipsec-policy-"))
-
- def _delete_ike_policy(self, ike_policy_id):
- # Deletes a ike policy and verifies if it is deleted or not
- ike_list = list()
- all_ike = self.client.list_ikepolicies()
- for ike in all_ike['ikepolicies']:
- ike_list.append(ike['id'])
- if ike_policy_id in ike_list:
- self.client.delete_ikepolicy(ike_policy_id)
- # Asserting that the policy is not found in list after deletion
- ikepolicies = self.client.list_ikepolicies()
- ike_id_list = list()
- for i in ikepolicies['ikepolicies']:
- ike_id_list.append(i['id'])
- self.assertNotIn(ike_policy_id, ike_id_list)
-
- def _delete_ipsec_policy(self, ipsec_policy_id):
- # Deletes an ike policy if it exists
- try:
- self.client.delete_ipsecpolicy(ipsec_policy_id)
-
- except lib_exc.NotFound:
- pass
-
- def _assertExpected(self, expected, actual):
- # Check if not expected keys/values exists in actual response body
- for key, value in six.iteritems(expected):
- self.assertIn(key, actual)
- self.assertEqual(value, actual[key])
-
- def _delete_vpn_service(self, vpn_service_id):
- self.client.delete_vpnservice(vpn_service_id)
- # Asserting if vpn service is found in the list after deletion
- body = self.client.list_vpnservices()
- vpn_services = [vs['id'] for vs in body['vpnservices']]
- self.assertNotIn(vpn_service_id, vpn_services)
-
- def _get_tenant_id(self):
- """
- Returns the tenant_id of the client current user
- """
- # TODO(jroovers) This is a temporary workaround to get the tenant_id
- # of the the current client. Replace this once tenant_isolation for
- # neutron is fixed.
- body = self.client.show_network(self.network['id'])
- return body['network']['tenant_id']
-
- @test.idempotent_id('14311574-0737-4e53-ac05-f7ae27742eed')
- def test_admin_create_ipsec_policy_for_tenant(self):
- tenant_id = self._get_tenant_id()
- # Create IPSec policy for the newly created tenant
- name = data_utils.rand_name('ipsec-policy')
- body = (self.admin_client.
- create_ipsecpolicy(name=name, tenant_id=tenant_id))
- ipsecpolicy = body['ipsecpolicy']
- self.assertIsNotNone(ipsecpolicy['id'])
- self.addCleanup(self.admin_client.delete_ipsecpolicy,
- ipsecpolicy['id'])
-
- # Assert that created ipsec policy is found in API list call
- body = self.client.list_ipsecpolicies()
- ipsecpolicies = [policy['id'] for policy in body['ipsecpolicies']]
- self.assertIn(ipsecpolicy['id'], ipsecpolicies)
-
- @test.idempotent_id('b62acdc6-0c53-4d84-84aa-859b22b79799')
- def test_admin_create_vpn_service_for_tenant(self):
- tenant_id = self._get_tenant_id()
-
- # Create vpn service for the newly created tenant
- network2 = self.create_network()
- subnet2 = self.create_subnet(network2)
- router2 = self.create_router(data_utils.rand_name('router-'),
- external_network_id=self.ext_net_id)
- self.create_router_interface(router2['id'], subnet2['id'])
- name = data_utils.rand_name('vpn-service')
- body = self.admin_client.create_vpnservice(
- subnet_id=subnet2['id'],
- router_id=router2['id'],
- name=name,
- admin_state_up=True,
- tenant_id=tenant_id)
- vpnservice = body['vpnservice']
- self.assertIsNotNone(vpnservice['id'])
- self.addCleanup(self.admin_client.delete_vpnservice, vpnservice['id'])
- # Assert that created vpnservice is found in API list call
- body = self.client.list_vpnservices()
- vpn_services = [vs['id'] for vs in body['vpnservices']]
- self.assertIn(vpnservice['id'], vpn_services)
-
- @test.idempotent_id('58cc4a1c-443b-4f39-8fb6-c19d39f343ab')
- def test_admin_create_ike_policy_for_tenant(self):
- tenant_id = self._get_tenant_id()
-
- # Create IKE policy for the newly created tenant
- name = data_utils.rand_name('ike-policy')
- body = (self.admin_client.
- create_ikepolicy(name=name, ike_version="v1",
- encryption_algorithm="aes-128",
- auth_algorithm="sha1",
- tenant_id=tenant_id))
- ikepolicy = body['ikepolicy']
- self.assertIsNotNone(ikepolicy['id'])
- self.addCleanup(self.admin_client.delete_ikepolicy, ikepolicy['id'])
-
- # Assert that created ike policy is found in API list call
- body = self.client.list_ikepolicies()
- ikepolicies = [ikp['id'] for ikp in body['ikepolicies']]
- self.assertIn(ikepolicy['id'], ikepolicies)
-
- @test.idempotent_id('de5bb04c-3a1f-46b1-b329-7a8abba5c7f1')
- def test_list_vpn_services(self):
- # Verify the VPN service exists in the list of all VPN services
- body = self.client.list_vpnservices()
- vpnservices = body['vpnservices']
- self.assertIn(self.vpnservice['id'], [v['id'] for v in vpnservices])
-
- @test.idempotent_id('aacb13b1-fdc7-41fd-bab2-32621aee1878')
- def test_create_update_delete_vpn_service(self):
- # Creates a VPN service and sets up deletion
- network1 = self.create_network()
- subnet1 = self.create_subnet(network1)
- router1 = self.create_router(data_utils.rand_name('router-'),
- external_network_id=self.ext_net_id)
- self.create_router_interface(router1['id'], subnet1['id'])
- name = data_utils.rand_name('vpn-service1')
- body = self.client.create_vpnservice(subnet_id=subnet1['id'],
- router_id=router1['id'],
- name=name,
- admin_state_up=True)
- vpnservice = body['vpnservice']
- self.addCleanup(self._delete_vpn_service, vpnservice['id'])
- # Assert if created vpnservices are not found in vpnservices list
- body = self.client.list_vpnservices()
- vpn_services = [vs['id'] for vs in body['vpnservices']]
- self.assertIsNotNone(vpnservice['id'])
- self.assertIn(vpnservice['id'], vpn_services)
-
- # TODO(raies): implement logic to update vpnservice
- # VPNaaS client function to update is implemented.
- # But precondition is that current state of vpnservice
- # should be "ACTIVE" not "PENDING*"
-
- @test.idempotent_id('0dedfc1d-f8ee-4e2a-bfd4-7997b9dc17ff')
- def test_show_vpn_service(self):
- # Verifies the details of a vpn service
- body = self.client.show_vpnservice(self.vpnservice['id'])
- vpnservice = body['vpnservice']
- self.assertEqual(self.vpnservice['id'], vpnservice['id'])
- self.assertEqual(self.vpnservice['name'], vpnservice['name'])
- self.assertEqual(self.vpnservice['description'],
- vpnservice['description'])
- self.assertEqual(self.vpnservice['router_id'], vpnservice['router_id'])
- self.assertEqual(self.vpnservice['subnet_id'], vpnservice['subnet_id'])
- self.assertEqual(self.vpnservice['tenant_id'], vpnservice['tenant_id'])
- valid_status = ["ACTIVE", "DOWN", "BUILD", "ERROR", "PENDING_CREATE",
- "PENDING_UPDATE", "PENDING_DELETE"]
- self.assertIn(vpnservice['status'], valid_status)
-
- @test.idempotent_id('e0fb6200-da3d-4869-8340-a8c1956ca618')
- def test_list_ike_policies(self):
- # Verify the ike policy exists in the list of all IKE policies
- body = self.client.list_ikepolicies()
- ikepolicies = body['ikepolicies']
- self.assertIn(self.ikepolicy['id'], [i['id'] for i in ikepolicies])
-
- @test.idempotent_id('d61f29a5-160c-487d-bc0d-22e32e731b44')
- def test_create_update_delete_ike_policy(self):
- # Creates a IKE policy
- name = data_utils.rand_name('ike-policy')
- body = (self.client.create_ikepolicy(
- name=name,
- ike_version="v1",
- encryption_algorithm="aes-128",
- auth_algorithm="sha1"))
- ikepolicy = body['ikepolicy']
- self.assertIsNotNone(ikepolicy['id'])
- self.addCleanup(self._delete_ike_policy, ikepolicy['id'])
-
- # Update IKE Policy
- new_ike = {'name': data_utils.rand_name("New-IKE"),
- 'description': "Updated ike policy",
- 'encryption_algorithm': "aes-256",
- 'ike_version': "v2",
- 'pfs': "group14",
- 'lifetime': {'units': "seconds", 'value': 2000}}
- self.client.update_ikepolicy(ikepolicy['id'], **new_ike)
- # Confirm that update was successful by verifying using 'show'
- body = self.client.show_ikepolicy(ikepolicy['id'])
- ike_policy = body['ikepolicy']
- for key, value in six.iteritems(new_ike):
- self.assertIn(key, ike_policy)
- self.assertEqual(value, ike_policy[key])
-
- # Verification of ike policy delete
- self.client.delete_ikepolicy(ikepolicy['id'])
- body = self.client.list_ikepolicies()
- ikepolicies = [ikp['id'] for ikp in body['ikepolicies']]
- self.assertNotIn(ike_policy['id'], ikepolicies)
-
- @test.idempotent_id('b5fcf3a3-9407-452d-b8a8-e7c6c32baea8')
- def test_show_ike_policy(self):
- # Verifies the details of a ike policy
- body = self.client.show_ikepolicy(self.ikepolicy['id'])
- ikepolicy = body['ikepolicy']
- self.assertEqual(self.ikepolicy['id'], ikepolicy['id'])
- self.assertEqual(self.ikepolicy['name'], ikepolicy['name'])
- self.assertEqual(self.ikepolicy['description'],
- ikepolicy['description'])
- self.assertEqual(self.ikepolicy['encryption_algorithm'],
- ikepolicy['encryption_algorithm'])
- self.assertEqual(self.ikepolicy['auth_algorithm'],
- ikepolicy['auth_algorithm'])
- self.assertEqual(self.ikepolicy['tenant_id'],
- ikepolicy['tenant_id'])
- self.assertEqual(self.ikepolicy['pfs'],
- ikepolicy['pfs'])
- self.assertEqual(self.ikepolicy['phase1_negotiation_mode'],
- ikepolicy['phase1_negotiation_mode'])
- self.assertEqual(self.ikepolicy['ike_version'],
- ikepolicy['ike_version'])
-
- @test.idempotent_id('19ea0a2f-add9-44be-b732-ffd8a7b42f37')
- def test_list_ipsec_policies(self):
- # Verify the ipsec policy exists in the list of all ipsec policies
- body = self.client.list_ipsecpolicies()
- ipsecpolicies = body['ipsecpolicies']
- self.assertIn(self.ipsecpolicy['id'], [i['id'] for i in ipsecpolicies])
-
- @test.idempotent_id('9c1701c9-329a-4e5d-930a-1ead1b3f86ad')
- def test_create_update_delete_ipsec_policy(self):
- # Creates an ipsec policy
- ipsec_policy_body = {'name': data_utils.rand_name('ipsec-policy'),
- 'pfs': 'group5',
- 'encryption_algorithm': "aes-128",
- 'auth_algorithm': 'sha1'}
- resp_body = self.client.create_ipsecpolicy(**ipsec_policy_body)
- ipsecpolicy = resp_body['ipsecpolicy']
- self.addCleanup(self._delete_ipsec_policy, ipsecpolicy['id'])
- self._assertExpected(ipsec_policy_body, ipsecpolicy)
- # Verification of ipsec policy update
- new_ipsec = {'description': 'Updated ipsec policy',
- 'pfs': 'group2',
- 'name': data_utils.rand_name("New-IPSec"),
- 'encryption_algorithm': "aes-256",
- 'lifetime': {'units': "seconds", 'value': '2000'}}
- body = self.client.update_ipsecpolicy(ipsecpolicy['id'],
- **new_ipsec)
- updated_ipsec_policy = body['ipsecpolicy']
- self._assertExpected(new_ipsec, updated_ipsec_policy)
- # Verification of ipsec policy delete
- self.client.delete_ipsecpolicy(ipsecpolicy['id'])
- self.assertRaises(lib_exc.NotFound,
- self.client.delete_ipsecpolicy, ipsecpolicy['id'])
-
- @test.idempotent_id('601f8a05-9d3c-4539-a400-1c4b3a21b03b')
- def test_show_ipsec_policy(self):
- # Verifies the details of an ipsec policy
- body = self.client.show_ipsecpolicy(self.ipsecpolicy['id'])
- ipsecpolicy = body['ipsecpolicy']
- self._assertExpected(self.ipsecpolicy, ipsecpolicy)
diff --git a/tempest/api/object_storage/test_account_quotas.py b/tempest/api/object_storage/test_account_quotas.py
index bbdf367..78707d8 100644
--- a/tempest/api/object_storage/test_account_quotas.py
+++ b/tempest/api/object_storage/test_account_quotas.py
@@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/object_storage/test_account_quotas_negative.py b/tempest/api/object_storage/test_account_quotas_negative.py
index e945e1e..2bf331a 100644
--- a/tempest/api/object_storage/test_account_quotas_negative.py
+++ b/tempest/api/object_storage/test_account_quotas_negative.py
@@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
from tempest_lib import exceptions as lib_exc
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/object_storage/test_account_services.py b/tempest/api/object_storage/test_account_services.py
index ac41148..6bab9b3 100644
--- a/tempest/api/object_storage/test_account_services.py
+++ b/tempest/api/object_storage/test_account_services.py
@@ -16,11 +16,11 @@
import random
from six import moves
-from tempest_lib.common.utils import data_utils
import testtools
from tempest.api.object_storage import base
from tempest.common import custom_matchers
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/object_storage/test_container_acl.py b/tempest/api/object_storage/test_container_acl.py
index 4df813d..c1b6711 100644
--- a/tempest/api/object_storage/test_container_acl.py
+++ b/tempest/api/object_storage/test_container_acl.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/object_storage/test_container_acl_negative.py b/tempest/api/object_storage/test_container_acl_negative.py
index 1c42e97..3bb47f0 100644
--- a/tempest/api/object_storage/test_container_acl_negative.py
+++ b/tempest/api/object_storage/test_container_acl_negative.py
@@ -12,10 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/object_storage/test_container_quotas.py b/tempest/api/object_storage/test_container_quotas.py
index 2217d18..c78b4c3 100644
--- a/tempest/api/object_storage/test_container_quotas.py
+++ b/tempest/api/object_storage/test_container_quotas.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/object_storage/test_container_staticweb.py b/tempest/api/object_storage/test_container_staticweb.py
index 20452ab..4b4b499 100644
--- a/tempest/api/object_storage/test_container_staticweb.py
+++ b/tempest/api/object_storage/test_container_staticweb.py
@@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.object_storage import base
from tempest.common import custom_matchers
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/object_storage/test_container_sync.py b/tempest/api/object_storage/test_container_sync.py
index 06e700b..0e39b7e 100644
--- a/tempest/api/object_storage/test_container_sync.py
+++ b/tempest/api/object_storage/test_container_sync.py
@@ -16,12 +16,12 @@
import time
from six.moves.urllib import parse as urlparse
-from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
import testtools
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/object_storage/test_object_expiry.py b/tempest/api/object_storage/test_object_expiry.py
index b263050..1c9d582 100644
--- a/tempest/api/object_storage/test_object_expiry.py
+++ b/tempest/api/object_storage/test_object_expiry.py
@@ -13,11 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
import time
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/object_storage/test_object_formpost.py b/tempest/api/object_storage/test_object_formpost.py
index ce587d7..356f560 100644
--- a/tempest/api/object_storage/test_object_formpost.py
+++ b/tempest/api/object_storage/test_object_formpost.py
@@ -17,9 +17,9 @@
import time
from six.moves.urllib import parse as urlparse
-from tempest_lib.common.utils import data_utils
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/object_storage/test_object_formpost_negative.py b/tempest/api/object_storage/test_object_formpost_negative.py
index 89deca2..7d9e115 100644
--- a/tempest/api/object_storage/test_object_formpost_negative.py
+++ b/tempest/api/object_storage/test_object_formpost_negative.py
@@ -17,10 +17,10 @@
import time
from six.moves.urllib import parse as urlparse
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/object_storage/test_object_services.py b/tempest/api/object_storage/test_object_services.py
index 3396d8f..2198753 100644
--- a/tempest/api/object_storage/test_object_services.py
+++ b/tempest/api/object_storage/test_object_services.py
@@ -21,10 +21,10 @@
import six
from six import moves
-from tempest_lib.common.utils import data_utils
from tempest.api.object_storage import base
from tempest.common import custom_matchers
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/object_storage/test_object_slo.py b/tempest/api/object_storage/test_object_slo.py
index 6fc7821..9aa1b82 100644
--- a/tempest/api/object_storage/test_object_slo.py
+++ b/tempest/api/object_storage/test_object_slo.py
@@ -15,11 +15,11 @@
import hashlib
import json
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.object_storage import base
from tempest.common import custom_matchers
+from tempest.common.utils import data_utils
from tempest import test
# Each segment, except for the final one, must be at least 1 megabyte
diff --git a/tempest/api/object_storage/test_object_temp_url.py b/tempest/api/object_storage/test_object_temp_url.py
index 8748269..3d28f6e 100644
--- a/tempest/api/object_storage/test_object_temp_url.py
+++ b/tempest/api/object_storage/test_object_temp_url.py
@@ -17,9 +17,9 @@
import time
from six.moves.urllib import parse as urlparse
-from tempest_lib.common.utils import data_utils
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/object_storage/test_object_temp_url_negative.py b/tempest/api/object_storage/test_object_temp_url_negative.py
index 233cced..6d06143 100644
--- a/tempest/api/object_storage/test_object_temp_url_negative.py
+++ b/tempest/api/object_storage/test_object_temp_url_negative.py
@@ -17,10 +17,10 @@
import time
from six.moves.urllib import parse as urlparse
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/object_storage/test_object_version.py b/tempest/api/object_storage/test_object_version.py
index 923166a..24ec3f5 100644
--- a/tempest/api/object_storage/test_object_version.py
+++ b/tempest/api/object_storage/test_object_version.py
@@ -15,9 +15,8 @@
import testtools
-from tempest_lib.common.utils import data_utils
-
from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/orchestration/base.py b/tempest/api/orchestration/base.py
index af97794..266f726 100644
--- a/tempest/api/orchestration/base.py
+++ b/tempest/api/orchestration/base.py
@@ -13,10 +13,10 @@
import os.path
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
import yaml
+from tempest.common.utils import data_utils
from tempest import config
import tempest.test
diff --git a/tempest/api/orchestration/stacks/test_environment.py b/tempest/api/orchestration/stacks/test_environment.py
index ecb824b..0416bc7 100644
--- a/tempest/api/orchestration/stacks/test_environment.py
+++ b/tempest/api/orchestration/stacks/test_environment.py
@@ -12,9 +12,8 @@
import logging
-from tempest_lib.common.utils import data_utils
-
from tempest.api.orchestration import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/orchestration/stacks/test_limits.py b/tempest/api/orchestration/stacks/test_limits.py
index 4291d76..bb5b89d 100644
--- a/tempest/api/orchestration/stacks/test_limits.py
+++ b/tempest/api/orchestration/stacks/test_limits.py
@@ -12,10 +12,10 @@
import logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.orchestration import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/orchestration/stacks/test_neutron_resources.py b/tempest/api/orchestration/stacks/test_neutron_resources.py
index a0706ff..b27d6c9 100644
--- a/tempest/api/orchestration/stacks/test_neutron_resources.py
+++ b/tempest/api/orchestration/stacks/test_neutron_resources.py
@@ -14,10 +14,10 @@
import logging
import netaddr
-from tempest_lib.common.utils import data_utils
from tempest.api.orchestration import base
from tempest import clients
+from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest import test
@@ -183,7 +183,7 @@
def test_created_server(self):
"""Verifies created sever."""
server_id = self.test_resources.get('Server')['physical_resource_id']
- server = self.servers_client.get_server(server_id)
+ server = self.servers_client.show_server(server_id)
self.assertEqual(self.keypair_name, server['key_name'])
self.assertEqual('ACTIVE', server['status'])
network = server['addresses'][self.neutron_basic_template['resources'][
diff --git a/tempest/api/orchestration/stacks/test_non_empty_stack.py b/tempest/api/orchestration/stacks/test_non_empty_stack.py
index bffc306..494b6fd 100644
--- a/tempest/api/orchestration/stacks/test_non_empty_stack.py
+++ b/tempest/api/orchestration/stacks/test_non_empty_stack.py
@@ -12,9 +12,8 @@
import logging
-from tempest_lib.common.utils import data_utils
-
from tempest.api.orchestration import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/orchestration/stacks/test_nova_keypair_resources.py b/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
index c79c3c3..6a04dbd 100644
--- a/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
+++ b/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
@@ -13,9 +13,8 @@
import logging
-from tempest_lib.common.utils import data_utils
-
from tempest.api.orchestration import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/orchestration/stacks/test_soft_conf.py b/tempest/api/orchestration/stacks/test_soft_conf.py
index 13f0a6c..34d93e4 100644
--- a/tempest/api/orchestration/stacks/test_soft_conf.py
+++ b/tempest/api/orchestration/stacks/test_soft_conf.py
@@ -11,10 +11,10 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.orchestration import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/orchestration/stacks/test_stacks.py b/tempest/api/orchestration/stacks/test_stacks.py
index 9ce8ebeb..abec906 100644
--- a/tempest/api/orchestration/stacks/test_stacks.py
+++ b/tempest/api/orchestration/stacks/test_stacks.py
@@ -11,9 +11,9 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest.api.orchestration import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/orchestration/stacks/test_swift_resources.py b/tempest/api/orchestration/stacks/test_swift_resources.py
index dadabfa..30166df 100644
--- a/tempest/api/orchestration/stacks/test_swift_resources.py
+++ b/tempest/api/orchestration/stacks/test_swift_resources.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.orchestration import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/orchestration/stacks/test_templates.py b/tempest/api/orchestration/stacks/test_templates.py
index 5ccfdfb..9154175 100644
--- a/tempest/api/orchestration/stacks/test_templates.py
+++ b/tempest/api/orchestration/stacks/test_templates.py
@@ -10,9 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.orchestration import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/orchestration/stacks/test_volumes.py b/tempest/api/orchestration/stacks/test_volumes.py
index f40ca02..d8f117e 100644
--- a/tempest/api/orchestration/stacks/test_volumes.py
+++ b/tempest/api/orchestration/stacks/test_volumes.py
@@ -12,10 +12,10 @@
import logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.orchestration import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/telemetry/base.py b/tempest/api/telemetry/base.py
index cce8e2a..3be807b 100644
--- a/tempest/api/telemetry/base.py
+++ b/tempest/api/telemetry/base.py
@@ -13,9 +13,9 @@
import time
from oslo_utils import timeutils
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
+from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
import tempest.test
diff --git a/tempest/api/telemetry/test_telemetry_alarming_api.py b/tempest/api/telemetry/test_telemetry_alarming_api.py
index 99b5c37..13da9cb 100644
--- a/tempest/api/telemetry/test_telemetry_alarming_api.py
+++ b/tempest/api/telemetry/test_telemetry_alarming_api.py
@@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.telemetry import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/volume/admin/test_multi_backend.py b/tempest/api/volume/admin/test_multi_backend.py
index b8047b2..c7e989d 100644
--- a/tempest/api/volume/admin/test_multi_backend.py
+++ b/tempest/api/volume/admin/test_multi_backend.py
@@ -11,9 +11,9 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/volume/admin/test_snapshots_actions.py b/tempest/api/volume/admin/test_snapshots_actions.py
index b885f7d..c860b4b 100644
--- a/tempest/api/volume/admin/test_snapshots_actions.py
+++ b/tempest/api/volume/admin/test_snapshots_actions.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/volume/admin/test_volume_quotas.py b/tempest/api/volume/admin/test_volume_quotas.py
index ec8e040..1a48204 100644
--- a/tempest/api/volume/admin/test_volume_quotas.py
+++ b/tempest/api/volume/admin/test_volume_quotas.py
@@ -13,9 +13,9 @@
# under the License.
import six
-from tempest_lib.common.utils import data_utils
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import test
QUOTA_KEYS = ['gigabytes', 'snapshots', 'volumes']
diff --git a/tempest/api/volume/admin/test_volume_types.py b/tempest/api/volume/admin/test_volume_types.py
index ea9864e..b79c185 100644
--- a/tempest/api/volume/admin/test_volume_types.py
+++ b/tempest/api/volume/admin/test_volume_types.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs.py b/tempest/api/volume/admin/test_volume_types_extra_specs.py
index 2feb062..c840697 100644
--- a/tempest/api/volume/admin/test_volume_types_extra_specs.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
index a70a940..e49e8b2 100644
--- a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
@@ -15,10 +15,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/volume/admin/test_volumes_actions.py b/tempest/api/volume/admin/test_volumes_actions.py
index 8a30a10..4288d58 100644
--- a/tempest/api/volume/admin/test_volumes_actions.py
+++ b/tempest/api/volume/admin/test_volumes_actions.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils as utils
-
from tempest.api.volume import base
+from tempest.common.utils import data_utils as utils
from tempest import test
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
index 8b85da3..2c545a7 100644
--- a/tempest/api/volume/admin/test_volumes_backup.py
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -14,9 +14,9 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 7f56b18..f8ae5eb 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -14,10 +14,10 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.common import fixed_network
+from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
import tempest.test
diff --git a/tempest/api/volume/test_qos.py b/tempest/api/volume/test_qos.py
index 863a698..84fd7f6 100644
--- a/tempest/api/volume/test_qos.py
+++ b/tempest/api/volume/test_qos.py
@@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils as utils
-
from tempest.api.volume import base
+from tempest.common.utils import data_utils as utils
from tempest import test
diff --git a/tempest/api/volume/test_volumes_actions.py b/tempest/api/volume/test_volumes_actions.py
index 375d34a..0ebcf3a 100644
--- a/tempest/api/volume/test_volumes_actions.py
+++ b/tempest/api/volume/test_volumes_actions.py
@@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
import testtools
diff --git a/tempest/api/volume/test_volumes_get.py b/tempest/api/volume/test_volumes_get.py
index 8337f8d..29c21ed 100644
--- a/tempest/api/volume/test_volumes_get.py
+++ b/tempest/api/volume/test_volumes_get.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
from testtools import matchers
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/volume/test_volumes_list.py b/tempest/api/volume/test_volumes_list.py
index da0d5aa..3847877 100644
--- a/tempest/api/volume/test_volumes_list.py
+++ b/tempest/api/volume/test_volumes_list.py
@@ -16,10 +16,10 @@
import operator
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from testtools import matchers
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import test
LOG = logging.getLogger(__name__)
diff --git a/tempest/api/volume/test_volumes_negative.py b/tempest/api/volume/test_volumes_negative.py
index b591a1a..da8f52a 100644
--- a/tempest/api/volume/test_volumes_negative.py
+++ b/tempest/api/volume/test_volumes_negative.py
@@ -15,10 +15,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import test
diff --git a/tempest/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py
index 550c3b6..340f019 100644
--- a/tempest/api/volume/test_volumes_snapshots.py
+++ b/tempest/api/volume/test_volumes_snapshots.py
@@ -11,9 +11,9 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/api/volume/test_volumes_snapshots_negative.py b/tempest/api/volume/test_volumes_snapshots_negative.py
index 77f8552..b604360 100644
--- a/tempest/api/volume/test_volumes_snapshots_negative.py
+++ b/tempest/api/volume/test_volumes_snapshots_negative.py
@@ -12,10 +12,10 @@
import uuid
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.volume import base
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
diff --git a/tempest/clients.py b/tempest/clients.py
index f0aedd5..ab6bd43 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -25,117 +25,117 @@
from tempest import exceptions
from tempest import manager
from tempest.services.baremetal.v1.json.baremetal_client import \
- BaremetalClientJSON
+ BaremetalClient
from tempest.services import botoclients
from tempest.services.compute.json.agents_client import \
- AgentsClientJSON
+ AgentsClient
from tempest.services.compute.json.aggregates_client import \
- AggregatesClientJSON
+ AggregatesClient
from tempest.services.compute.json.availability_zone_client import \
- AvailabilityZoneClientJSON
+ AvailabilityZoneClient
from tempest.services.compute.json.baremetal_nodes_client import \
- BaremetalNodesClientJSON
+ BaremetalNodesClient
from tempest.services.compute.json.certificates_client import \
- CertificatesClientJSON
+ CertificatesClient
from tempest.services.compute.json.extensions_client import \
- ExtensionsClientJSON
-from tempest.services.compute.json.fixed_ips_client import FixedIPsClientJSON
-from tempest.services.compute.json.flavors_client import FlavorsClientJSON
+ ExtensionsClient
+from tempest.services.compute.json.fixed_ips_client import FixedIPsClient
+from tempest.services.compute.json.flavors_client import FlavorsClient
from tempest.services.compute.json.floating_ips_client import \
- FloatingIPsClientJSON
-from tempest.services.compute.json.hosts_client import HostsClientJSON
+ FloatingIPsClient
+from tempest.services.compute.json.hosts_client import HostsClient
from tempest.services.compute.json.hypervisor_client import \
- HypervisorClientJSON
-from tempest.services.compute.json.images_client import ImagesClientJSON
+ HypervisorClient
+from tempest.services.compute.json.images_client import ImagesClient
from tempest.services.compute.json.instance_usage_audit_log_client import \
- InstanceUsagesAuditLogClientJSON
+ InstanceUsagesAuditLogClient
from tempest.services.compute.json.interfaces_client import \
- InterfacesClientJSON
-from tempest.services.compute.json.keypairs_client import KeyPairsClientJSON
-from tempest.services.compute.json.limits_client import LimitsClientJSON
+ InterfacesClient
+from tempest.services.compute.json.keypairs_client import KeyPairsClient
+from tempest.services.compute.json.limits_client import LimitsClient
from tempest.services.compute.json.migrations_client import \
- MigrationsClientJSON
-from tempest.services.compute.json.networks_client import NetworksClientJSON
+ MigrationsClient
+from tempest.services.compute.json.networks_client import NetworksClient
from tempest.services.compute.json.quota_classes_client import \
- QuotaClassesClientJSON
-from tempest.services.compute.json.quotas_client import QuotasClientJSON
+ QuotaClassesClient
+from tempest.services.compute.json.quotas_client import QuotasClient
from tempest.services.compute.json.security_group_default_rules_client import \
- SecurityGroupDefaultRulesClientJSON
+ SecurityGroupDefaultRulesClient
from tempest.services.compute.json.security_groups_client import \
- SecurityGroupsClientJSON
-from tempest.services.compute.json.servers_client import ServersClientJSON
-from tempest.services.compute.json.services_client import ServicesClientJSON
+ SecurityGroupsClient
+from tempest.services.compute.json.servers_client import ServersClient
+from tempest.services.compute.json.services_client import ServicesClient
from tempest.services.compute.json.tenant_networks_client import \
- TenantNetworksClientJSON
+ TenantNetworksClient
from tempest.services.compute.json.tenant_usages_client import \
- TenantUsagesClientJSON
+ TenantUsagesClient
from tempest.services.compute.json.volumes_extensions_client import \
- VolumesExtensionsClientJSON
+ VolumesExtensionsClient
from tempest.services.data_processing.v1_1.data_processing_client import \
DataProcessingClient
from tempest.services.database.json.flavors_client import \
- DatabaseFlavorsClientJSON
+ DatabaseFlavorsClient
from tempest.services.database.json.limits_client import \
- DatabaseLimitsClientJSON
+ DatabaseLimitsClient
from tempest.services.database.json.versions_client import \
- DatabaseVersionsClientJSON
+ DatabaseVersionsClient
from tempest.services.identity.v2.json.identity_client import \
- IdentityClientJSON
+ IdentityClient
from tempest.services.identity.v3.json.credentials_client import \
- CredentialsClientJSON
+ CredentialsClient
from tempest.services.identity.v3.json.endpoints_client import \
- EndPointClientJSON
+ EndPointClient
from tempest.services.identity.v3.json.identity_client import \
- IdentityV3ClientJSON
-from tempest.services.identity.v3.json.policy_client import PolicyClientJSON
-from tempest.services.identity.v3.json.region_client import RegionClientJSON
+ IdentityV3Client
+from tempest.services.identity.v3.json.policy_client import PolicyClient
+from tempest.services.identity.v3.json.region_client import RegionClient
from tempest.services.identity.v3.json.service_client import \
- ServiceClientJSON
-from tempest.services.image.v1.json.image_client import ImageClientJSON
-from tempest.services.image.v2.json.image_client import ImageClientV2JSON
+ ServiceClient
+from tempest.services.image.v1.json.image_client import ImageClient
+from tempest.services.image.v2.json.image_client import ImageClientV2
from tempest.services.messaging.json.messaging_client import \
- MessagingClientJSON
-from tempest.services.network.json.network_client import NetworkClientJSON
+ MessagingClient
+from tempest.services.network.json.network_client import NetworkClient
from tempest.services.object_storage.account_client import AccountClient
from tempest.services.object_storage.container_client import ContainerClient
from tempest.services.object_storage.object_client import ObjectClient
from tempest.services.orchestration.json.orchestration_client import \
OrchestrationClient
from tempest.services.telemetry.json.telemetry_client import \
- TelemetryClientJSON
+ TelemetryClient
from tempest.services.volume.json.admin.volume_hosts_client import \
- VolumeHostsClientJSON
+ VolumeHostsClient
from tempest.services.volume.json.admin.volume_quotas_client import \
- VolumeQuotasClientJSON
+ VolumeQuotasClient
from tempest.services.volume.json.admin.volume_services_client import \
- VolumesServicesClientJSON
+ VolumesServicesClient
from tempest.services.volume.json.admin.volume_types_client import \
- VolumeTypesClientJSON
+ VolumeTypesClient
from tempest.services.volume.json.availability_zone_client import \
- VolumeAvailabilityZoneClientJSON
-from tempest.services.volume.json.backups_client import BackupsClientJSON
+ VolumeAvailabilityZoneClient
+from tempest.services.volume.json.backups_client import BackupsClient
from tempest.services.volume.json.extensions_client import \
- ExtensionsClientJSON as VolumeExtensionClientJSON
-from tempest.services.volume.json.qos_client import QosSpecsClientJSON
-from tempest.services.volume.json.snapshots_client import SnapshotsClientJSON
-from tempest.services.volume.json.volumes_client import VolumesClientJSON
+ ExtensionsClient as VolumeExtensionClient
+from tempest.services.volume.json.qos_client import QosSpecsClient
+from tempest.services.volume.json.snapshots_client import SnapshotsClient
+from tempest.services.volume.json.volumes_client import VolumesClient
from tempest.services.volume.v2.json.admin.volume_hosts_client import \
- VolumeHostsV2ClientJSON
+ VolumeHostsV2Client
from tempest.services.volume.v2.json.admin.volume_quotas_client import \
VolumeQuotasV2Client
from tempest.services.volume.v2.json.admin.volume_services_client import \
- VolumesServicesV2ClientJSON
+ VolumesServicesV2Client
from tempest.services.volume.v2.json.admin.volume_types_client import \
- VolumeTypesV2ClientJSON
+ VolumeTypesV2Client
from tempest.services.volume.v2.json.availability_zone_client import \
- VolumeV2AvailabilityZoneClientJSON
-from tempest.services.volume.v2.json.backups_client import BackupsClientV2JSON
+ VolumeV2AvailabilityZoneClient
+from tempest.services.volume.v2.json.backups_client import BackupsClientV2
from tempest.services.volume.v2.json.extensions_client import \
- ExtensionsV2ClientJSON as VolumeV2ExtensionClientJSON
-from tempest.services.volume.v2.json.qos_client import QosSpecsV2ClientJSON
+ ExtensionsV2Client as VolumeV2ExtensionClient
+from tempest.services.volume.v2.json.qos_client import QosSpecsV2Client
from tempest.services.volume.v2.json.snapshots_client import \
- SnapshotsV2ClientJSON
-from tempest.services.volume.v2.json.volumes_client import VolumesV2ClientJSON
+ SnapshotsV2Client
+from tempest.services.volume.v2.json.volumes_client import VolumesV2Client
CONF = config.CONF
LOG = logging.getLogger(__name__)
@@ -171,13 +171,13 @@
self._set_volume_clients()
self._set_object_storage_clients()
- self.baremetal_client = BaremetalClientJSON(
+ self.baremetal_client = BaremetalClient(
self.auth_provider,
CONF.baremetal.catalog_type,
CONF.identity.region,
endpoint_type=CONF.baremetal.endpoint_type,
**self.default_params_with_timeout_values)
- self.network_client = NetworkClientJSON(
+ self.network_client = NetworkClient(
self.auth_provider,
CONF.network.catalog_type,
CONF.network.region or CONF.identity.region,
@@ -185,20 +185,20 @@
build_interval=CONF.network.build_interval,
build_timeout=CONF.network.build_timeout,
**self.default_params)
- self.messaging_client = MessagingClientJSON(
+ self.messaging_client = MessagingClient(
self.auth_provider,
CONF.messaging.catalog_type,
CONF.identity.region,
**self.default_params_with_timeout_values)
if CONF.service_available.ceilometer:
- self.telemetry_client = TelemetryClientJSON(
+ self.telemetry_client = TelemetryClient(
self.auth_provider,
CONF.telemetry.catalog_type,
CONF.identity.region,
endpoint_type=CONF.telemetry.endpoint_type,
**self.default_params_with_timeout_values)
if CONF.service_available.glance:
- self.image_client = ImageClientJSON(
+ self.image_client = ImageClient(
self.auth_provider,
CONF.image.catalog_type,
CONF.image.region or CONF.identity.region,
@@ -206,7 +206,7 @@
build_interval=CONF.image.build_interval,
build_timeout=CONF.image.build_timeout,
**self.default_params)
- self.image_client_v2 = ImageClientV2JSON(
+ self.image_client_v2 = ImageClientV2(
self.auth_provider,
CONF.image.catalog_type,
CONF.image.region or CONF.identity.region,
@@ -250,51 +250,51 @@
}
params.update(self.default_params)
- self.agents_client = AgentsClientJSON(self.auth_provider, **params)
- self.networks_client = NetworksClientJSON(self.auth_provider, **params)
- self.migrations_client = MigrationsClientJSON(self.auth_provider,
- **params)
+ self.agents_client = AgentsClient(self.auth_provider, **params)
+ self.networks_client = NetworksClient(self.auth_provider, **params)
+ self.migrations_client = MigrationsClient(self.auth_provider,
+ **params)
self.security_group_default_rules_client = (
- SecurityGroupDefaultRulesClientJSON(self.auth_provider, **params))
- self.certificates_client = CertificatesClientJSON(self.auth_provider,
- **params)
- self.servers_client = ServersClientJSON(
+ SecurityGroupDefaultRulesClient(self.auth_provider, **params))
+ self.certificates_client = CertificatesClient(self.auth_provider,
+ **params)
+ self.servers_client = ServersClient(
self.auth_provider,
enable_instance_password=CONF.compute_feature_enabled
.enable_instance_password,
**params)
- self.limits_client = LimitsClientJSON(self.auth_provider, **params)
- self.images_client = ImagesClientJSON(self.auth_provider, **params)
- self.keypairs_client = KeyPairsClientJSON(self.auth_provider, **params)
- self.quotas_client = QuotasClientJSON(self.auth_provider, **params)
- self.quota_classes_client = QuotaClassesClientJSON(self.auth_provider,
- **params)
- self.flavors_client = FlavorsClientJSON(self.auth_provider, **params)
- self.extensions_client = ExtensionsClientJSON(self.auth_provider,
- **params)
- self.floating_ips_client = FloatingIPsClientJSON(self.auth_provider,
- **params)
- self.security_groups_client = SecurityGroupsClientJSON(
+ self.limits_client = LimitsClient(self.auth_provider, **params)
+ self.images_client = ImagesClient(self.auth_provider, **params)
+ self.keypairs_client = KeyPairsClient(self.auth_provider, **params)
+ self.quotas_client = QuotasClient(self.auth_provider, **params)
+ self.quota_classes_client = QuotaClassesClient(self.auth_provider,
+ **params)
+ self.flavors_client = FlavorsClient(self.auth_provider, **params)
+ self.extensions_client = ExtensionsClient(self.auth_provider,
+ **params)
+ self.floating_ips_client = FloatingIPsClient(self.auth_provider,
+ **params)
+ self.security_groups_client = SecurityGroupsClient(
self.auth_provider, **params)
- self.interfaces_client = InterfacesClientJSON(self.auth_provider,
- **params)
- self.fixed_ips_client = FixedIPsClientJSON(self.auth_provider,
- **params)
- self.availability_zone_client = AvailabilityZoneClientJSON(
+ self.interfaces_client = InterfacesClient(self.auth_provider,
+ **params)
+ self.fixed_ips_client = FixedIPsClient(self.auth_provider,
+ **params)
+ self.availability_zone_client = AvailabilityZoneClient(
self.auth_provider, **params)
- self.aggregates_client = AggregatesClientJSON(self.auth_provider,
- **params)
- self.services_client = ServicesClientJSON(self.auth_provider, **params)
- self.tenant_usages_client = TenantUsagesClientJSON(self.auth_provider,
- **params)
- self.hosts_client = HostsClientJSON(self.auth_provider, **params)
- self.hypervisor_client = HypervisorClientJSON(self.auth_provider,
- **params)
+ self.aggregates_client = AggregatesClient(self.auth_provider,
+ **params)
+ self.services_client = ServicesClient(self.auth_provider, **params)
+ self.tenant_usages_client = TenantUsagesClient(self.auth_provider,
+ **params)
+ self.hosts_client = HostsClient(self.auth_provider, **params)
+ self.hypervisor_client = HypervisorClient(self.auth_provider,
+ **params)
self.instance_usages_audit_log_client = \
- InstanceUsagesAuditLogClientJSON(self.auth_provider, **params)
+ InstanceUsagesAuditLogClient(self.auth_provider, **params)
self.tenant_networks_client = \
- TenantNetworksClientJSON(self.auth_provider, **params)
- self.baremetal_nodes_client = BaremetalNodesClientJSON(
+ TenantNetworksClient(self.auth_provider, **params)
+ self.baremetal_nodes_client = BaremetalNodesClient(
self.auth_provider, **params)
# NOTE: The following client needs special timeout values because
@@ -304,22 +304,22 @@
'build_interval': CONF.volume.build_interval,
'build_timeout': CONF.volume.build_timeout
})
- self.volumes_extensions_client = VolumesExtensionsClientJSON(
+ self.volumes_extensions_client = VolumesExtensionsClient(
self.auth_provider, default_volume_size=CONF.volume.volume_size,
**params_volume)
def _set_database_clients(self):
- self.database_flavors_client = DatabaseFlavorsClientJSON(
+ self.database_flavors_client = DatabaseFlavorsClient(
self.auth_provider,
CONF.database.catalog_type,
CONF.identity.region,
**self.default_params_with_timeout_values)
- self.database_limits_client = DatabaseLimitsClientJSON(
+ self.database_limits_client = DatabaseLimitsClient(
self.auth_provider,
CONF.database.catalog_type,
CONF.identity.region,
**self.default_params_with_timeout_values)
- self.database_versions_client = DatabaseVersionsClientJSON(
+ self.database_versions_client = DatabaseVersionsClient(
self.auth_provider,
CONF.database.catalog_type,
CONF.identity.region,
@@ -333,17 +333,17 @@
}
params.update(self.default_params_with_timeout_values)
- self.identity_client = IdentityClientJSON(self.auth_provider,
- **params)
- self.identity_v3_client = IdentityV3ClientJSON(self.auth_provider,
- **params)
- self.endpoints_client = EndPointClientJSON(self.auth_provider,
+ self.identity_client = IdentityClient(self.auth_provider,
+ **params)
+ self.identity_v3_client = IdentityV3Client(self.auth_provider,
**params)
- self.service_client = ServiceClientJSON(self.auth_provider, **params)
- self.policy_client = PolicyClientJSON(self.auth_provider, **params)
- self.region_client = RegionClientJSON(self.auth_provider, **params)
- self.credentials_client = CredentialsClientJSON(self.auth_provider,
- **params)
+ self.endpoints_client = EndPointClient(self.auth_provider,
+ **params)
+ self.service_client = ServiceClient(self.auth_provider, **params)
+ self.policy_client = PolicyClient(self.auth_provider, **params)
+ self.region_client = RegionClient(self.auth_provider, **params)
+ self.credentials_client = CredentialsClient(self.auth_provider,
+ **params)
# Token clients do not use the catalog. They only need default_params.
# They read auth_url, so they should only be set if the corresponding
# API version is marked as enabled
@@ -372,46 +372,46 @@
}
params.update(self.default_params)
- self.volume_qos_client = QosSpecsClientJSON(self.auth_provider,
- **params)
- self.volume_qos_v2_client = QosSpecsV2ClientJSON(
+ self.volume_qos_client = QosSpecsClient(self.auth_provider,
+ **params)
+ self.volume_qos_v2_client = QosSpecsV2Client(
self.auth_provider, **params)
- self.volume_services_v2_client = VolumesServicesV2ClientJSON(
+ self.volume_services_v2_client = VolumesServicesV2Client(
self.auth_provider, **params)
- self.backups_client = BackupsClientJSON(self.auth_provider, **params)
- self.backups_v2_client = BackupsClientV2JSON(self.auth_provider,
+ self.backups_client = BackupsClient(self.auth_provider, **params)
+ self.backups_v2_client = BackupsClientV2(self.auth_provider,
+ **params)
+ self.snapshots_client = SnapshotsClient(self.auth_provider,
+ **params)
+ self.snapshots_v2_client = SnapshotsV2Client(self.auth_provider,
**params)
- self.snapshots_client = SnapshotsClientJSON(self.auth_provider,
- **params)
- self.snapshots_v2_client = SnapshotsV2ClientJSON(self.auth_provider,
- **params)
- self.volumes_client = VolumesClientJSON(
+ self.volumes_client = VolumesClient(
self.auth_provider, default_volume_size=CONF.volume.volume_size,
**params)
- self.volumes_v2_client = VolumesV2ClientJSON(
+ self.volumes_v2_client = VolumesV2Client(
self.auth_provider, default_volume_size=CONF.volume.volume_size,
**params)
- self.volume_types_client = VolumeTypesClientJSON(self.auth_provider,
- **params)
- self.volume_services_client = VolumesServicesClientJSON(
+ self.volume_types_client = VolumeTypesClient(self.auth_provider,
+ **params)
+ self.volume_services_client = VolumesServicesClient(
self.auth_provider, **params)
- self.volume_hosts_client = VolumeHostsClientJSON(self.auth_provider,
- **params)
- self.volume_hosts_v2_client = VolumeHostsV2ClientJSON(
+ self.volume_hosts_client = VolumeHostsClient(self.auth_provider,
+ **params)
+ self.volume_hosts_v2_client = VolumeHostsV2Client(
self.auth_provider, **params)
- self.volume_quotas_client = VolumeQuotasClientJSON(self.auth_provider,
- **params)
+ self.volume_quotas_client = VolumeQuotasClient(self.auth_provider,
+ **params)
self.volume_quotas_v2_client = VolumeQuotasV2Client(self.auth_provider,
**params)
- self.volumes_extension_client = VolumeExtensionClientJSON(
+ self.volumes_extension_client = VolumeExtensionClient(
self.auth_provider, **params)
- self.volumes_v2_extension_client = VolumeV2ExtensionClientJSON(
+ self.volumes_v2_extension_client = VolumeV2ExtensionClient(
self.auth_provider, **params)
self.volume_availability_zone_client = \
- VolumeAvailabilityZoneClientJSON(self.auth_provider, **params)
+ VolumeAvailabilityZoneClient(self.auth_provider, **params)
self.volume_v2_availability_zone_client = \
- VolumeV2AvailabilityZoneClientJSON(self.auth_provider, **params)
- self.volume_types_v2_client = VolumeTypesV2ClientJSON(
+ VolumeV2AvailabilityZoneClient(self.auth_provider, **params)
+ self.volume_types_v2_client = VolumeTypesV2Client(
self.auth_provider, **params)
def _set_object_storage_clients(self):
diff --git a/tempest/cmd/account_generator.py b/tempest/cmd/account_generator.py
index fbfbbb7..0360146 100755
--- a/tempest/cmd/account_generator.py
+++ b/tempest/cmd/account_generator.py
@@ -128,7 +128,7 @@
'build_interval': CONF.compute.build_interval,
'build_timeout': CONF.compute.build_timeout
}
- identity_admin = identity_client.IdentityClientJSON(
+ identity_admin = identity_client.IdentityClient(
_auth,
CONF.identity.catalog_type,
CONF.identity.region,
@@ -138,7 +138,7 @@
network_admin = None
if (CONF.service_available.neutron and
CONF.auth.create_isolated_networks):
- network_admin = network_client.NetworkClientJSON(
+ network_admin = network_client.NetworkClient(
_auth,
CONF.network.catalog_type,
CONF.network.region or CONF.identity.region,
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 8ec4670..1de20d6 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -420,131 +420,6 @@
self.data['networks'] = networks
-class NetworkIpSecPolicyService(NetworkService):
-
- def list(self):
- client = self.client
- ipsecpols = client.list_ipsecpolicies()
- ipsecpols = ipsecpols['ipsecpolicies']
- ipsecpols = self._filter_by_tenant_id(ipsecpols)
- LOG.debug("List count, %s IP Security Policies" % len(ipsecpols))
- return ipsecpols
-
- def delete(self):
- client = self.client
- ipsecpols = self.list()
- for ipsecpol in ipsecpols:
- try:
- client.delete_ipsecpolicy(ipsecpol['id'])
- except Exception as e:
- LOG.exception("Delete IP Securty Policy exception: %s" % e)
- pass
-
- def dry_run(self):
- ipsecpols = self.list()
- self.data['ip_security_policies'] = ipsecpols
-
-
-class NetworkFwPolicyService(NetworkService):
-
- def list(self):
- client = self.client
- fwpols = client.list_firewall_policies()
- fwpols = fwpols['firewall_policies']
- fwpols = self._filter_by_tenant_id(fwpols)
- LOG.debug("List count, %s Firewall Policies" % len(fwpols))
- return fwpols
-
- def delete(self):
- client = self.client
- fwpols = self.list()
- for fwpol in fwpols:
- try:
- client.delete_firewall_policy(fwpol['id'])
- except Exception as e:
- LOG.exception("Delete Firewall Policy exception: %s" % e)
- pass
-
- def dry_run(self):
- fwpols = self.list()
- self.data['firewall_policies'] = fwpols
-
-
-class NetworkFwRulesService(NetworkService):
-
- def list(self):
- client = self.client
- fwrules = client.list_firewall_rules()
- fwrules = fwrules['firewall_rules']
- fwrules = self._filter_by_tenant_id(fwrules)
- LOG.debug("List count, %s Firewall Rules" % len(fwrules))
- return fwrules
-
- def delete(self):
- client = self.client
- fwrules = self.list()
- for fwrule in fwrules:
- try:
- client.delete_firewall_rule(fwrule['id'])
- except Exception as e:
- LOG.exception("Delete Firewall Rule exception: %s" % e)
- pass
-
- def dry_run(self):
- fwrules = self.list()
- self.data['firewall_rules'] = fwrules
-
-
-class NetworkIkePolicyService(NetworkService):
-
- def list(self):
- client = self.client
- ikepols = client.list_ikepolicies()
- ikepols = ikepols['ikepolicies']
- ikepols = self._filter_by_tenant_id(ikepols)
- LOG.debug("List count, %s IKE Policies" % len(ikepols))
- return ikepols
-
- def delete(self):
- client = self.client
- ikepols = self.list()
- for ikepol in ikepols:
- try:
- client.delete_firewall_rule(ikepol['id'])
- except Exception as e:
- LOG.exception("Delete IKE Policy exception: %s" % e)
- pass
-
- def dry_run(self):
- ikepols = self.list()
- self.data['ike_policies'] = ikepols
-
-
-class NetworkVpnServiceService(NetworkService):
-
- def list(self):
- client = self.client
- vpnsrvs = client.list_vpnservices()
- vpnsrvs = vpnsrvs['vpnservices']
- vpnsrvs = self._filter_by_tenant_id(vpnsrvs)
- LOG.debug("List count, %s VPN Services" % len(vpnsrvs))
- return vpnsrvs
-
- def delete(self):
- client = self.client
- vpnsrvs = self.list()
- for vpnsrv in vpnsrvs:
- try:
- client.delete_vpnservice(vpnsrv['id'])
- except Exception as e:
- LOG.exception("Delete VPN Service exception: %s" % e)
- pass
-
- def dry_run(self):
- vpnsrvs = self.list()
- self.data['vpn_services'] = vpnsrvs
-
-
class NetworkFloatingIpService(NetworkService):
def list(self):
@@ -1094,18 +969,6 @@
if IS_HEAT:
tenant_services.append(StackService)
if IS_NEUTRON:
- if test.is_extension_enabled('vpnaas', 'network'):
- tenant_services.append(NetworkIpSecPolicyService)
- tenant_services.append(NetworkIkePolicyService)
- tenant_services.append(NetworkVpnServiceService)
- if test.is_extension_enabled('fwaas', 'network'):
- tenant_services.append(NetworkFwPolicyService)
- tenant_services.append(NetworkFwRulesService)
- if test.is_extension_enabled('lbaas', 'network'):
- tenant_services.append(NetworkHealthMonitorService)
- tenant_services.append(NetworkMemberService)
- tenant_services.append(NetworkVipService)
- tenant_services.append(NetworkPoolService)
if test.is_extension_enabled('metering', 'network'):
tenant_services.append(NetworkMeteringLabelRuleService)
tenant_services.append(NetworkMeteringLabelService)
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index 5871628..f091cd3 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -188,25 +188,25 @@
}
_auth = auth.KeystoneV2AuthProvider(
_creds, CONF.identity.uri, **auth_provider_params)
- self.identity = identity_client.IdentityClientJSON(
+ self.identity = identity_client.IdentityClient(
_auth,
CONF.identity.catalog_type,
CONF.identity.region,
endpoint_type='adminURL',
**default_params_with_timeout_values)
- self.servers = servers_client.ServersClientJSON(_auth,
- **compute_params)
- self.flavors = flavors_client.FlavorsClientJSON(_auth,
- **compute_params)
- self.floating_ips = floating_ips_client.FloatingIPsClientJSON(
+ self.servers = servers_client.ServersClient(_auth,
+ **compute_params)
+ self.flavors = flavors_client.FlavorsClient(_auth,
+ **compute_params)
+ self.floating_ips = floating_ips_client.FloatingIPsClient(
_auth, **compute_params)
- self.secgroups = security_groups_client.SecurityGroupsClientJSON(
+ self.secgroups = security_groups_client.SecurityGroupsClient(
_auth, **compute_params)
self.objects = object_client.ObjectClient(_auth,
**object_storage_params)
self.containers = container_client.ContainerClient(
_auth, **object_storage_params)
- self.images = image_client.ImageClientV2JSON(
+ self.images = image_client.ImageClientV2(
_auth,
CONF.image.catalog_type,
CONF.image.region or CONF.identity.region,
@@ -214,13 +214,13 @@
build_interval=CONF.image.build_interval,
build_timeout=CONF.image.build_timeout,
**default_params)
- self.telemetry = telemetry_client.TelemetryClientJSON(
+ self.telemetry = telemetry_client.TelemetryClient(
_auth,
CONF.telemetry.catalog_type,
CONF.identity.region,
endpoint_type=CONF.telemetry.endpoint_type,
**default_params_with_timeout_values)
- self.volumes = volumes_client.VolumesClientJSON(
+ self.volumes = volumes_client.VolumesClient(
_auth,
CONF.volume.catalog_type,
CONF.volume.region or CONF.identity.region,
@@ -228,7 +228,7 @@
build_interval=CONF.volume.build_interval,
build_timeout=CONF.volume.build_timeout,
**default_params)
- self.networks = network_client.NetworkClientJSON(
+ self.networks = network_client.NetworkClient(
_auth,
CONF.network.catalog_type,
CONF.network.region or CONF.identity.region,
@@ -453,7 +453,7 @@
found,
"Couldn't find expected server %s" % server['name'])
- found = client.servers.get_server(found['id'])
+ found = client.servers.show_server(found['id'])
# validate neutron is enabled and ironic disabled:
if (CONF.service_available.neutron and
not CONF.baremetal.driver_enabled):
diff --git a/tempest/cmd/main.py b/tempest/cmd/main.py
new file mode 100644
index 0000000..762e982
--- /dev/null
+++ b/tempest/cmd/main.py
@@ -0,0 +1,52 @@
+# Copyright 2015 Dell 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.
+
+import logging
+import sys
+
+from cliff import app
+from cliff import commandmanager
+
+TEMPEST_CLI_VERSION = '0.1'
+
+
+class Main(app.App):
+
+ log = logging.getLogger(__name__)
+
+ def __init__(self):
+ super(Main, self).__init__(
+ description='Tempest cli application',
+ version=TEMPEST_CLI_VERSION,
+ command_manager=commandmanager.CommandManager('tempest.cm'),
+ )
+
+ def initialize_app(self, argv):
+ self.log.debug('tempest initialize_app')
+
+ def prepare_to_run_command(self, cmd):
+ self.log.debug('prepare_to_run_command %s', cmd.__class__.__name__)
+
+ def clean_up(self, cmd, result, err):
+ self.log.debug('tempest clean_up %s', cmd.__class__.__name__)
+ if err:
+ self.log.debug('tempest got an error: %s', err)
+
+
+def main(argv=sys.argv[1:]):
+ the_app = Main()
+ return the_app.run(argv)
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/tempest/common/cred_provider.py b/tempest/common/cred_provider.py
index 461097f..2b7e0db 100644
--- a/tempest/common/cred_provider.py
+++ b/tempest/common/cred_provider.py
@@ -98,20 +98,17 @@
@six.add_metaclass(abc.ABCMeta)
class CredentialProvider(object):
- def __init__(self, identity_version=None, name=None, password='pass',
+ def __init__(self, identity_version=None, name=None,
network_resources=None):
"""A CredentialProvider supplies credentials to test classes.
- :param identity_version If specified it will return credentials of the
- corresponding identity version, otherwise it
- uses auth_version from configuration
- :param name Name of the calling test. Included in provisioned
- credentials when credentials are provisioned on the fly
- :param password Used for provisioned credentials when credentials are
- provisioned on the fly
- :param network_resources Network resources required for the credentials
+ :param identity_version: If specified it will return credentials of the
+ corresponding identity version, otherwise it
+ uses auth_version from configuration
+ :param name: Name of the calling test. Included in provisioned
+ credentials when credentials are provisioned on the fly
+ :param network_resources: Network resources required for the
+ credentials
"""
- # TODO(andreaf) name and password are tenant isolation specific, and
- # could be removed from this abstract class
self.name = name or "test_creds"
self.identity_version = identity_version or CONF.identity.auth_version
if not auth.is_identity_version_supported(self.identity_version):
diff --git a/tempest/common/fixed_network.py b/tempest/common/fixed_network.py
index de44c4d..9ec0ec6 100644
--- a/tempest/common/fixed_network.py
+++ b/tempest/common/fixed_network.py
@@ -27,7 +27,7 @@
"""Get a full network dict from just a network name
:param str name: the name of the network to use
- :param NetworksClientJSON compute_networks_client: The network client
+ :param NetworksClient compute_networks_client: The network client
object to use for making the network lists api request
:return: The full dictionary for the network in question
:rtype: dict
diff --git a/tempest/common/isolated_creds.py b/tempest/common/isolated_creds.py
index 5ded3ee..2102638 100644
--- a/tempest/common/isolated_creds.py
+++ b/tempest/common/isolated_creds.py
@@ -16,11 +16,11 @@
import netaddr
from oslo_log import log as logging
import six
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest import clients
from tempest.common import cred_provider
+from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest.services.identity.v2.json import identity_client as v2_identity
@@ -128,7 +128,7 @@
def get_creds_client(identity_client, project_domain_name=None):
- if isinstance(identity_client, v2_identity.IdentityClientJSON):
+ if isinstance(identity_client, v2_identity.IdentityClient):
return V2CredsClient(identity_client)
else:
return V3CredsClient(identity_client, project_domain_name)
@@ -136,14 +136,13 @@
class IsolatedCreds(cred_provider.CredentialProvider):
- def __init__(self, identity_version=None, name=None, password='pass',
+ def __init__(self, identity_version=None, name=None,
network_resources=None):
- super(IsolatedCreds, self).__init__(identity_version, name, password,
+ super(IsolatedCreds, self).__init__(identity_version, name,
network_resources)
self.network_resources = network_resources
self.isolated_creds = {}
self.ports = []
- self.password = password
self.default_admin_creds = cred_provider.get_configured_credentials(
'identity_admin', fill_in=True,
identity_version=self.identity_version)
@@ -193,9 +192,10 @@
name=project_name, description=project_desc)
username = data_utils.rand_name(root) + suffix
+ user_password = data_utils.rand_password()
email = data_utils.rand_name(root) + suffix + "@example.com"
user = self.creds_client.create_user(
- username, self.password, project, email)
+ username, user_password, project, email)
if admin:
self.creds_client.assign_user_role(user, project,
CONF.identity.admin_role)
@@ -206,7 +206,7 @@
if roles:
for role in roles:
self.creds_client.assign_user_role(user, project, role)
- creds = self.creds_client.get_credentials(user, project, self.password)
+ creds = self.creds_client.get_credentials(user, project, user_password)
return cred_provider.TestResources(creds)
def _create_network_resources(self, tenant_id):
diff --git a/tempest/common/utils/__init__.py b/tempest/common/utils/__init__.py
index 04d898d..81b8110 100644
--- a/tempest/common/utils/__init__.py
+++ b/tempest/common/utils/__init__.py
@@ -1,3 +1,45 @@
+# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
+#
+# 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 functools import partial
+
+from tempest import config
+
+from tempest_lib.common.utils import data_utils as lib_data_utils
+
+CONF = config.CONF
+
PING_IPV4_COMMAND = 'ping -c 3 '
PING_IPV6_COMMAND = 'ping6 -c 3 '
PING_PACKET_LOSS_REGEX = '(\d{1,3})\.?\d*\% packet loss'
+
+
+class DataUtils(object):
+ def __getattr__(self, attr):
+ if attr in self.__dict__:
+ return self.__dict__[attr]
+
+ if attr == 'rand_name':
+ # NOTE(flwang): This is a proxy to generate a random name that
+ # includes a random number and a prefix if one is configured in
+ # CONF.resources_prefix
+ attr_obj = partial(lib_data_utils.rand_name,
+ prefix=CONF.resources_prefix)
+ else:
+ attr_obj = getattr(lib_data_utils, attr)
+
+ self.__dict__[attr] = attr_obj
+ return attr_obj
+
+data_utils = DataUtils()
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index d4e6eb8..93c2c10 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -30,10 +30,10 @@
# NOTE(afazekas): It should always get an address instead of server
def __init__(self, server, username, password=None, pkey=None):
- ssh_timeout = CONF.compute.ssh_timeout
+ ssh_timeout = CONF.validation.ssh_timeout
network = CONF.compute.network_for_ssh
- ip_version = CONF.compute.ip_version_for_ssh
- ssh_channel_timeout = CONF.compute.ssh_channel_timeout
+ ip_version = CONF.validation.ip_version_for_ssh
+ connect_timeout = CONF.validation.connect_timeout
if isinstance(server, six.string_types):
ip_address = server
else:
@@ -46,7 +46,7 @@
raise exceptions.ServerUnreachable()
self.ssh_client = ssh.Client(ip_address, username, password,
ssh_timeout, pkey=pkey,
- channel_timeout=ssh_channel_timeout)
+ channel_timeout=connect_timeout)
def exec_command(self, cmd):
# Shell options below add more clearness on failures,
@@ -72,8 +72,7 @@
return output.split()[1]
def get_number_of_vcpus(self):
- command = 'cat /proc/cpuinfo | grep processor | wc -l'
- output = self.exec_command(command)
+ output = self.exec_command('grep -c processor /proc/cpuinfo')
return int(output)
def get_partitions(self):
diff --git a/tempest/common/validation_resources.py b/tempest/common/validation_resources.py
index d370ebc..18f0b1d 100644
--- a/tempest/common/validation_resources.py
+++ b/tempest/common/validation_resources.py
@@ -14,9 +14,10 @@
from oslo_log import log as logging
from tempest import config
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
+from tempest.common.utils import data_utils
+
CONF = config.CONF
LOG = logging.getLogger(__name__)
diff --git a/tempest/common/waiters.py b/tempest/common/waiters.py
index 249bac9..bdbd6bc 100644
--- a/tempest/common/waiters.py
+++ b/tempest/common/waiters.py
@@ -33,7 +33,7 @@
# NOTE(afazekas): UNKNOWN status possible on ERROR
# or in a very early stage.
- body = client.get_server(server_id)
+ body = client.show_server(server_id)
old_status = server_status = body['status']
old_task_state = task_state = _get_task_state(body)
start_time = int(time.time())
@@ -60,7 +60,7 @@
return
time.sleep(client.build_interval)
- body = client.get_server(server_id)
+ body = client.show_server(server_id)
server_status = body['status']
task_state = _get_task_state(body)
if (server_status != old_status) or (task_state != old_task_state):
diff --git a/tempest/config.py b/tempest/config.py
index fc55723..7382088 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -31,9 +31,10 @@
def register_opt_group(conf, opt_group, options):
- conf.register_group(opt_group)
+ if opt_group:
+ conf.register_group(opt_group)
for opt in options:
- conf.register_opt(opt, group=opt_group.name)
+ conf.register_opt(opt, group=getattr(opt_group, 'name', None))
auth_group = cfg.OptGroup(name='auth',
@@ -239,18 +240,10 @@
default=1,
help="The number of ping packets originating from remote "
"linux hosts"),
- cfg.IntOpt('ssh_timeout',
- default=300,
- help="Timeout in seconds to wait for authentication to "
- "succeed."),
cfg.IntOpt('ready_wait',
default=0,
help="Additional wait time for clean state, when there is "
"no OS-EXT-STS extension available"),
- cfg.IntOpt('ssh_channel_timeout',
- default=60,
- help="Timeout in seconds to wait for output from ssh "
- "channel."),
cfg.StrOpt('fixed_network_name',
help="Name of the fixed network that is visible to all test "
"tenants. If multiple networks are available for a tenant"
@@ -262,9 +255,6 @@
default='public',
help="Network used for SSH connections. Ignored if "
"use_floatingip_for_ssh=true or run_validation=false."),
- cfg.IntOpt('ip_version_for_ssh',
- default=4,
- help="IP version used for SSH connections."),
cfg.BoolOpt('use_floatingip_for_ssh',
default=True,
help="Does SSH use Floating IPs?"),
@@ -391,7 +381,13 @@
default=False,
help='Does Nova preserve preexisting ports from Neutron '
'when deleting an instance? This should be set to True '
- 'if testing Kilo+ Nova.')
+ 'if testing Kilo+ Nova.'),
+ cfg.BoolOpt('attach_encrypted_volume',
+ default=True,
+ help='Does the test environment support attaching an '
+ 'encrypted volume to a running server instance? This may '
+ 'depend on the combination of compute_driver in nova and '
+ 'the volume_driver(s) in cinder.'),
]
@@ -520,9 +516,10 @@
help="Allow the execution of IPv6 tests"),
cfg.ListOpt('api_extensions',
default=['all'],
- help='A list of enabled network extensions with a special '
- 'entry all which indicates every extension is enabled. '
- 'Empty list indicates all extensions are disabled'),
+ help="A list of enabled network extensions with a special "
+ "entry all which indicates every extension is enabled. "
+ "Empty list indicates all extensions are disabled. "
+ "To get the list of extensions run: 'neutron ext-list'"),
cfg.BoolOpt('ipv6_subnet_attributes',
default=False,
help="Allow the execution of IPv6 subnet tests that use "
@@ -594,17 +591,23 @@
'Additional methods will be handled in a separate spec.'),
cfg.IntOpt('ip_version_for_ssh',
default=4,
- help='Default IP version for ssh connections.'),
+ help='Default IP version for ssh connections.',
+ deprecated_opts=[cfg.DeprecatedOpt('ip_version_for_ssh',
+ group='compute')]),
cfg.IntOpt('ping_timeout',
default=120,
help='Timeout in seconds to wait for ping to succeed.'),
cfg.IntOpt('connect_timeout',
default=60,
help='Timeout in seconds to wait for the TCP connection to be '
- 'successful.'),
+ 'successful.',
+ deprecated_opts=[cfg.DeprecatedOpt('ssh_channel_timeout',
+ group='compute')]),
cfg.IntOpt('ssh_timeout',
default=300,
- help='Timeout in seconds to wait for the ssh banner.'),
+ help='Timeout in seconds to wait for the ssh banner.',
+ deprecated_opts=[cfg.DeprecatedOpt('ssh_timeout',
+ group='compute')]),
]
volume_group = cfg.OptGroup(name='volume',
@@ -1137,6 +1140,15 @@
help="Test generator class for all negative tests"),
]
+DefaultGroup = [
+ cfg.StrOpt('resources_prefix',
+ default='tempest',
+ help="Prefix to be added when generating the name for "
+ "test resources. It can be used to discover all "
+ "resources associated with a specific test run when "
+ "running tempest on a real-life cloud"),
+]
+
_opts = [
(auth_group, AuthGroup),
(compute_group, ComputeGroup),
@@ -1166,7 +1178,8 @@
(debug_group, DebugGroup),
(baremetal_group, BaremetalGroup),
(input_scenario_group, InputScenarioGroup),
- (negative_group, NegativeGroup)
+ (negative_group, NegativeGroup),
+ (None, DefaultGroup)
]
@@ -1181,7 +1194,7 @@
The purpose of this is to allow tools like the Oslo sample config file
generator to discover the options exposed to users.
"""
- return [(g.name, o) for g, o in _opts]
+ return [(getattr(g, 'name', None), o) for g, o in _opts]
# this should never be called outside of this class
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 5f8d605..8f0b4dc 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -19,11 +19,11 @@
import netaddr
from oslo_log import log
import six
-from tempest_lib.common.utils import data_utils
from tempest_lib.common.utils import misc as misc_utils
from tempest_lib import exceptions as lib_exc
from tempest.common import fixed_network
+from tempest.common.utils import data_utils
from tempest.common.utils.linux import remote_client
from tempest import config
from tempest import exceptions
@@ -182,7 +182,7 @@
# The instance retrieved on creation is missing network
# details, necessitating retrieval after it becomes active to
# ensure correct details.
- server = self.servers_client.get_server(server['id'])
+ server = self.servers_client.show_server(server['id'])
self.assertEqual(server['name'], name)
return server
@@ -934,41 +934,6 @@
return rules
- def _create_pool(self, lb_method, protocol, subnet_id):
- """Wrapper utility that returns a test pool."""
- client = self.network_client
- name = data_utils.rand_name('pool')
- resp_pool = client.create_pool(protocol=protocol, name=name,
- subnet_id=subnet_id,
- lb_method=lb_method)
- pool = net_resources.DeletablePool(client=client, **resp_pool['pool'])
- self.assertEqual(pool['name'], name)
- self.addCleanup(self.delete_wrapper, pool.delete)
- return pool
-
- def _create_member(self, address, protocol_port, pool_id):
- """Wrapper utility that returns a test member."""
- client = self.network_client
- resp_member = client.create_member(protocol_port=protocol_port,
- pool_id=pool_id,
- address=address)
- member = net_resources.DeletableMember(client=client,
- **resp_member['member'])
- self.addCleanup(self.delete_wrapper, member.delete)
- return member
-
- def _create_vip(self, protocol, protocol_port, subnet_id, pool_id):
- """Wrapper utility that returns a test vip."""
- client = self.network_client
- name = data_utils.rand_name('vip')
- resp_vip = client.create_vip(protocol=protocol, name=name,
- subnet_id=subnet_id, pool_id=pool_id,
- protocol_port=protocol_port)
- vip = net_resources.DeletableVip(client=client, **resp_vip['vip'])
- self.assertEqual(vip['name'], name)
- self.addCleanup(self.delete_wrapper, vip.delete)
- return vip
-
def _ssh_to_server(self, server, private_key):
ssh_login = CONF.compute.image_ssh_user
return self.get_remote_client(server,
@@ -1264,7 +1229,7 @@
self.servers_client.wait_for_server_status(self.instance['id'],
'ACTIVE')
self.node = self.get_node(instance_id=self.instance['id'])
- self.instance = self.servers_client.get_server(self.instance['id'])
+ self.instance = self.servers_client.show_server(self.instance['id'])
def terminate_instance(self):
self.servers_client.delete_server(self.instance['id'])
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index 0e158ed..02d1171 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -14,9 +14,9 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest.common import tempest_fixtures as fixtures
+from tempest.common.utils import data_utils
from tempest.scenario import manager
from tempest import test
diff --git a/tempest/scenario/test_encrypted_cinder_volumes.py b/tempest/scenario/test_encrypted_cinder_volumes.py
index e6912d8..b66eb59 100644
--- a/tempest/scenario/test_encrypted_cinder_volumes.py
+++ b/tempest/scenario/test_encrypted_cinder_volumes.py
@@ -13,9 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
+from tempest import config
from tempest.scenario import manager
from tempest import test
+CONF = config.CONF
+
class TestEncryptedCinderVolumes(manager.EncryptionScenarioTest):
@@ -31,6 +34,12 @@
* Attaches and detaches the encrypted volume to the instance
"""
+ @classmethod
+ def skip_checks(cls):
+ super(TestEncryptedCinderVolumes, cls).skip_checks()
+ if not CONF.compute_feature_enabled.attach_encrypted_volume:
+ raise cls.skipException('Encrypted volume attach is not supported')
+
def launch_instance(self):
self.glance_image_create()
self.nova_boot()
diff --git a/tempest/scenario/test_large_ops.py b/tempest/scenario/test_large_ops.py
index 56d4c7d..ffb35fb 100644
--- a/tempest/scenario/test_large_ops.py
+++ b/tempest/scenario/test_large_ops.py
@@ -14,10 +14,10 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.common import fixed_network
+from tempest.common.utils import data_utils
from tempest import config
from tempest.scenario import manager
from tempest import test
diff --git a/tempest/scenario/test_load_balancer_basic.py b/tempest/scenario/test_load_balancer_basic.py
deleted file mode 100644
index 691c7c9..0000000
--- a/tempest/scenario/test_load_balancer_basic.py
+++ /dev/null
@@ -1,321 +0,0 @@
-# Copyright 2014 Mirantis.inc
-# 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.
-
-
-import tempfile
-import time
-
-import six
-from six.moves.urllib import request as urllib2
-
-from tempest.common import commands
-from tempest import config
-from tempest import exceptions
-from tempest.scenario import manager
-from tempest.services.network import resources as net_resources
-from tempest import test
-
-config = config.CONF
-
-
-class TestLoadBalancerBasic(manager.NetworkScenarioTest):
-
- """
- This test checks basic load balancing.
-
- The following is the scenario outline:
- 1. Create an instance
- 2. SSH to the instance and start two servers
- 3. Create a load balancer with two members and with ROUND_ROBIN algorithm
- associate the VIP with a floating ip
- 4. Send NUM requests to the floating ip and check that they are shared
- between the two servers.
- """
-
- @classmethod
- def skip_checks(cls):
- super(TestLoadBalancerBasic, cls).skip_checks()
- cfg = config.network
- if not test.is_extension_enabled('lbaas', 'network'):
- msg = 'LBaaS Extension is not enabled'
- raise cls.skipException(msg)
- if not (cfg.tenant_networks_reachable or cfg.public_network_id):
- msg = ('Either tenant_networks_reachable must be "true", or '
- 'public_network_id must be defined.')
- raise cls.skipException(msg)
-
- @classmethod
- def resource_setup(cls):
- super(TestLoadBalancerBasic, cls).resource_setup()
- cls.servers_keypairs = {}
- cls.members = []
- cls.floating_ips = {}
- cls.server_ips = {}
- cls.port1 = 80
- cls.port2 = 88
- cls.num = 50
-
- def setUp(self):
- super(TestLoadBalancerBasic, self).setUp()
- self.server_ips = {}
- self.server_fixed_ips = {}
- self._create_security_group_for_test()
- self._set_net_and_subnet()
-
- def _set_net_and_subnet(self):
- """
- Query and set appropriate network and subnet attributes to be used
- for the test. Existing tenant networks are used if they are found.
- The configured private network and associated subnet is used as a
- fallback in absence of tenant networking.
- """
- try:
- tenant_net = self._list_networks(tenant_id=self.tenant_id)[0]
- except IndexError:
- tenant_net = None
-
- if tenant_net:
- tenant_subnet = self._list_subnets(tenant_id=self.tenant_id)[0]
- self.subnet = net_resources.DeletableSubnet(
- client=self.network_client,
- **tenant_subnet)
- self.network = tenant_net
- else:
- self.network = self._get_network_by_name(
- config.compute.fixed_network_name)
- # TODO(adam_g): We are assuming that the first subnet associated
- # with the fixed network is the one we want. In the future, we
- # should instead pull a subnet id from config, which is set by
- # devstack/admin/etc.
- subnet = self._list_subnets(network_id=self.network['id'])[0]
- self.subnet = net_resources.AttributeDict(subnet)
-
- def _create_security_group_for_test(self):
- self.security_group = self._create_security_group(
- tenant_id=self.tenant_id)
- self._create_security_group_rules_for_port(self.port1)
- self._create_security_group_rules_for_port(self.port2)
-
- def _create_security_group_rules_for_port(self, port):
- rule = {
- 'direction': 'ingress',
- 'protocol': 'tcp',
- 'port_range_min': port,
- 'port_range_max': port,
- }
- self._create_security_group_rule(
- secgroup=self.security_group,
- tenant_id=self.tenant_id,
- **rule)
-
- def _create_server(self, name):
- keypair = self.create_keypair()
- security_groups = [{'name': self.security_group['name']}]
- create_kwargs = {
- 'networks': [
- {'uuid': self.network['id']},
- ],
- 'key_name': keypair['name'],
- 'security_groups': security_groups,
- }
- net_name = self.network['name']
- server = self.create_server(name=name, create_kwargs=create_kwargs)
- self.servers_keypairs[server['id']] = keypair
- if (config.network.public_network_id and not
- config.network.tenant_networks_reachable):
- public_network_id = config.network.public_network_id
- floating_ip = self.create_floating_ip(
- server, public_network_id)
- self.floating_ips[floating_ip] = server
- self.server_ips[server['id']] = floating_ip.floating_ip_address
- else:
- self.server_ips[server['id']] =\
- server['addresses'][net_name][0]['addr']
- self.server_fixed_ips[server['id']] =\
- server['addresses'][net_name][0]['addr']
- self.assertTrue(self.servers_keypairs)
- return server
-
- def _create_servers(self):
- for count in range(2):
- self._create_server(name=("server%s" % (count + 1)))
- self.assertEqual(len(self.servers_keypairs), 2)
-
- def _start_servers(self):
- """
- Start two backends
-
- 1. SSH to the instance
- 2. Start two http backends listening on ports 80 and 88 respectively
- """
- for server_id, ip in six.iteritems(self.server_ips):
- private_key = self.servers_keypairs[server_id]['private_key']
- server_name = self.servers_client.get_server(server_id)['name']
- username = config.scenario.ssh_user
- ssh_client = self.get_remote_client(
- server_or_ip=ip,
- private_key=private_key)
-
- # Write a backend's response into a file
- resp = ('echo -ne "HTTP/1.1 200 OK\r\nContent-Length: 7\r\n'
- 'Connection: close\r\nContent-Type: text/html; '
- 'charset=UTF-8\r\n\r\n%s"; cat >/dev/null')
-
- with tempfile.NamedTemporaryFile() as script:
- script.write(resp % server_name)
- script.flush()
- with tempfile.NamedTemporaryFile() as key:
- key.write(private_key)
- key.flush()
- commands.copy_file_to_host(script.name,
- "/tmp/script1",
- ip,
- username, key.name)
-
- # Start netcat
- start_server = ('while true; do '
- 'sudo nc -ll -p %(port)s -e sh /tmp/%(script)s; '
- 'done > /dev/null &')
- cmd = start_server % {'port': self.port1,
- 'script': 'script1'}
- ssh_client.exec_command(cmd)
-
- if len(self.server_ips) == 1:
- with tempfile.NamedTemporaryFile() as script:
- script.write(resp % 'server2')
- script.flush()
- with tempfile.NamedTemporaryFile() as key:
- key.write(private_key)
- key.flush()
- commands.copy_file_to_host(script.name,
- "/tmp/script2", ip,
- username, key.name)
- cmd = start_server % {'port': self.port2,
- 'script': 'script2'}
- ssh_client.exec_command(cmd)
-
- def _check_connection(self, check_ip, port=80):
- def try_connect(ip, port):
- try:
- resp = urllib2.urlopen("http://{0}:{1}/".format(ip, port))
- if resp.getcode() == 200:
- return True
- return False
- except IOError:
- return False
- except urllib2.HTTPError:
- return False
- timeout = config.compute.ping_timeout
- start = time.time()
- while not try_connect(check_ip, port):
- if (time.time() - start) > timeout:
- message = "Timed out trying to connect to %s" % check_ip
- raise exceptions.TimeoutException(message)
-
- def _create_pool(self):
- """Create a pool with ROUND_ROBIN algorithm."""
- self.pool = super(TestLoadBalancerBasic, self)._create_pool(
- lb_method='ROUND_ROBIN',
- protocol='HTTP',
- subnet_id=self.subnet.id)
- self.assertTrue(self.pool)
-
- def _create_members(self):
- """
- Create two members.
-
- In case there is only one server, create both members with the same ip
- but with different ports to listen on.
- """
-
- for server_id, ip in six.iteritems(self.server_fixed_ips):
- if len(self.server_fixed_ips) == 1:
- member1 = self._create_member(address=ip,
- protocol_port=self.port1,
- pool_id=self.pool.id)
- member2 = self._create_member(address=ip,
- protocol_port=self.port2,
- pool_id=self.pool.id)
- self.members.extend([member1, member2])
- else:
- member = self._create_member(address=ip,
- protocol_port=self.port1,
- pool_id=self.pool.id)
- self.members.append(member)
- self.assertTrue(self.members)
-
- def _assign_floating_ip_to_vip(self, vip):
- public_network_id = config.network.public_network_id
- port_id = vip.port_id
- floating_ip = self.create_floating_ip(vip, public_network_id,
- port_id=port_id)
- self.floating_ips.setdefault(vip.id, [])
- self.floating_ips[vip.id].append(floating_ip)
- # Check for floating ip status before you check load-balancer
- self.check_floating_ip_status(floating_ip, "ACTIVE")
-
- def _create_load_balancer(self):
- self._create_pool()
- self._create_members()
- self.vip = self._create_vip(protocol='HTTP',
- protocol_port=80,
- subnet_id=self.subnet.id,
- pool_id=self.pool.id)
- self.vip.wait_for_status('ACTIVE')
- if (config.network.public_network_id and not
- config.network.tenant_networks_reachable):
- self._assign_floating_ip_to_vip(self.vip)
- self.vip_ip = self.floating_ips[
- self.vip.id][0]['floating_ip_address']
- else:
- self.vip_ip = self.vip.address
-
- # Currently the ovs-agent is not enforcing security groups on the
- # vip port - see https://bugs.launchpad.net/neutron/+bug/1163569
- # However the linuxbridge-agent does, and it is necessary to add a
- # security group with a rule that allows tcp port 80 to the vip port.
- self.network_client.update_port(
- self.vip.port_id, security_groups=[self.security_group.id])
-
- def _check_load_balancing(self):
- """
- 1. Send NUM requests on the floating ip associated with the VIP
- 2. Check that the requests are shared between the two servers
- """
-
- self._check_connection(self.vip_ip)
- self._send_requests(self.vip_ip, ["server1", "server2"])
-
- def _send_requests(self, vip_ip, servers):
- counters = dict.fromkeys(servers, 0)
- for i in range(self.num):
- try:
- server = urllib2.urlopen("http://{0}/".format(vip_ip)).read()
- counters[server] += 1
- # HTTP exception means fail of server, so don't increase counter
- # of success and continue connection tries
- except urllib2.HTTPError:
- continue
- # Assert that each member of the pool gets balanced at least once
- for member, counter in six.iteritems(counters):
- self.assertGreater(counter, 0, 'Member %s never balanced' % member)
-
- @test.idempotent_id('c0c6f1ca-603b-4509-9c0f-2c63f0d838ee')
- @test.services('compute', 'network')
- def test_load_balancer_basic(self):
- self._create_server('server1')
- self._start_servers()
- self._create_load_balancer()
- self._check_load_balancing()
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index 45923ce..6057cd3 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -60,7 +60,7 @@
self.assertIn(self.server['id'], [x['id'] for x in servers])
def nova_show(self):
- got_server = self.servers_client.get_server(self.server['id'])
+ got_server = self.servers_client.show_server(self.server['id'])
self.assertThat(
self.server, custom_matchers.MatchesDictExceptForKeys(
got_server, excluded_keys=['OS-EXT-AZ:availability_zone']))
@@ -110,7 +110,7 @@
self.server['id'], secgroup['name'])
def wait_for_secgroup_add():
- body = self.servers_client.get_server(self.server['id'])
+ body = self.servers_client.show_server(self.server['id'])
return {'name': secgroup['name']} in body['security_groups']
if not test.call_until_true(wait_for_secgroup_add,
diff --git a/tempest/scenario/test_network_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py
index 3d6abff..c864379 100644
--- a/tempest/scenario/test_network_advanced_server_ops.py
+++ b/tempest/scenario/test_network_advanced_server_ops.py
@@ -14,9 +14,9 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
import testtools
+from tempest.common.utils import data_utils
from tempest import config
from tempest.scenario import manager
from tempest import test
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 3274ce8..6461886 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -17,9 +17,9 @@
import re
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
import testtools
+from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest.scenario import manager
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index 8ec10c7..18fd09d 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -14,9 +14,9 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest import clients
+from tempest.common.utils import data_utils
from tempest import config
from tempest.scenario import manager
from tempest import test
diff --git a/tempest/scenario/test_server_advanced_ops.py b/tempest/scenario/test_server_advanced_ops.py
index f45f0c9..04d5c8b 100644
--- a/tempest/scenario/test_server_advanced_ops.py
+++ b/tempest/scenario/test_server_advanced_ops.py
@@ -80,19 +80,19 @@
self.servers_client.suspend_server(instance_id)
self.servers_client.wait_for_server_status(instance_id,
'SUSPENDED')
- fetched_instance = self.servers_client.get_server(instance_id)
+ fetched_instance = self.servers_client.show_server(instance_id)
LOG.debug("Resuming instance %s. Current status: %s",
instance_id, fetched_instance['status'])
self.servers_client.resume_server(instance_id)
self.servers_client.wait_for_server_status(instance_id,
'ACTIVE')
- fetched_instance = self.servers_client.get_server(instance_id)
+ fetched_instance = self.servers_client.show_server(instance_id)
LOG.debug("Suspending instance %s. Current status: %s",
instance_id, fetched_instance['status'])
self.servers_client.suspend_server(instance_id)
self.servers_client.wait_for_server_status(instance_id,
'SUSPENDED')
- fetched_instance = self.servers_client.get_server(instance_id)
+ fetched_instance = self.servers_client.show_server(instance_id)
LOG.debug("Resuming instance %s. Current status: %s",
instance_id, fetched_instance['status'])
self.servers_client.resume_server(instance_id)
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 51c4c59..c1d9a1b 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -16,11 +16,11 @@
import time
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
from tempest_lib import exceptions as lib_exc
import testtools
+from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest.scenario import manager
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 1731c48..102e9a3 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -11,8 +11,8 @@
# under the License.
from oslo_log import log
-from tempest_lib.common.utils import data_utils
+from tempest.common.utils import data_utils
from tempest import config
from tempest.scenario import manager
from tempest import test
@@ -47,7 +47,7 @@
vol_name = data_utils.rand_name('volume-origin')
return self.create_volume(name=vol_name, imageRef=img_uuid)
- def _boot_instance_from_volume(self, vol_id, keypair):
+ def _boot_instance_from_volume(self, vol_id, keypair, security_group):
# NOTE(gfidente): the syntax for block_device_mapping is
# dev_name=id:type:size:delete_on_terminate
# where type needs to be "snap" if the server is booted
@@ -56,12 +56,10 @@
'device_name': 'vda',
'volume_id': vol_id,
'delete_on_termination': '0'}]
- self.security_group = self._create_security_group()
- security_groups = [{'name': self.security_group['name']}]
create_kwargs = {
'block_device_mapping': bd_map,
'key_name': keypair['name'],
- 'security_groups': security_groups
+ 'security_groups': [{'name': security_group['name']}]
}
return self.create_server(image='', create_kwargs=create_kwargs)
@@ -134,12 +132,12 @@
@test.services('compute', 'volume', 'image')
def test_volume_boot_pattern(self):
keypair = self.create_keypair()
- self.security_group = self._create_security_group()
+ security_group = self._create_security_group()
# create an instance from volume
volume_origin = self._create_volume_from_image()
instance_1st = self._boot_instance_from_volume(volume_origin['id'],
- keypair)
+ keypair, security_group)
# write content to volume on instance
ssh_client_for_instance_1st = self._ssh_to_server(instance_1st,
@@ -151,7 +149,7 @@
# create a 2nd instance from volume
instance_2nd = self._boot_instance_from_volume(volume_origin['id'],
- keypair)
+ keypair, security_group)
# check the content of written file
ssh_client_for_instance_2nd = self._ssh_to_server(instance_2nd,
@@ -163,8 +161,9 @@
# create a 3rd instance from snapshot
volume = self._create_volume_from_snapshot(snapshot['id'])
- instance_from_snapshot = self._boot_instance_from_volume(volume['id'],
- keypair)
+ instance_from_snapshot = (
+ self._boot_instance_from_volume(volume['id'],
+ keypair, security_group))
# check the content of written file
ssh_client = self._ssh_to_server(instance_from_snapshot, keypair)
@@ -176,15 +175,16 @@
class TestVolumeBootPatternV2(TestVolumeBootPattern):
- def _boot_instance_from_volume(self, vol_id, keypair):
- bdms = [{'uuid': vol_id, 'source_type': 'volume',
- 'destination_type': 'volume', 'boot_index': 0,
- 'delete_on_termination': False}]
- self.security_group = self._create_security_group()
- security_groups = [{'name': self.security_group['name']}]
+ def _boot_instance_from_volume(self, vol_id, keypair, security_group):
+ bd_map_v2 = [{
+ 'uuid': vol_id,
+ 'source_type': 'volume',
+ 'destination_type': 'volume',
+ 'boot_index': 0,
+ 'delete_on_termination': False}]
create_kwargs = {
- 'block_device_mapping_v2': bdms,
+ 'block_device_mapping_v2': bd_map_v2,
'key_name': keypair['name'],
- 'security_groups': security_groups
+ 'security_groups': [{'name': security_group['name']}]
}
return self.create_server(image='', create_kwargs=create_kwargs)
diff --git a/tempest/services/baremetal/v1/json/baremetal_client.py b/tempest/services/baremetal/v1/json/baremetal_client.py
index 0c319f6..479402a 100644
--- a/tempest/services/baremetal/v1/json/baremetal_client.py
+++ b/tempest/services/baremetal/v1/json/baremetal_client.py
@@ -13,7 +13,7 @@
from tempest.services.baremetal import base
-class BaremetalClientJSON(base.BaremetalClient):
+class BaremetalClient(base.BaremetalClient):
"""
Base Tempest REST client for Ironic API v1.
"""
diff --git a/tempest/services/compute/json/agents_client.py b/tempest/services/compute/json/agents_client.py
index c69e483..e0e3ec3 100644
--- a/tempest/services/compute/json/agents_client.py
+++ b/tempest/services/compute/json/agents_client.py
@@ -20,7 +20,7 @@
from tempest.common import service_client
-class AgentsClientJSON(service_client.ServiceClient):
+class AgentsClient(service_client.ServiceClient):
"""
Tests Agents API
"""
@@ -45,12 +45,12 @@
def delete_agent(self, agent_id):
"""Delete an existing agent build."""
- resp, body = self.delete("os-agents/%s" % str(agent_id))
+ resp, body = self.delete("os-agents/%s" % agent_id)
self.validate_response(schema.delete_agent, resp, body)
return service_client.ResponseBody(resp, body)
def update_agent(self, agent_id, **kwargs):
"""Update an agent build."""
put_body = json.dumps({'para': kwargs})
- resp, body = self.put('os-agents/%s' % str(agent_id), put_body)
+ resp, body = self.put('os-agents/%s' % agent_id, put_body)
return service_client.ResponseBody(resp, self._parse_resp(body))
diff --git a/tempest/services/compute/json/aggregates_client.py b/tempest/services/compute/json/aggregates_client.py
index 6c02b63..e275895 100644
--- a/tempest/services/compute/json/aggregates_client.py
+++ b/tempest/services/compute/json/aggregates_client.py
@@ -21,7 +21,7 @@
from tempest.common import service_client
-class AggregatesClientJSON(service_client.ServiceClient):
+class AggregatesClient(service_client.ServiceClient):
def list_aggregates(self):
"""Get aggregate list."""
@@ -32,7 +32,7 @@
def show_aggregate(self, aggregate_id):
"""Get details of the given aggregate."""
- resp, body = self.get("os-aggregates/%s" % str(aggregate_id))
+ resp, body = self.get("os-aggregates/%s" % aggregate_id)
body = json.loads(body)
self.validate_response(schema.get_aggregate, resp, body)
return service_client.ResponseBody(resp, body['aggregate'])
@@ -53,7 +53,7 @@
'availability_zone': availability_zone
}
put_body = json.dumps({'aggregate': put_body})
- resp, body = self.put('os-aggregates/%s' % str(aggregate_id), put_body)
+ resp, body = self.put('os-aggregates/%s' % aggregate_id, put_body)
body = json.loads(body)
self.validate_response(schema.update_aggregate, resp, body)
@@ -61,7 +61,7 @@
def delete_aggregate(self, aggregate_id):
"""Deletes the given aggregate."""
- resp, body = self.delete("os-aggregates/%s" % str(aggregate_id))
+ resp, body = self.delete("os-aggregates/%s" % aggregate_id)
self.validate_response(schema.delete_aggregate, resp, body)
return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/availability_zone_client.py b/tempest/services/compute/json/availability_zone_client.py
index 925d79f..9686854 100644
--- a/tempest/services/compute/json/availability_zone_client.py
+++ b/tempest/services/compute/json/availability_zone_client.py
@@ -20,7 +20,7 @@
from tempest.common import service_client
-class AvailabilityZoneClientJSON(service_client.ServiceClient):
+class AvailabilityZoneClient(service_client.ServiceClient):
def list_availability_zones(self, detail=False):
url = 'os-availability-zone'
diff --git a/tempest/services/compute/json/baremetal_nodes_client.py b/tempest/services/compute/json/baremetal_nodes_client.py
index d8f13c4..42caa7b 100644
--- a/tempest/services/compute/json/baremetal_nodes_client.py
+++ b/tempest/services/compute/json/baremetal_nodes_client.py
@@ -21,7 +21,7 @@
from tempest.common import service_client
-class BaremetalNodesClientJSON(service_client.ServiceClient):
+class BaremetalNodesClient(service_client.ServiceClient):
"""
Tests Baremetal API
"""
diff --git a/tempest/services/compute/json/certificates_client.py b/tempest/services/compute/json/certificates_client.py
index 752a48e..15b019f 100644
--- a/tempest/services/compute/json/certificates_client.py
+++ b/tempest/services/compute/json/certificates_client.py
@@ -19,7 +19,7 @@
from tempest.common import service_client
-class CertificatesClientJSON(service_client.ServiceClient):
+class CertificatesClient(service_client.ServiceClient):
def show_certificate(self, id):
url = "os-certificates/%s" % (id)
diff --git a/tempest/services/compute/json/extensions_client.py b/tempest/services/compute/json/extensions_client.py
index 265b381..cd7ecbc 100644
--- a/tempest/services/compute/json/extensions_client.py
+++ b/tempest/services/compute/json/extensions_client.py
@@ -19,7 +19,7 @@
from tempest.common import service_client
-class ExtensionsClientJSON(service_client.ServiceClient):
+class ExtensionsClient(service_client.ServiceClient):
def list_extensions(self):
url = 'extensions'
diff --git a/tempest/services/compute/json/fixed_ips_client.py b/tempest/services/compute/json/fixed_ips_client.py
index 769bfdc..53a5476 100644
--- a/tempest/services/compute/json/fixed_ips_client.py
+++ b/tempest/services/compute/json/fixed_ips_client.py
@@ -19,7 +19,7 @@
from tempest.common import service_client
-class FixedIPsClientJSON(service_client.ServiceClient):
+class FixedIPsClient(service_client.ServiceClient):
def show_fixed_ip(self, fixed_ip):
url = "os-fixed-ips/%s" % (fixed_ip)
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index dee56ac..2f7de3f 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -25,30 +25,25 @@
from tempest.common import service_client
-class FlavorsClientJSON(service_client.ServiceClient):
+class FlavorsClient(service_client.ServiceClient):
- def list_flavors(self, params=None):
+ def list_flavors(self, detail=False, **params):
url = 'flavors'
+ _schema = schema.list_flavors
+
+ if detail:
+ url += '/detail'
+ _schema = schema.list_flavors_details
if params:
url += '?%s' % urllib.urlencode(params)
resp, body = self.get(url)
body = json.loads(body)
- self.validate_response(schema.list_flavors, resp, body)
- return service_client.ResponseBodyList(resp, body['flavors'])
-
- def list_flavors_with_detail(self, params=None):
- url = 'flavors/detail'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_flavors_details, resp, body)
+ self.validate_response(_schema, resp, body)
return service_client.ResponseBodyList(resp, body['flavors'])
def show_flavor(self, flavor_id):
- resp, body = self.get("flavors/%s" % str(flavor_id))
+ resp, body = self.get("flavors/%s" % flavor_id)
body = json.loads(body)
self.validate_response(schema.create_get_flavor_details, resp, body)
return service_client.ResponseBody(resp, body['flavor'])
@@ -87,7 +82,7 @@
# Did not use show_flavor(id) for verification as it gives
# 200 ok even for deleted id. LP #981263
# we can remove the loop here and use get by ID when bug gets sortedout
- flavors = self.list_flavors_with_detail()
+ flavors = self.list_flavors(detail=True)
for flavor in flavors:
if flavor['id'] == id:
return False
@@ -118,7 +113,7 @@
def show_flavor_extra_spec(self, flavor_id, key):
"""Gets extra Specs key-value of the mentioned flavor and key."""
- resp, body = self.get('flavors/%s/os-extra_specs/%s' % (str(flavor_id),
+ resp, body = self.get('flavors/%s/os-extra_specs/%s' % (flavor_id,
key))
body = json.loads(body)
self.validate_response(
@@ -139,7 +134,7 @@
def unset_flavor_extra_spec(self, flavor_id, key):
"""Unsets extra Specs from the mentioned flavor."""
resp, body = self.delete('flavors/%s/os-extra_specs/%s' %
- (str(flavor_id), key))
+ (flavor_id, key))
self.validate_response(schema.unset_flavor_extra_specs, resp, body)
return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/floating_ips_client.py b/tempest/services/compute/json/floating_ips_client.py
index 6095dc0..420037b 100644
--- a/tempest/services/compute/json/floating_ips_client.py
+++ b/tempest/services/compute/json/floating_ips_client.py
@@ -22,7 +22,7 @@
from tempest.common import service_client
-class FloatingIPsClientJSON(service_client.ServiceClient):
+class FloatingIPsClient(service_client.ServiceClient):
def list_floating_ips(self, params=None):
"""Returns a list of all floating IPs filtered by any parameters."""
@@ -37,7 +37,7 @@
def show_floating_ip(self, floating_ip_id):
"""Get the details of a floating IP."""
- url = "os-floating-ips/%s" % str(floating_ip_id)
+ url = "os-floating-ips/%s" % floating_ip_id
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.create_get_floating_ip, resp, body)
@@ -55,14 +55,14 @@
def delete_floating_ip(self, floating_ip_id):
"""Deletes the provided floating IP from the project."""
- url = "os-floating-ips/%s" % str(floating_ip_id)
+ url = "os-floating-ips/%s" % floating_ip_id
resp, body = self.delete(url)
self.validate_response(schema.add_remove_floating_ip, resp, body)
return service_client.ResponseBody(resp, body)
def associate_floating_ip_to_server(self, floating_ip, server_id):
"""Associate the provided floating IP to a specific server."""
- url = "servers/%s/action" % str(server_id)
+ url = "servers/%s/action" % server_id
post_body = {
'addFloatingIp': {
'address': floating_ip,
@@ -76,7 +76,7 @@
def disassociate_floating_ip_from_server(self, floating_ip, server_id):
"""Disassociate the provided floating IP from a specific server."""
- url = "servers/%s/action" % str(server_id)
+ url = "servers/%s/action" % server_id
post_body = {
'removeFloatingIp': {
'address': floating_ip,
diff --git a/tempest/services/compute/json/hosts_client.py b/tempest/services/compute/json/hosts_client.py
index 223b80f..0510104 100644
--- a/tempest/services/compute/json/hosts_client.py
+++ b/tempest/services/compute/json/hosts_client.py
@@ -20,7 +20,7 @@
from tempest.common import service_client
-class HostsClientJSON(service_client.ServiceClient):
+class HostsClient(service_client.ServiceClient):
def list_hosts(self, params=None):
"""Lists all hosts."""
@@ -37,7 +37,7 @@
def show_host(self, hostname):
"""Show detail information for the host."""
- resp, body = self.get("os-hosts/%s" % str(hostname))
+ resp, body = self.get("os-hosts/%s" % hostname)
body = json.loads(body)
self.validate_response(schema.get_host_detail, resp, body)
return service_client.ResponseBodyList(resp, body['host'])
@@ -52,7 +52,7 @@
request_body.update(**kwargs)
request_body = json.dumps(request_body)
- resp, body = self.put("os-hosts/%s" % str(hostname), request_body)
+ resp, body = self.put("os-hosts/%s" % hostname, request_body)
body = json.loads(body)
self.validate_response(schema.update_host, resp, body)
return service_client.ResponseBody(resp, body)
@@ -60,7 +60,7 @@
def startup_host(self, hostname):
"""Startup a host."""
- resp, body = self.get("os-hosts/%s/startup" % str(hostname))
+ resp, body = self.get("os-hosts/%s/startup" % hostname)
body = json.loads(body)
self.validate_response(schema.startup_host, resp, body)
return service_client.ResponseBody(resp, body['host'])
@@ -68,7 +68,7 @@
def shutdown_host(self, hostname):
"""Shutdown a host."""
- resp, body = self.get("os-hosts/%s/shutdown" % str(hostname))
+ resp, body = self.get("os-hosts/%s/shutdown" % hostname)
body = json.loads(body)
self.validate_response(schema.shutdown_host, resp, body)
return service_client.ResponseBody(resp, body['host'])
@@ -76,7 +76,7 @@
def reboot_host(self, hostname):
"""reboot a host."""
- resp, body = self.get("os-hosts/%s/reboot" % str(hostname))
+ resp, body = self.get("os-hosts/%s/reboot" % hostname)
body = json.loads(body)
self.validate_response(schema.reboot_host, resp, body)
return service_client.ResponseBody(resp, body['host'])
diff --git a/tempest/services/compute/json/hypervisor_client.py b/tempest/services/compute/json/hypervisor_client.py
index 2f9f701..865c5bc 100644
--- a/tempest/services/compute/json/hypervisor_client.py
+++ b/tempest/services/compute/json/hypervisor_client.py
@@ -19,7 +19,7 @@
from tempest.common import service_client
-class HypervisorClientJSON(service_client.ServiceClient):
+class HypervisorClient(service_client.ServiceClient):
def list_hypervisors(self, detail=False):
"""List hypervisors information."""
diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py
index 30aa962..9ce2eef 100644
--- a/tempest/services/compute/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -23,7 +23,7 @@
from tempest.common import waiters
-class ImagesClientJSON(service_client.ServiceClient):
+class ImagesClient(service_client.ServiceClient):
def create_image(self, server_id, name, meta=None):
"""Creates an image of the original server."""
@@ -38,36 +38,30 @@
post_body['createImage']['metadata'] = meta
post_body = json.dumps(post_body)
- resp, body = self.post('servers/%s/action' % str(server_id),
+ resp, body = self.post('servers/%s/action' % server_id,
post_body)
self.validate_response(schema.create_image, resp, body)
return service_client.ResponseBody(resp, body)
- def list_images(self, params=None):
+ def list_images(self, detail=False, **params):
"""Returns a list of all images filtered by any parameters."""
url = 'images'
+ _schema = schema.list_images
+ if detail:
+ url += '/detail'
+ _schema = schema.list_images_details
+
if params:
url += '?%s' % urllib.urlencode(params)
resp, body = self.get(url)
body = json.loads(body)
- self.validate_response(schema.list_images, resp, body)
- return service_client.ResponseBodyList(resp, body['images'])
-
- def list_images_with_detail(self, params=None):
- """Returns a detailed list of images filtered by any parameters."""
- url = 'images/detail'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_images_details, resp, body)
+ self.validate_response(_schema, resp, body)
return service_client.ResponseBodyList(resp, body['images'])
def show_image(self, image_id):
"""Returns the details of a single image."""
- resp, body = self.get("images/%s" % str(image_id))
+ resp, body = self.get("images/%s" % image_id)
self.expected_success(200, resp.status)
body = json.loads(body)
self.validate_response(schema.get_image, resp, body)
@@ -75,7 +69,7 @@
def delete_image(self, image_id):
"""Deletes the provided image."""
- resp, body = self.delete("images/%s" % str(image_id))
+ resp, body = self.delete("images/%s" % image_id)
self.validate_response(schema.delete, resp, body)
return service_client.ResponseBody(resp, body)
@@ -85,7 +79,7 @@
def list_image_metadata(self, image_id):
"""Lists all metadata items for an image."""
- resp, body = self.get("images/%s/metadata" % str(image_id))
+ resp, body = self.get("images/%s/metadata" % image_id)
body = json.loads(body)
self.validate_response(schema.image_metadata, resp, body)
return service_client.ResponseBody(resp, body['metadata'])
@@ -93,7 +87,7 @@
def set_image_metadata(self, image_id, meta):
"""Sets the metadata for an image."""
post_body = json.dumps({'metadata': meta})
- resp, body = self.put('images/%s/metadata' % str(image_id), post_body)
+ resp, body = self.put('images/%s/metadata' % image_id, post_body)
body = json.loads(body)
self.validate_response(schema.image_metadata, resp, body)
return service_client.ResponseBody(resp, body['metadata'])
@@ -101,14 +95,14 @@
def update_image_metadata(self, image_id, meta):
"""Updates the metadata for an image."""
post_body = json.dumps({'metadata': meta})
- resp, body = self.post('images/%s/metadata' % str(image_id), post_body)
+ resp, body = self.post('images/%s/metadata' % image_id, post_body)
body = json.loads(body)
self.validate_response(schema.image_metadata, resp, body)
return service_client.ResponseBody(resp, body['metadata'])
- def get_image_metadata_item(self, image_id, key):
+ def show_image_metadata_item(self, image_id, key):
"""Returns the value for a specific image metadata key."""
- resp, body = self.get("images/%s/metadata/%s" % (str(image_id), key))
+ resp, body = self.get("images/%s/metadata/%s" % (image_id, key))
body = json.loads(body)
self.validate_response(schema.image_meta_item, resp, body)
return service_client.ResponseBody(resp, body['meta'])
@@ -116,7 +110,7 @@
def set_image_metadata_item(self, image_id, key, meta):
"""Sets the value for a specific image metadata key."""
post_body = json.dumps({'meta': meta})
- resp, body = self.put('images/%s/metadata/%s' % (str(image_id), key),
+ resp, body = self.put('images/%s/metadata/%s' % (image_id, key),
post_body)
body = json.loads(body)
self.validate_response(schema.image_meta_item, resp, body)
@@ -125,7 +119,7 @@
def delete_image_metadata_item(self, image_id, key):
"""Deletes a single image metadata key/value pair."""
resp, body = self.delete("images/%s/metadata/%s" %
- (str(image_id), key))
+ (image_id, key))
self.validate_response(schema.delete, resp, body)
return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/instance_usage_audit_log_client.py b/tempest/services/compute/json/instance_usage_audit_log_client.py
index 33ba76f..c0841bf 100644
--- a/tempest/services/compute/json/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/json/instance_usage_audit_log_client.py
@@ -20,7 +20,7 @@
from tempest.common import service_client
-class InstanceUsagesAuditLogClientJSON(service_client.ServiceClient):
+class InstanceUsagesAuditLogClient(service_client.ServiceClient):
def list_instance_usage_audit_logs(self):
url = 'os-instance_usage_audit_log'
@@ -31,7 +31,7 @@
return service_client.ResponseBody(resp,
body["instance_usage_audit_logs"])
- def get_instance_usage_audit_log(self, time_before):
+ def show_instance_usage_audit_log(self, time_before):
url = 'os-instance_usage_audit_log/%s' % time_before
resp, body = self.get(url)
body = json.loads(body)
diff --git a/tempest/services/compute/json/interfaces_client.py b/tempest/services/compute/json/interfaces_client.py
index 223e90b..9d6c9d4 100644
--- a/tempest/services/compute/json/interfaces_client.py
+++ b/tempest/services/compute/json/interfaces_client.py
@@ -22,7 +22,7 @@
from tempest import exceptions
-class InterfacesClientJSON(service_client.ServiceClient):
+class InterfacesClient(service_client.ServiceClient):
def list_interfaces(self, server):
resp, body = self.get('servers/%s/os-interface' % server)
@@ -89,7 +89,7 @@
'networkId': network_id
}
})
- resp, body = self.post('servers/%s/action' % str(server_id),
+ resp, body = self.post('servers/%s/action' % server_id,
post_body)
self.validate_response(servers_schema.server_actions_common_schema,
resp, body)
@@ -102,7 +102,7 @@
'address': ip_address
}
})
- resp, body = self.post('servers/%s/action' % str(server_id),
+ resp, body = self.post('servers/%s/action' % server_id,
post_body)
self.validate_response(servers_schema.server_actions_common_schema,
resp, body)
diff --git a/tempest/services/compute/json/keypairs_client.py b/tempest/services/compute/json/keypairs_client.py
index 7fe335b..ba8b1e2 100644
--- a/tempest/services/compute/json/keypairs_client.py
+++ b/tempest/services/compute/json/keypairs_client.py
@@ -19,7 +19,7 @@
from tempest.common import service_client
-class KeyPairsClientJSON(service_client.ServiceClient):
+class KeyPairsClient(service_client.ServiceClient):
def list_keypairs(self):
resp, body = self.get("os-keypairs")
@@ -32,8 +32,8 @@
self.validate_response(schema.list_keypairs, resp, body)
return service_client.ResponseBodyList(resp, body['keypairs'])
- def get_keypair(self, key_name):
- resp, body = self.get("os-keypairs/%s" % str(key_name))
+ def show_keypair(self, key_name):
+ resp, body = self.get("os-keypairs/%s" % key_name)
body = json.loads(body)
self.validate_response(schema.get_keypair, resp, body)
return service_client.ResponseBody(resp, body['keypair'])
@@ -49,6 +49,6 @@
return service_client.ResponseBody(resp, body['keypair'])
def delete_keypair(self, key_name):
- resp, body = self.delete("os-keypairs/%s" % str(key_name))
+ resp, body = self.delete("os-keypairs/%s" % key_name)
self.validate_response(schema.delete_keypair, resp, body)
return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/limits_client.py b/tempest/services/compute/json/limits_client.py
index 1454b73..bfa340c 100644
--- a/tempest/services/compute/json/limits_client.py
+++ b/tempest/services/compute/json/limits_client.py
@@ -19,7 +19,7 @@
from tempest.common import service_client
-class LimitsClientJSON(service_client.ServiceClient):
+class LimitsClient(service_client.ServiceClient):
def show_limits(self):
resp, body = self.get("limits")
diff --git a/tempest/services/compute/json/migrations_client.py b/tempest/services/compute/json/migrations_client.py
index f708a07..cd04e45 100644
--- a/tempest/services/compute/json/migrations_client.py
+++ b/tempest/services/compute/json/migrations_client.py
@@ -20,7 +20,7 @@
from tempest.common import service_client
-class MigrationsClientJSON(service_client.ServiceClient):
+class MigrationsClient(service_client.ServiceClient):
def list_migrations(self, params=None):
"""Lists all migrations."""
diff --git a/tempest/services/compute/json/networks_client.py b/tempest/services/compute/json/networks_client.py
index e641787..cf9f534 100644
--- a/tempest/services/compute/json/networks_client.py
+++ b/tempest/services/compute/json/networks_client.py
@@ -18,7 +18,7 @@
from tempest.common import service_client
-class NetworksClientJSON(service_client.ServiceClient):
+class NetworksClient(service_client.ServiceClient):
def list_networks(self):
resp, body = self.get("os-networks")
@@ -27,7 +27,7 @@
return service_client.ResponseBodyList(resp, body['networks'])
def show_network(self, network_id):
- resp, body = self.get("os-networks/%s" % str(network_id))
+ resp, body = self.get("os-networks/%s" % network_id)
body = json.loads(body)
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body['network'])
diff --git a/tempest/services/compute/json/quota_classes_client.py b/tempest/services/compute/json/quota_classes_client.py
index 6c43679..a741be4 100644
--- a/tempest/services/compute/json/quota_classes_client.py
+++ b/tempest/services/compute/json/quota_classes_client.py
@@ -20,12 +20,12 @@
from tempest.common import service_client
-class QuotaClassesClientJSON(service_client.ServiceClient):
+class QuotaClassesClient(service_client.ServiceClient):
- def get_quota_class_set(self, quota_class_id):
+ def show_quota_class_set(self, quota_class_id):
"""List the quota class set for a quota class."""
- url = 'os-quota-class-sets/%s' % str(quota_class_id)
+ url = 'os-quota-class-sets/%s' % quota_class_id
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(classes_schema.get_quota_class_set, resp, body)
@@ -37,7 +37,7 @@
"""
post_body = json.dumps({'quota_class_set': kwargs})
- resp, body = self.put('os-quota-class-sets/%s' % str(quota_class_id),
+ resp, body = self.put('os-quota-class-sets/%s' % quota_class_id,
post_body)
body = json.loads(body)
diff --git a/tempest/services/compute/json/quotas_client.py b/tempest/services/compute/json/quotas_client.py
index 92a1fe7..b038508 100644
--- a/tempest/services/compute/json/quotas_client.py
+++ b/tempest/services/compute/json/quotas_client.py
@@ -19,23 +19,23 @@
from tempest.common import service_client
-class QuotasClientJSON(service_client.ServiceClient):
+class QuotasClient(service_client.ServiceClient):
- def get_quota_set(self, tenant_id, user_id=None):
+ def show_quota_set(self, tenant_id, user_id=None):
"""List the quota set for a tenant."""
- url = 'os-quota-sets/%s' % str(tenant_id)
+ url = 'os-quota-sets/%s' % tenant_id
if user_id:
- url += '?user_id=%s' % str(user_id)
+ url += '?user_id=%s' % user_id
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.get_quota_set, resp, body)
return service_client.ResponseBody(resp, body['quota_set'])
- def get_default_quota_set(self, tenant_id):
+ def show_default_quota_set(self, tenant_id):
"""List the default quota set for a tenant."""
- url = 'os-quota-sets/%s/defaults' % str(tenant_id)
+ url = 'os-quota-sets/%s/defaults' % tenant_id
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.get_quota_set, resp, body)
@@ -97,9 +97,9 @@
if user_id:
resp, body = self.put('os-quota-sets/%s?user_id=%s' %
- (str(tenant_id), str(user_id)), post_body)
+ (tenant_id, user_id), post_body)
else:
- resp, body = self.put('os-quota-sets/%s' % str(tenant_id),
+ resp, body = self.put('os-quota-sets/%s' % tenant_id,
post_body)
body = json.loads(body)
@@ -108,6 +108,6 @@
def delete_quota_set(self, tenant_id):
"""Delete the tenant's quota set."""
- resp, body = self.delete('os-quota-sets/%s' % str(tenant_id))
+ resp, body = self.delete('os-quota-sets/%s' % tenant_id)
self.validate_response(schema.delete_quota, resp, body)
return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/compute/json/security_group_default_rules_client.py b/tempest/services/compute/json/security_group_default_rules_client.py
index 3bf3263..304e759 100644
--- a/tempest/services/compute/json/security_group_default_rules_client.py
+++ b/tempest/services/compute/json/security_group_default_rules_client.py
@@ -20,7 +20,7 @@
from tempest.common import service_client
-class SecurityGroupDefaultRulesClientJSON(service_client.ServiceClient):
+class SecurityGroupDefaultRulesClient(service_client.ServiceClient):
def create_security_default_group_rule(self, ip_protocol, from_port,
to_port, **kwargs):
@@ -49,7 +49,7 @@
def delete_security_group_default_rule(self,
security_group_default_rule_id):
"""Deletes the provided Security Group default rule."""
- resp, body = self.delete('os-security-group-default-rules/%s' % str(
+ resp, body = self.delete('os-security-group-default-rules/%s' % (
security_group_default_rule_id))
self.validate_response(schema.delete_security_group_default_rule,
resp, body)
@@ -64,10 +64,10 @@
rules = body['security_group_default_rules']
return service_client.ResponseBodyList(resp, rules)
- def get_security_group_default_rule(self, security_group_default_rule_id):
+ def show_security_group_default_rule(self, security_group_default_rule_id):
"""Return the details of provided Security Group default rule."""
- resp, body = self.get('os-security-group-default-rules/%s' % str(
- security_group_default_rule_id))
+ resp, body = self.get('os-security-group-default-rules/%s' %
+ security_group_default_rule_id)
body = json.loads(body)
self.validate_response(schema.create_get_security_group_default_rule,
resp, body)
diff --git a/tempest/services/compute/json/security_groups_client.py b/tempest/services/compute/json/security_groups_client.py
index 2855e13..ca4f9bc 100644
--- a/tempest/services/compute/json/security_groups_client.py
+++ b/tempest/services/compute/json/security_groups_client.py
@@ -22,7 +22,7 @@
from tempest.common import service_client
-class SecurityGroupsClientJSON(service_client.ServiceClient):
+class SecurityGroupsClient(service_client.ServiceClient):
def list_security_groups(self, params=None):
"""List all security groups for a user."""
@@ -36,9 +36,9 @@
self.validate_response(schema.list_security_groups, resp, body)
return service_client.ResponseBodyList(resp, body['security_groups'])
- def get_security_group(self, security_group_id):
+ def show_security_group(self, security_group_id):
"""Get the details of a Security Group."""
- url = "os-security-groups/%s" % str(security_group_id)
+ url = "os-security-groups/%s" % security_group_id
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.get_security_group, resp, body)
@@ -74,7 +74,7 @@
if description:
post_body['description'] = description
post_body = json.dumps({'security_group': post_body})
- resp, body = self.put('os-security-groups/%s' % str(security_group_id),
+ resp, body = self.put('os-security-groups/%s' % security_group_id,
post_body)
body = json.loads(body)
self.validate_response(schema.update_security_group, resp, body)
@@ -83,7 +83,7 @@
def delete_security_group(self, security_group_id):
"""Deletes the provided Security Group."""
resp, body = self.delete(
- 'os-security-groups/%s' % str(security_group_id))
+ 'os-security-groups/%s' % security_group_id)
self.validate_response(schema.delete_security_group, resp, body)
return service_client.ResponseBody(resp, body)
@@ -117,7 +117,7 @@
def delete_security_group_rule(self, group_rule_id):
"""Deletes the provided Security Group rule."""
resp, body = self.delete('os-security-group-rules/%s' %
- str(group_rule_id))
+ group_rule_id)
self.validate_response(schema.delete_security_group_rule, resp, body)
return service_client.ResponseBody(resp, body)
@@ -133,7 +133,7 @@
def is_resource_deleted(self, id):
try:
- self.get_security_group(id)
+ self.show_security_group(id)
except lib_exc.NotFound:
return True
return False
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index 1af1b37..2ecb2d4 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -26,11 +26,11 @@
from tempest import exceptions
-class ServersClientJSON(service_client.ServiceClient):
+class ServersClient(service_client.ServiceClient):
def __init__(self, auth_provider, service, region,
enable_instance_password=True, **kwargs):
- super(ServersClientJSON, self).__init__(
+ super(ServersClient, self).__init__(
auth_provider, service, region, **kwargs)
self.enable_instance_password = enable_instance_password
@@ -131,21 +131,21 @@
post_body['OS-DCF:diskConfig'] = disk_config
post_body = json.dumps({'server': post_body})
- resp, body = self.put("servers/%s" % str(server_id), post_body)
+ resp, body = self.put("servers/%s" % server_id, post_body)
body = json.loads(body)
self.validate_response(schema.update_server, resp, body)
return service_client.ResponseBody(resp, body['server'])
- def get_server(self, server_id):
+ def show_server(self, server_id):
"""Returns the details of an existing server."""
- resp, body = self.get("servers/%s" % str(server_id))
+ resp, body = self.get("servers/%s" % server_id)
body = json.loads(body)
self.validate_response(schema.get_server, resp, body)
return service_client.ResponseBody(resp, body['server'])
def delete_server(self, server_id):
"""Deletes the given server."""
- resp, body = self.delete("servers/%s" % str(server_id))
+ resp, body = self.delete("servers/%s" % server_id)
self.validate_response(schema.delete_server, resp, body)
return service_client.ResponseBody(resp, body)
@@ -186,7 +186,7 @@
start_time = int(time.time())
while True:
try:
- body = self.get_server(server_id)
+ body = self.show_server(server_id)
except lib_exc.NotFound:
return
@@ -201,7 +201,7 @@
def list_addresses(self, server_id):
"""Lists all addresses for a server."""
- resp, body = self.get("servers/%s/ips" % str(server_id))
+ resp, body = self.get("servers/%s/ips" % server_id)
body = json.loads(body)
self.validate_response(schema.list_addresses, resp, body)
return service_client.ResponseBody(resp, body['addresses'])
@@ -209,7 +209,7 @@
def list_addresses_by_network(self, server_id, network_id):
"""Lists all addresses of a specific network type for a server."""
resp, body = self.get("servers/%s/ips/%s" %
- (str(server_id), network_id))
+ (server_id, network_id))
body = json.loads(body)
self.validate_response(schema.list_addresses_by_network, resp, body)
return service_client.ResponseBody(resp, body)
@@ -218,7 +218,7 @@
schema=schema.server_actions_common_schema,
response_class=service_client.ResponseBody, **kwargs):
post_body = json.dumps({action_name: kwargs})
- resp, body = self.post('servers/%s/action' % str(server_id),
+ resp, body = self.post('servers/%s/action' % server_id,
post_body)
if response_key is not None:
body = json.loads(body)
@@ -250,7 +250,7 @@
def get_password(self, server_id):
resp, body = self.get("servers/%s/os-server-password" %
- str(server_id))
+ server_id)
body = json.loads(body)
self.validate_response(schema.get_password, resp, body)
return service_client.ResponseBody(resp, body)
@@ -262,7 +262,7 @@
password.
"""
resp, body = self.delete("servers/%s/os-server-password" %
- str(server_id))
+ server_id)
self.validate_response(schema.server_actions_delete_password,
resp, body)
return service_client.ResponseBody(resp, body)
@@ -303,7 +303,7 @@
return self.action(server_id, 'revertResize', None, **kwargs)
def list_server_metadata(self, server_id):
- resp, body = self.get("servers/%s/metadata" % str(server_id))
+ resp, body = self.get("servers/%s/metadata" % server_id)
body = json.loads(body)
self.validate_response(schema.list_server_metadata, resp, body)
return service_client.ResponseBody(resp, body['metadata'])
@@ -313,7 +313,7 @@
post_body = ""
else:
post_body = json.dumps({'metadata': meta})
- resp, body = self.put('servers/%s/metadata' % str(server_id),
+ resp, body = self.put('servers/%s/metadata' % server_id,
post_body)
body = json.loads(body)
self.validate_response(schema.set_server_metadata, resp, body)
@@ -321,7 +321,7 @@
def update_server_metadata(self, server_id, meta):
post_body = json.dumps({'metadata': meta})
- resp, body = self.post('servers/%s/metadata' % str(server_id),
+ resp, body = self.post('servers/%s/metadata' % server_id,
post_body)
body = json.loads(body)
self.validate_response(schema.update_server_metadata,
@@ -329,7 +329,7 @@
return service_client.ResponseBody(resp, body['metadata'])
def get_server_metadata_item(self, server_id, key):
- resp, body = self.get("servers/%s/metadata/%s" % (str(server_id), key))
+ resp, body = self.get("servers/%s/metadata/%s" % (server_id, key))
body = json.loads(body)
self.validate_response(schema.set_get_server_metadata_item,
resp, body)
@@ -337,7 +337,7 @@
def set_server_metadata_item(self, server_id, key, meta):
post_body = json.dumps({'meta': meta})
- resp, body = self.put('servers/%s/metadata/%s' % (str(server_id), key),
+ resp, body = self.put('servers/%s/metadata/%s' % (server_id, key),
post_body)
body = json.loads(body)
self.validate_response(schema.set_get_server_metadata_item,
@@ -346,7 +346,7 @@
def delete_server_metadata_item(self, server_id, key):
resp, body = self.delete("servers/%s/metadata/%s" %
- (str(server_id), key))
+ (server_id, key))
self.validate_response(schema.delete_server_metadata_item,
resp, body)
return service_client.ResponseBody(resp, body)
@@ -381,7 +381,7 @@
def get_volume_attachment(self, server_id, attach_id):
"""Return details about the given volume attachment."""
resp, body = self.get('servers/%s/os-volume_attachments/%s' % (
- str(server_id), attach_id))
+ server_id, attach_id))
body = json.loads(body)
self.validate_response(schema.get_volume_attachment, resp, body)
return service_client.ResponseBody(resp, body['volumeAttachment'])
@@ -389,7 +389,7 @@
def list_volume_attachments(self, server_id):
"""Returns the list of volume attachments for a given instance."""
resp, body = self.get('servers/%s/os-volume_attachments' % (
- str(server_id)))
+ server_id))
body = json.loads(body)
self.validate_response(schema.list_volume_attachments, resp, body)
return service_client.ResponseBodyList(resp, body['volumeAttachments'])
@@ -413,7 +413,7 @@
req_body = json.dumps({'os-migrateLive': migrate_params})
- resp, body = self.post("servers/%s/action" % str(server_id), req_body)
+ resp, body = self.post("servers/%s/action" % server_id, req_body)
self.validate_response(schema.server_actions_common_schema,
resp, body)
return service_client.ResponseBody(resp, body)
@@ -492,13 +492,13 @@
def get_server_diagnostics(self, server_id):
"""Get the usage data for a server."""
- resp, body = self.get("servers/%s/diagnostics" % str(server_id))
+ resp, body = self.get("servers/%s/diagnostics" % server_id)
return service_client.ResponseBody(resp, json.loads(body))
def list_instance_actions(self, server_id):
"""List the provided server action."""
resp, body = self.get("servers/%s/os-instance-actions" %
- str(server_id))
+ server_id)
body = json.loads(body)
self.validate_response(schema.list_instance_actions, resp, body)
return service_client.ResponseBodyList(resp, body['instanceActions'])
@@ -506,7 +506,7 @@
def get_instance_action(self, server_id, request_id):
"""Returns the action details of the provided server."""
resp, body = self.get("servers/%s/os-instance-actions/%s" %
- (str(server_id), str(request_id)))
+ (server_id, request_id))
body = json.loads(body)
self.validate_response(schema.get_instance_action, resp, body)
return service_client.ResponseBody(resp, body['instanceAction'])
@@ -553,7 +553,7 @@
def delete_server_group(self, server_group_id):
"""Delete the given server-group."""
- resp, body = self.delete("os-server-groups/%s" % str(server_group_id))
+ resp, body = self.delete("os-server-groups/%s" % server_group_id)
self.validate_response(schema.delete_server_group, resp, body)
return service_client.ResponseBody(resp, body)
@@ -566,7 +566,7 @@
def get_server_group(self, server_group_id):
"""Get the details of given server_group."""
- resp, body = self.get("os-server-groups/%s" % str(server_group_id))
+ resp, body = self.get("os-server-groups/%s" % server_group_id)
body = json.loads(body)
self.validate_response(schema.create_get_server_group, resp, body)
return service_client.ResponseBody(resp, body['server_group'])
diff --git a/tempest/services/compute/json/services_client.py b/tempest/services/compute/json/services_client.py
index 156ad8d..01f96af 100644
--- a/tempest/services/compute/json/services_client.py
+++ b/tempest/services/compute/json/services_client.py
@@ -22,7 +22,7 @@
from tempest.common import service_client
-class ServicesClientJSON(service_client.ServiceClient):
+class ServicesClient(service_client.ServiceClient):
def list_services(self, params=None):
url = 'os-services'
diff --git a/tempest/services/compute/json/tenant_networks_client.py b/tempest/services/compute/json/tenant_networks_client.py
index 11251f6..b15ebe3 100644
--- a/tempest/services/compute/json/tenant_networks_client.py
+++ b/tempest/services/compute/json/tenant_networks_client.py
@@ -18,7 +18,7 @@
from tempest.common import service_client
-class TenantNetworksClientJSON(service_client.ServiceClient):
+class TenantNetworksClient(service_client.ServiceClient):
def list_tenant_networks(self):
resp, body = self.get("os-tenant-networks")
@@ -26,8 +26,8 @@
self.validate_response(schema.list_tenant_networks, resp, body)
return service_client.ResponseBodyList(resp, body['networks'])
- def get_tenant_network(self, network_id):
- resp, body = self.get("os-tenant-networks/%s" % str(network_id))
+ def show_tenant_network(self, network_id):
+ resp, body = self.get("os-tenant-networks/%s" % network_id)
body = json.loads(body)
self.validate_response(schema.get_tenant_network, resp, body)
return service_client.ResponseBody(resp, body['network'])
diff --git a/tempest/services/compute/json/tenant_usages_client.py b/tempest/services/compute/json/tenant_usages_client.py
index 52f46e2..fac412e 100644
--- a/tempest/services/compute/json/tenant_usages_client.py
+++ b/tempest/services/compute/json/tenant_usages_client.py
@@ -21,7 +21,7 @@
from tempest.common import service_client
-class TenantUsagesClientJSON(service_client.ServiceClient):
+class TenantUsagesClient(service_client.ServiceClient):
def list_tenant_usages(self, params=None):
url = 'os-simple-tenant-usage'
@@ -33,7 +33,7 @@
self.validate_response(schema.list_tenant_usage, resp, body)
return service_client.ResponseBodyList(resp, body['tenant_usages'][0])
- def get_tenant_usage(self, tenant_id, params=None):
+ def show_tenant_usage(self, tenant_id, params=None):
url = 'os-simple-tenant-usage/%s' % tenant_id
if params:
url += '?%s' % urllib.urlencode(params)
diff --git a/tempest/services/compute/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py
index 4d7a7aa..08bb4bc 100644
--- a/tempest/services/compute/json/volumes_extensions_client.py
+++ b/tempest/services/compute/json/volumes_extensions_client.py
@@ -24,17 +24,20 @@
from tempest import exceptions
-class VolumesExtensionsClientJSON(service_client.ServiceClient):
+class VolumesExtensionsClient(service_client.ServiceClient):
def __init__(self, auth_provider, service, region,
default_volume_size=1, **kwargs):
- super(VolumesExtensionsClientJSON, self).__init__(
+ super(VolumesExtensionsClient, self).__init__(
auth_provider, service, region, **kwargs)
self.default_volume_size = default_volume_size
- def list_volumes(self, params=None):
+ def list_volumes(self, detail=False, **params):
"""List all the volumes created."""
url = 'os-volumes'
+
+ if detail:
+ url += '/detail'
if params:
url += '?%s' % urllib.urlencode(params)
@@ -43,20 +46,9 @@
self.validate_response(schema.list_volumes, resp, body)
return service_client.ResponseBodyList(resp, body['volumes'])
- def list_volumes_with_detail(self, params=None):
- """List all the details of volumes."""
- url = 'os-volumes/detail'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_volumes, resp, body)
- return service_client.ResponseBodyList(resp, body['volumes'])
-
- def get_volume(self, volume_id):
+ def show_volume(self, volume_id):
"""Returns the details of a single volume."""
- url = "os-volumes/%s" % str(volume_id)
+ url = "os-volumes/%s" % volume_id
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.create_get_volume, resp, body)
@@ -85,19 +77,19 @@
def delete_volume(self, volume_id):
"""Deletes the Specified Volume."""
- resp, body = self.delete("os-volumes/%s" % str(volume_id))
+ resp, body = self.delete("os-volumes/%s" % volume_id)
self.validate_response(schema.delete_volume, resp, body)
return service_client.ResponseBody(resp, body)
def wait_for_volume_status(self, volume_id, status):
"""Waits for a Volume to reach a given status."""
- body = self.get_volume(volume_id)
+ body = self.show_volume(volume_id)
volume_status = body['status']
start = int(time.time())
while volume_status != status:
time.sleep(self.build_interval)
- body = self.get_volume(volume_id)
+ body = self.show_volume(volume_id)
volume_status = body['status']
if volume_status == 'error':
raise exceptions.VolumeBuildErrorException(volume_id=volume_id)
@@ -111,7 +103,7 @@
def is_resource_deleted(self, id):
try:
- self.get_volume(id)
+ self.show_volume(id)
except lib_exc.NotFound:
return True
return False
diff --git a/tempest/services/database/json/flavors_client.py b/tempest/services/database/json/flavors_client.py
index c956e27..4fe5a46 100644
--- a/tempest/services/database/json/flavors_client.py
+++ b/tempest/services/database/json/flavors_client.py
@@ -18,7 +18,7 @@
from tempest.common import service_client
-class DatabaseFlavorsClientJSON(service_client.ServiceClient):
+class DatabaseFlavorsClient(service_client.ServiceClient):
def list_db_flavors(self, params=None):
url = 'flavors'
diff --git a/tempest/services/database/json/limits_client.py b/tempest/services/database/json/limits_client.py
index f99ceaa..830b67f 100644
--- a/tempest/services/database/json/limits_client.py
+++ b/tempest/services/database/json/limits_client.py
@@ -18,7 +18,7 @@
from tempest.common import service_client
-class DatabaseLimitsClientJSON(service_client.ServiceClient):
+class DatabaseLimitsClient(service_client.ServiceClient):
def list_db_limits(self, params=None):
"""List all limits."""
diff --git a/tempest/services/database/json/versions_client.py b/tempest/services/database/json/versions_client.py
index 0db9c6a..ed1ba81 100644
--- a/tempest/services/database/json/versions_client.py
+++ b/tempest/services/database/json/versions_client.py
@@ -18,14 +18,14 @@
from tempest.common import service_client
-class DatabaseVersionsClientJSON(service_client.ServiceClient):
+class DatabaseVersionsClient(service_client.ServiceClient):
def __init__(self, auth_provider, service, region,
endpoint_type=None, build_interval=None, build_timeout=None,
disable_ssl_certificate_validation=None, ca_certs=None,
trace_requests=None):
dscv = disable_ssl_certificate_validation
- super(DatabaseVersionsClientJSON, self).__init__(
+ super(DatabaseVersionsClient, self).__init__(
auth_provider, service, region,
endpoint_type=endpoint_type,
build_interval=build_interval,
diff --git a/tempest/services/identity/v2/json/identity_client.py b/tempest/services/identity/v2/json/identity_client.py
index c5f7338..fd4160f 100644
--- a/tempest/services/identity/v2/json/identity_client.py
+++ b/tempest/services/identity/v2/json/identity_client.py
@@ -16,7 +16,8 @@
from tempest.common import service_client
-class IdentityClientJSON(service_client.ServiceClient):
+class IdentityClient(service_client.ServiceClient):
+ api_version = "v2.0"
def get_api_description(self):
"""Retrieves info about the v2.0 Identity API"""
diff --git a/tempest/services/identity/v3/json/credentials_client.py b/tempest/services/identity/v3/json/credentials_client.py
index 0a614cd..281f3cd 100644
--- a/tempest/services/identity/v3/json/credentials_client.py
+++ b/tempest/services/identity/v3/json/credentials_client.py
@@ -18,7 +18,7 @@
from tempest.common import service_client
-class CredentialsClientJSON(service_client.ServiceClient):
+class CredentialsClient(service_client.ServiceClient):
api_version = "v3"
def create_credential(self, access_key, secret_key, user_id, project_id):
diff --git a/tempest/services/identity/v3/json/endpoints_client.py b/tempest/services/identity/v3/json/endpoints_client.py
index 5b7e812..44acb47 100644
--- a/tempest/services/identity/v3/json/endpoints_client.py
+++ b/tempest/services/identity/v3/json/endpoints_client.py
@@ -18,7 +18,7 @@
from tempest.common import service_client
-class EndPointClientJSON(service_client.ServiceClient):
+class EndPointClient(service_client.ServiceClient):
api_version = "v3"
def list_endpoints(self):
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index 30fb3e1..d8afd2c 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -20,7 +20,7 @@
from tempest.common import service_client
-class IdentityV3ClientJSON(service_client.ServiceClient):
+class IdentityV3Client(service_client.ServiceClient):
api_version = "v3"
def get_api_description(self):
diff --git a/tempest/services/identity/v3/json/policy_client.py b/tempest/services/identity/v3/json/policy_client.py
index 8c9c9ce..424fb1d 100644
--- a/tempest/services/identity/v3/json/policy_client.py
+++ b/tempest/services/identity/v3/json/policy_client.py
@@ -18,7 +18,7 @@
from tempest.common import service_client
-class PolicyClientJSON(service_client.ServiceClient):
+class PolicyClient(service_client.ServiceClient):
api_version = "v3"
def create_policy(self, blob, type):
diff --git a/tempest/services/identity/v3/json/region_client.py b/tempest/services/identity/v3/json/region_client.py
index 02df354..9d7d496 100644
--- a/tempest/services/identity/v3/json/region_client.py
+++ b/tempest/services/identity/v3/json/region_client.py
@@ -20,7 +20,7 @@
from tempest.common import service_client
-class RegionClientJSON(service_client.ServiceClient):
+class RegionClient(service_client.ServiceClient):
api_version = "v3"
def create_region(self, description, **kwargs):
diff --git a/tempest/services/identity/v3/json/service_client.py b/tempest/services/identity/v3/json/service_client.py
index e039dc6..c678918 100644
--- a/tempest/services/identity/v3/json/service_client.py
+++ b/tempest/services/identity/v3/json/service_client.py
@@ -18,7 +18,7 @@
from tempest.common import service_client
-class ServiceClientJSON(service_client.ServiceClient):
+class ServiceClient(service_client.ServiceClient):
api_version = "v3"
def update_service(self, service_id, **kwargs):
diff --git a/tempest/services/image/v1/json/image_client.py b/tempest/services/image/v1/json/image_client.py
index add26a9..eae5c64 100644
--- a/tempest/services/image/v1/json/image_client.py
+++ b/tempest/services/image/v1/json/image_client.py
@@ -32,13 +32,13 @@
LOG = logging.getLogger(__name__)
-class ImageClientJSON(service_client.ServiceClient):
+class ImageClient(service_client.ServiceClient):
def __init__(self, auth_provider, catalog_type, region, endpoint_type=None,
build_interval=None, build_timeout=None,
disable_ssl_certificate_validation=None,
ca_certs=None, trace_requests=None):
- super(ImageClientJSON, self).__init__(
+ super(ImageClient, self).__init__(
auth_provider,
catalog_type,
region,
diff --git a/tempest/services/image/v2/json/image_client.py b/tempest/services/image/v2/json/image_client.py
index 383c72b..95972ae 100644
--- a/tempest/services/image/v2/json/image_client.py
+++ b/tempest/services/image/v2/json/image_client.py
@@ -23,13 +23,13 @@
from tempest.common import service_client
-class ImageClientV2JSON(service_client.ServiceClient):
+class ImageClientV2(service_client.ServiceClient):
def __init__(self, auth_provider, catalog_type, region, endpoint_type=None,
build_interval=None, build_timeout=None,
disable_ssl_certificate_validation=None, ca_certs=None,
trace_requests=None):
- super(ImageClientV2JSON, self).__init__(
+ super(ImageClientV2, self).__init__(
auth_provider,
catalog_type,
region,
diff --git a/tempest/services/messaging/json/messaging_client.py b/tempest/services/messaging/json/messaging_client.py
index 5f6c32a..b99e0a7 100644
--- a/tempest/services/messaging/json/messaging_client.py
+++ b/tempest/services/messaging/json/messaging_client.py
@@ -22,14 +22,14 @@
from tempest.common import service_client
-class MessagingClientJSON(service_client.ServiceClient):
+class MessagingClient(service_client.ServiceClient):
def __init__(self, auth_provider, service, region,
endpoint_type=None, build_interval=None, build_timeout=None,
disable_ssl_certificate_validation=None, ca_certs=None,
trace_requests=None):
dscv = disable_ssl_certificate_validation
- super(MessagingClientJSON, self).__init__(
+ super(MessagingClient, self).__init__(
auth_provider, service, region,
endpoint_type=endpoint_type,
build_interval=build_interval,
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index e93cc47..13449ea 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -21,7 +21,7 @@
from tempest import exceptions
-class NetworkClientJSON(service_client.ServiceClient):
+class NetworkClient(service_client.ServiceClient):
"""
Tempest REST client for Neutron. Uses v2 of the Neutron API, since the
@@ -42,34 +42,18 @@
def get_uri(self, plural_name):
# get service prefix from resource name
- # The following list represents resource names that do not require
- # changing underscore to a hyphen
- hyphen_exceptions = ["health_monitors", "firewall_rules",
- "firewall_policies"]
# the following map is used to construct proper URI
# for the given neutron resource
service_resource_prefix_map = {
'networks': '',
'subnets': '',
'ports': '',
- 'pools': 'lb',
- 'vips': 'lb',
- 'health_monitors': 'lb',
- 'members': 'lb',
- 'ipsecpolicies': 'vpn',
- 'vpnservices': 'vpn',
- 'ikepolicies': 'vpn',
- 'ipsec-site-connections': 'vpn',
'metering_labels': 'metering',
'metering_label_rules': 'metering',
- 'firewall_rules': 'fw',
- 'firewall_policies': 'fw',
- 'firewalls': 'fw'
}
service_prefix = service_resource_prefix_map.get(
plural_name)
- if plural_name not in hyphen_exceptions:
- plural_name = plural_name.replace("_", "-")
+ plural_name = plural_name.replace("_", "-")
if service_prefix:
uri = '%s/%s/%s' % (self.uri_prefix, service_prefix,
plural_name)
@@ -85,11 +69,7 @@
resource_plural_map = {
'security_groups': 'security_groups',
'security_group_rules': 'security_group_rules',
- 'ipsecpolicy': 'ipsecpolicies',
- 'ikepolicy': 'ikepolicies',
- 'ipsec_site_connection': 'ipsec-site-connections',
'quotas': 'quotas',
- 'firewall_policy': 'firewall_policies'
}
return resource_plural_map.get(resource_name, resource_name + 's')
@@ -105,69 +85,182 @@
return _list
- def _deleter(self, resource_name):
- def _delete(resource_id):
- plural = self.pluralize(resource_name)
- uri = '%s/%s' % (self.get_uri(plural), resource_id)
- resp, body = self.delete(uri)
- self.expected_success(204, resp.status)
- return service_client.ResponseBody(resp, body)
+ def _delete_resource(self, uri):
+ req_uri = self.uri_prefix + uri
+ resp, body = self.delete(req_uri)
+ self.expected_success(204, resp.status)
+ return service_client.ResponseBody(resp, body)
- return _delete
+ def _show_resource(self, uri, **fields):
+ # fields is a dict which key is 'fields' and value is a
+ # list of field's name. An example:
+ # {'fields': ['id', 'name']}
+ req_uri = self.uri_prefix + uri
+ if fields:
+ req_uri += '?' + urllib.urlencode(fields, doseq=1)
+ resp, body = self.get(req_uri)
+ body = self.deserialize_single(body)
+ self.expected_success(200, resp.status)
+ return service_client.ResponseBody(resp, body)
- def _shower(self, resource_name):
- def _show(resource_id, **fields):
- # fields is a dict which key is 'fields' and value is a
- # list of field's name. An example:
- # {'fields': ['id', 'name']}
- plural = self.pluralize(resource_name)
- uri = '%s/%s' % (self.get_uri(plural), resource_id)
- if fields:
- uri += '?' + urllib.urlencode(fields, doseq=1)
- resp, body = self.get(uri)
- body = self.deserialize_single(body)
- self.expected_success(200, resp.status)
- return service_client.ResponseBody(resp, body)
+ def _create_resource(self, uri, post_data):
+ req_uri = self.uri_prefix + uri
+ req_post_data = self.serialize(post_data)
+ resp, body = self.post(req_uri, req_post_data)
+ body = self.deserialize_single(body)
+ self.expected_success(201, resp.status)
+ return service_client.ResponseBody(resp, body)
- return _show
-
- def _creater(self, resource_name):
- def _create(**kwargs):
- plural = self.pluralize(resource_name)
- uri = self.get_uri(plural)
- post_data = self.serialize({resource_name: kwargs})
- resp, body = self.post(uri, post_data)
- body = self.deserialize_single(body)
- self.expected_success(201, resp.status)
- return service_client.ResponseBody(resp, body)
-
- return _create
-
- def _updater(self, resource_name):
- def _update(res_id, **kwargs):
- plural = self.pluralize(resource_name)
- uri = '%s/%s' % (self.get_uri(plural), res_id)
- post_data = self.serialize({resource_name: kwargs})
- resp, body = self.put(uri, post_data)
- body = self.deserialize_single(body)
- self.expected_success(200, resp.status)
- return service_client.ResponseBody(resp, body)
-
- return _update
+ def _update_resource(self, uri, post_data):
+ req_uri = self.uri_prefix + uri
+ req_post_data = self.serialize(post_data)
+ resp, body = self.put(req_uri, req_post_data)
+ body = self.deserialize_single(body)
+ self.expected_success(200, resp.status)
+ return service_client.ResponseBody(resp, body)
def __getattr__(self, name):
- method_prefixes = ["list_", "delete_", "show_", "create_", "update_"]
- method_functors = [self._lister,
- self._deleter,
- self._shower,
- self._creater,
- self._updater]
+ method_prefixes = ["list_"]
+ method_functors = [self._lister]
for index, prefix in enumerate(method_prefixes):
prefix_len = len(prefix)
if name[:prefix_len] == prefix:
return method_functors[index](name[prefix_len:])
raise AttributeError(name)
+ def create_network(self, **kwargs):
+ uri = '/networks'
+ post_data = {'network': kwargs}
+ return self._create_resource(uri, post_data)
+
+ def update_network(self, network_id, **kwargs):
+ uri = '/networks/%s' % network_id
+ post_data = {'network': kwargs}
+ return self._update_resource(uri, post_data)
+
+ def show_network(self, network_id, **fields):
+ uri = '/networks/%s' % network_id
+ return self._show_resource(uri, **fields)
+
+ def delete_network(self, network_id):
+ uri = '/networks/%s' % network_id
+ return self._delete_resource(uri)
+
+ def create_subnet(self, **kwargs):
+ uri = '/subnets'
+ post_data = {'subnet': kwargs}
+ return self._create_resource(uri, post_data)
+
+ def update_subnet(self, subnet_id, **kwargs):
+ uri = '/subnets/%s' % subnet_id
+ post_data = {'subnet': kwargs}
+ return self._update_resource(uri, post_data)
+
+ def show_subnet(self, subnet_id, **fields):
+ uri = '/subnets/%s' % subnet_id
+ return self._show_resource(uri, **fields)
+
+ def delete_subnet(self, subnet_id):
+ uri = '/subnets/%s' % subnet_id
+ return self._delete_resource(uri)
+
+ def create_port(self, **kwargs):
+ uri = '/ports'
+ post_data = {'port': kwargs}
+ return self._create_resource(uri, post_data)
+
+ def update_port(self, port_id, **kwargs):
+ uri = '/ports/%s' % port_id
+ post_data = {'port': kwargs}
+ return self._update_resource(uri, post_data)
+
+ def show_port(self, port_id, **fields):
+ uri = '/ports/%s' % port_id
+ return self._show_resource(uri, **fields)
+
+ def delete_port(self, port_id):
+ uri = '/ports/%s' % port_id
+ return self._delete_resource(uri)
+
+ def create_floatingip(self, **kwargs):
+ uri = '/floatingips'
+ post_data = {'floatingip': kwargs}
+ return self._create_resource(uri, post_data)
+
+ def update_floatingip(self, floatingip_id, **kwargs):
+ uri = '/floatingips/%s' % floatingip_id
+ post_data = {'floatingip': kwargs}
+ return self._update_resource(uri, post_data)
+
+ def show_floatingip(self, floatingip_id, **fields):
+ uri = '/floatingips/%s' % floatingip_id
+ return self._show_resource(uri, **fields)
+
+ def delete_floatingip(self, floatingip_id):
+ uri = '/floatingips/%s' % floatingip_id
+ return self._delete_resource(uri)
+
+ def create_metering_label(self, **kwargs):
+ uri = '/metering/metering-labels'
+ post_data = {'metering_label': kwargs}
+ return self._create_resource(uri, post_data)
+
+ def show_metering_label(self, metering_label_id, **fields):
+ uri = '/metering/metering-labels/%s' % metering_label_id
+ return self._show_resource(uri, **fields)
+
+ def delete_metering_label(self, metering_label_id):
+ uri = '/metering/metering-labels/%s' % metering_label_id
+ return self._delete_resource(uri)
+
+ def create_metering_label_rule(self, **kwargs):
+ uri = '/metering/metering-label-rules'
+ post_data = {'metering_label_rule': kwargs}
+ return self._create_resource(uri, post_data)
+
+ def show_metering_label_rule(self, metering_label_rule_id, **fields):
+ uri = '/metering/metering-label-rules/%s' % metering_label_rule_id
+ return self._show_resource(uri, **fields)
+
+ def delete_metering_label_rule(self, metering_label_rule_id):
+ uri = '/metering/metering-label-rules/%s' % metering_label_rule_id
+ return self._delete_resource(uri)
+
+ def create_security_group(self, **kwargs):
+ uri = '/security-groups'
+ post_data = {'security_group': kwargs}
+ return self._create_resource(uri, post_data)
+
+ def update_security_group(self, security_group_id, **kwargs):
+ uri = '/security-groups/%s' % security_group_id
+ post_data = {'security_group': kwargs}
+ return self._update_resource(uri, post_data)
+
+ def show_security_group(self, security_group_id, **fields):
+ uri = '/security-groups/%s' % security_group_id
+ return self._show_resource(uri, **fields)
+
+ def delete_security_group(self, security_group_id):
+ uri = '/security-groups/%s' % security_group_id
+ return self._delete_resource(uri)
+
+ def create_security_group_rule(self, **kwargs):
+ uri = '/security-group-rules'
+ post_data = {'security_group_rule': kwargs}
+ return self._create_resource(uri, post_data)
+
+ def show_security_group_rule(self, security_group_rule_id, **fields):
+ uri = '/security-group-rules/%s' % security_group_rule_id
+ return self._show_resource(uri, **fields)
+
+ def delete_security_group_rule(self, security_group_rule_id):
+ uri = '/security-group-rules/%s' % security_group_rule_id
+ return self._delete_resource(uri)
+
+ def show_extension(self, ext_alias, **fields):
+ uri = '/extensions/%s' % ext_alias
+ return self._show_resource(uri, **fields)
+
# Common methods that are hard to automate
def create_bulk_network(self, names):
network_list = [{'name': name} for name in names]
@@ -288,6 +381,10 @@
self.expected_success(204, resp.status)
return service_client.ResponseBody(resp, body)
+ def show_quotas(self, tenant_id, **fields):
+ uri = '/quotas/%s' % tenant_id
+ return self._show_resource(uri, **fields)
+
def create_router(self, name, admin_state_up=True, **kwargs):
post_body = {'router': kwargs}
post_body['router']['name'] = name
@@ -337,6 +434,14 @@
# policy is to restrict enable_snat usage to admins only.
return self._update_router(router_id, set_enable_snat=False, **kwargs)
+ def show_router(self, router_id, **fields):
+ uri = '/routers/%s' % router_id
+ return self._show_resource(uri, **fields)
+
+ def delete_router(self, router_id):
+ uri = '/routers/%s' % router_id
+ return self._delete_resource(uri)
+
def update_router_with_snat_gw_info(self, router_id, **kwargs):
"""Update a router passing also the enable_snat attribute.
@@ -385,29 +490,6 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def associate_health_monitor_with_pool(self, health_monitor_id,
- pool_id):
- post_body = {
- "health_monitor": {
- "id": health_monitor_id,
- }
- }
- body = json.dumps(post_body)
- uri = '%s/lb/pools/%s/health_monitors' % (self.uri_prefix,
- pool_id)
- resp, body = self.post(uri, body)
- self.expected_success(201, resp.status)
- body = json.loads(body)
- return service_client.ResponseBody(resp, body)
-
- def disassociate_health_monitor_with_pool(self, health_monitor_id,
- pool_id):
- uri = '%s/lb/pools/%s/health_monitors/%s' % (self.uri_prefix, pool_id,
- health_monitor_id)
- resp, body = self.delete(uri)
- self.expected_success(204, resp.status)
- return service_client.ResponseBody(resp, body)
-
def list_router_interfaces(self, uuid):
uri = '%s/ports?device_id=%s' % (self.uri_prefix, uuid)
resp, body = self.get(uri)
@@ -428,20 +510,9 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def list_pools_hosted_by_one_lbaas_agent(self, agent_id):
- uri = '%s/agents/%s/loadbalancer-pools' % (self.uri_prefix, agent_id)
- resp, body = self.get(uri)
- self.expected_success(200, resp.status)
- body = json.loads(body)
- return service_client.ResponseBody(resp, body)
-
- def show_lbaas_agent_hosting_pool(self, pool_id):
- uri = ('%s/lb/pools/%s/loadbalancer-agent' %
- (self.uri_prefix, pool_id))
- resp, body = self.get(uri)
- self.expected_success(200, resp.status)
- body = json.loads(body)
- return service_client.ResponseBody(resp, body)
+ def show_agent(self, agent_id, **fields):
+ uri = '/agents/%s' % agent_id
+ return self._show_resource(uri, **fields)
def list_routers_on_l3_agent(self, agent_id):
uri = '%s/agents/%s/l3-routers' % (self.uri_prefix, agent_id)
@@ -494,21 +565,6 @@
self.expected_success(204, resp.status)
return service_client.ResponseBody(resp, body)
- def create_ikepolicy(self, name, **kwargs):
- post_body = {
- "ikepolicy": {
- "name": name,
- }
- }
- for key, val in kwargs.items():
- post_body['ikepolicy'][key] = val
- body = json.dumps(post_body)
- uri = '%s/vpn/ikepolicies' % (self.uri_prefix)
- resp, body = self.post(uri, body)
- self.expected_success(201, resp.status)
- body = json.loads(body)
- return service_client.ResponseBody(resp, body)
-
def update_extra_routes(self, router_id, nexthop, destination):
uri = '%s/routers/%s' % (self.uri_prefix, router_id)
put_body = {
@@ -537,13 +593,6 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def list_lb_pool_stats(self, pool_id):
- uri = '%s/lb/pools/%s/stats' % (self.uri_prefix, pool_id)
- resp, body = self.get(uri)
- self.expected_success(200, resp.status)
- body = json.loads(body)
- return service_client.ResponseBody(resp, body)
-
def add_dhcp_agent_to_network(self, agent_id, network_id):
post_body = {'network_id': network_id}
body = json.dumps(post_body)
@@ -552,30 +601,3 @@
self.expected_success(201, resp.status)
body = json.loads(body)
return service_client.ResponseBody(resp, body)
-
- def insert_firewall_rule_in_policy(self, firewall_policy_id,
- firewall_rule_id, insert_after="",
- insert_before=""):
- uri = '%s/fw/firewall_policies/%s/insert_rule' % (self.uri_prefix,
- firewall_policy_id)
- body = {
- "firewall_rule_id": firewall_rule_id,
- "insert_after": insert_after,
- "insert_before": insert_before
- }
- body = json.dumps(body)
- resp, body = self.put(uri, body)
- self.expected_success(200, resp.status)
- body = json.loads(body)
- return service_client.ResponseBody(resp, body)
-
- def remove_firewall_rule_from_policy(self, firewall_policy_id,
- firewall_rule_id):
- uri = '%s/fw/firewall_policies/%s/remove_rule' % (self.uri_prefix,
- firewall_policy_id)
- update_body = {"firewall_rule_id": firewall_rule_id}
- update_body = json.dumps(update_body)
- resp, body = self.put(uri, update_body)
- self.expected_success(200, resp.status)
- body = json.loads(body)
- return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/telemetry/json/telemetry_client.py b/tempest/services/telemetry/json/telemetry_client.py
index 554f574..2b1cdc0 100644
--- a/tempest/services/telemetry/json/telemetry_client.py
+++ b/tempest/services/telemetry/json/telemetry_client.py
@@ -19,7 +19,7 @@
from tempest.common import service_client
-class TelemetryClientJSON(service_client.ServiceClient):
+class TelemetryClient(service_client.ServiceClient):
version = '2'
uri_prefix = "v2"
diff --git a/tempest/services/volume/json/admin/volume_hosts_client.py b/tempest/services/volume/json/admin/volume_hosts_client.py
index 1dfabaf..260679e 100644
--- a/tempest/services/volume/json/admin/volume_hosts_client.py
+++ b/tempest/services/volume/json/admin/volume_hosts_client.py
@@ -20,7 +20,7 @@
from tempest.common import service_client
-class BaseVolumeHostsClientJSON(service_client.ServiceClient):
+class BaseVolumeHostsClient(service_client.ServiceClient):
"""
Client class to send CRUD Volume Hosts API requests to a Cinder endpoint
"""
@@ -38,7 +38,7 @@
return service_client.ResponseBodyList(resp, body['hosts'])
-class VolumeHostsClientJSON(BaseVolumeHostsClientJSON):
+class VolumeHostsClient(BaseVolumeHostsClient):
"""
Client class to send CRUD Volume Host API V1 requests to a Cinder endpoint
"""
diff --git a/tempest/services/volume/json/admin/volume_quotas_client.py b/tempest/services/volume/json/admin/volume_quotas_client.py
index cbab3f0..a979523 100644
--- a/tempest/services/volume/json/admin/volume_quotas_client.py
+++ b/tempest/services/volume/json/admin/volume_quotas_client.py
@@ -18,7 +18,7 @@
from tempest.common import service_client
-class BaseVolumeQuotasClientJSON(service_client.ServiceClient):
+class BaseVolumeQuotasClient(service_client.ServiceClient):
"""
Client class to send CRUD Volume Quotas API requests to a Cinder endpoint
"""
@@ -75,7 +75,7 @@
return service_client.ResponseBody(resp, body)
-class VolumeQuotasClientJSON(BaseVolumeQuotasClientJSON):
+class VolumeQuotasClient(BaseVolumeQuotasClient):
"""
Client class to send CRUD Volume Type API V1 requests to a Cinder endpoint
"""
diff --git a/tempest/services/volume/json/admin/volume_services_client.py b/tempest/services/volume/json/admin/volume_services_client.py
index 94792e0..2b2a696 100644
--- a/tempest/services/volume/json/admin/volume_services_client.py
+++ b/tempest/services/volume/json/admin/volume_services_client.py
@@ -20,7 +20,7 @@
from tempest.common import service_client
-class BaseVolumesServicesClientJSON(service_client.ServiceClient):
+class BaseVolumesServicesClient(service_client.ServiceClient):
def list_services(self, params=None):
url = 'os-services'
@@ -33,5 +33,5 @@
return service_client.ResponseBodyList(resp, body['services'])
-class VolumesServicesClientJSON(BaseVolumesServicesClientJSON):
+class VolumesServicesClient(BaseVolumesServicesClient):
"""Volume V1 volume services client"""
diff --git a/tempest/services/volume/json/admin/volume_types_client.py b/tempest/services/volume/json/admin/volume_types_client.py
index 2436d88..9a75f6c 100644
--- a/tempest/services/volume/json/admin/volume_types_client.py
+++ b/tempest/services/volume/json/admin/volume_types_client.py
@@ -21,7 +21,7 @@
from tempest.common import service_client
-class BaseVolumeTypesClientJSON(service_client.ServiceClient):
+class BaseVolumeTypesClient(service_client.ServiceClient):
"""
Client class to send CRUD Volume Types API requests to a Cinder endpoint
"""
@@ -188,5 +188,5 @@
return service_client.ResponseBody(resp, body)
-class VolumeTypesClientJSON(BaseVolumeTypesClientJSON):
+class VolumeTypesClient(BaseVolumeTypesClient):
"""Volume V1 Volume Types client"""
diff --git a/tempest/services/volume/json/availability_zone_client.py b/tempest/services/volume/json/availability_zone_client.py
index dc0388f..e60d5c1 100644
--- a/tempest/services/volume/json/availability_zone_client.py
+++ b/tempest/services/volume/json/availability_zone_client.py
@@ -18,7 +18,7 @@
from tempest.common import service_client
-class BaseVolumeAvailabilityZoneClientJSON(service_client.ServiceClient):
+class BaseVolumeAvailabilityZoneClient(service_client.ServiceClient):
def list_availability_zones(self):
resp, body = self.get('os-availability-zone')
@@ -27,7 +27,7 @@
return service_client.ResponseBody(resp, body['availabilityZoneInfo'])
-class VolumeAvailabilityZoneClientJSON(BaseVolumeAvailabilityZoneClientJSON):
+class VolumeAvailabilityZoneClient(BaseVolumeAvailabilityZoneClient):
"""
Volume V1 availability zone client.
"""
diff --git a/tempest/services/volume/json/backups_client.py b/tempest/services/volume/json/backups_client.py
index 83ec182..bf9af6e 100644
--- a/tempest/services/volume/json/backups_client.py
+++ b/tempest/services/volume/json/backups_client.py
@@ -20,7 +20,7 @@
from tempest import exceptions
-class BaseBackupsClientJSON(service_client.ServiceClient):
+class BaseBackupsClient(service_client.ServiceClient):
"""
Client class to send CRUD Volume backup API requests to a Cinder endpoint
"""
@@ -95,5 +95,5 @@
raise exceptions.TimeoutException(message)
-class BackupsClientJSON(BaseBackupsClientJSON):
+class BackupsClient(BaseBackupsClient):
"""Volume V1 Backups client"""
diff --git a/tempest/services/volume/json/extensions_client.py b/tempest/services/volume/json/extensions_client.py
index 8a7bce7..3bf468a 100644
--- a/tempest/services/volume/json/extensions_client.py
+++ b/tempest/services/volume/json/extensions_client.py
@@ -18,7 +18,7 @@
from tempest.common import service_client
-class BaseExtensionsClientJSON(service_client.ServiceClient):
+class BaseExtensionsClient(service_client.ServiceClient):
def list_extensions(self):
url = 'extensions'
@@ -28,7 +28,7 @@
return service_client.ResponseBodyList(resp, body['extensions'])
-class ExtensionsClientJSON(BaseExtensionsClientJSON):
+class ExtensionsClient(BaseExtensionsClient):
"""
Volume V1 extensions client.
"""
diff --git a/tempest/services/volume/json/qos_client.py b/tempest/services/volume/json/qos_client.py
index e9d3777..37ab9cd 100644
--- a/tempest/services/volume/json/qos_client.py
+++ b/tempest/services/volume/json/qos_client.py
@@ -21,7 +21,7 @@
from tempest import exceptions
-class BaseQosSpecsClientJSON(service_client.ServiceClient):
+class BaseQosSpecsClient(service_client.ServiceClient):
"""Client class to send CRUD QoS API requests"""
def is_resource_deleted(self, qos_id):
@@ -157,5 +157,5 @@
return service_client.ResponseBody(resp, body)
-class QosSpecsClientJSON(BaseQosSpecsClientJSON):
+class QosSpecsClient(BaseQosSpecsClient):
"""Volume V1 QoS client."""
diff --git a/tempest/services/volume/json/snapshots_client.py b/tempest/services/volume/json/snapshots_client.py
index cfa02bd..7f7cceb 100644
--- a/tempest/services/volume/json/snapshots_client.py
+++ b/tempest/services/volume/json/snapshots_client.py
@@ -24,7 +24,7 @@
LOG = logging.getLogger(__name__)
-class BaseSnapshotsClientJSON(service_client.ServiceClient):
+class BaseSnapshotsClient(service_client.ServiceClient):
"""Base Client class to send CRUD Volume API requests."""
create_resp = 200
@@ -198,5 +198,5 @@
return service_client.ResponseBody(resp, body)
-class SnapshotsClientJSON(BaseSnapshotsClientJSON):
+class SnapshotsClient(BaseSnapshotsClient):
"""Client class to send CRUD Volume V1 API requests."""
diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py
index 65aa0f4..1f8548e 100644
--- a/tempest/services/volume/json/volumes_client.py
+++ b/tempest/services/volume/json/volumes_client.py
@@ -23,7 +23,7 @@
from tempest import exceptions
-class BaseVolumesClientJSON(service_client.ServiceClient):
+class BaseVolumesClient(service_client.ServiceClient):
"""
Base client class to send CRUD Volume API requests to a Cinder endpoint
"""
@@ -32,7 +32,7 @@
def __init__(self, auth_provider, service, region,
default_volume_size=1, **kwargs):
- super(BaseVolumesClientJSON, self).__init__(
+ super(BaseVolumesClient, self).__init__(
auth_provider, service, region, **kwargs)
self.default_volume_size = default_volume_size
@@ -345,7 +345,7 @@
self.expected_success(202, resp.status)
-class VolumesClientJSON(BaseVolumesClientJSON):
+class VolumesClient(BaseVolumesClient):
"""
Client class to send CRUD Volume V1 API requests to a Cinder endpoint
"""
diff --git a/tempest/services/volume/v2/json/admin/volume_hosts_client.py b/tempest/services/volume/v2/json/admin/volume_hosts_client.py
index b93d031..f0cc03f 100644
--- a/tempest/services/volume/v2/json/admin/volume_hosts_client.py
+++ b/tempest/services/volume/v2/json/admin/volume_hosts_client.py
@@ -17,7 +17,7 @@
from tempest.services.volume.json.admin import volume_hosts_client
-class VolumeHostsV2ClientJSON(volume_hosts_client.BaseVolumeHostsClientJSON):
+class VolumeHostsV2Client(volume_hosts_client.BaseVolumeHostsClient):
"""
Client class to send CRUD Volume V2 API requests to a Cinder endpoint
"""
diff --git a/tempest/services/volume/v2/json/admin/volume_quotas_client.py b/tempest/services/volume/v2/json/admin/volume_quotas_client.py
index 1dc48cd..635b6e1 100644
--- a/tempest/services/volume/v2/json/admin/volume_quotas_client.py
+++ b/tempest/services/volume/v2/json/admin/volume_quotas_client.py
@@ -16,7 +16,7 @@
from tempest.services.volume.json.admin import volume_quotas_client
-class VolumeQuotasV2Client(volume_quotas_client.BaseVolumeQuotasClientJSON):
+class VolumeQuotasV2Client(volume_quotas_client.BaseVolumeQuotasClient):
"""
Client class to send CRUD Volume V2 API requests to a Cinder endpoint
"""
diff --git a/tempest/services/volume/v2/json/admin/volume_services_client.py b/tempest/services/volume/v2/json/admin/volume_services_client.py
index 51224c5..d0efc38 100644
--- a/tempest/services/volume/v2/json/admin/volume_services_client.py
+++ b/tempest/services/volume/v2/json/admin/volume_services_client.py
@@ -16,7 +16,7 @@
from tempest.services.volume.json.admin import volume_services_client as vs_cli
-class VolumesServicesV2ClientJSON(vs_cli.BaseVolumesServicesClientJSON):
+class VolumesServicesV2Client(vs_cli.BaseVolumesServicesClient):
"""
Client class to send CRUD Volume V2 API requests to a Cinder endpoint
"""
diff --git a/tempest/services/volume/v2/json/admin/volume_types_client.py b/tempest/services/volume/v2/json/admin/volume_types_client.py
index 24099b2..1b9ff51 100644
--- a/tempest/services/volume/v2/json/admin/volume_types_client.py
+++ b/tempest/services/volume/v2/json/admin/volume_types_client.py
@@ -17,7 +17,7 @@
from tempest.services.volume.json.admin import volume_types_client
-class VolumeTypesV2ClientJSON(volume_types_client.BaseVolumeTypesClientJSON):
+class VolumeTypesV2Client(volume_types_client.BaseVolumeTypesClient):
"""
Client class to send CRUD Volume V2 API requests to a Cinder endpoint
"""
diff --git a/tempest/services/volume/v2/json/availability_zone_client.py b/tempest/services/volume/v2/json/availability_zone_client.py
index dc85634..2e1ab20 100644
--- a/tempest/services/volume/v2/json/availability_zone_client.py
+++ b/tempest/services/volume/v2/json/availability_zone_client.py
@@ -16,6 +16,6 @@
from tempest.services.volume.json import availability_zone_client
-class VolumeV2AvailabilityZoneClientJSON(
- availability_zone_client.BaseVolumeAvailabilityZoneClientJSON):
+class VolumeV2AvailabilityZoneClient(
+ availability_zone_client.BaseVolumeAvailabilityZoneClient):
api_version = "v2"
diff --git a/tempest/services/volume/v2/json/backups_client.py b/tempest/services/volume/v2/json/backups_client.py
index 30d9e8e..1ce11ce 100644
--- a/tempest/services/volume/v2/json/backups_client.py
+++ b/tempest/services/volume/v2/json/backups_client.py
@@ -16,7 +16,7 @@
from tempest.services.volume.json import backups_client
-class BackupsClientV2JSON(backups_client.BaseBackupsClientJSON):
+class BackupsClientV2(backups_client.BaseBackupsClient):
"""
Client class to send CRUD Volume V2 API requests to a Cinder endpoint
"""
diff --git a/tempest/services/volume/v2/json/extensions_client.py b/tempest/services/volume/v2/json/extensions_client.py
index 8dda833..3e32c0c 100644
--- a/tempest/services/volume/v2/json/extensions_client.py
+++ b/tempest/services/volume/v2/json/extensions_client.py
@@ -16,5 +16,5 @@
from tempest.services.volume.json import extensions_client
-class ExtensionsV2ClientJSON(extensions_client.BaseExtensionsClientJSON):
+class ExtensionsV2Client(extensions_client.BaseExtensionsClient):
api_version = "v2"
diff --git a/tempest/services/volume/v2/json/qos_client.py b/tempest/services/volume/v2/json/qos_client.py
index d17da6d..42bd1c9 100644
--- a/tempest/services/volume/v2/json/qos_client.py
+++ b/tempest/services/volume/v2/json/qos_client.py
@@ -15,5 +15,5 @@
from tempest.services.volume.json import qos_client
-class QosSpecsV2ClientJSON(qos_client.BaseQosSpecsClientJSON):
+class QosSpecsV2Client(qos_client.BaseQosSpecsClient):
api_version = "v2"
diff --git a/tempest/services/volume/v2/json/snapshots_client.py b/tempest/services/volume/v2/json/snapshots_client.py
index 90580f9..a94f9cd 100644
--- a/tempest/services/volume/v2/json/snapshots_client.py
+++ b/tempest/services/volume/v2/json/snapshots_client.py
@@ -13,7 +13,7 @@
from tempest.services.volume.json import snapshots_client
-class SnapshotsV2ClientJSON(snapshots_client.BaseSnapshotsClientJSON):
+class SnapshotsV2Client(snapshots_client.BaseSnapshotsClient):
"""Client class to send CRUD Volume V2 API requests."""
api_version = "v2"
create_resp = 202
diff --git a/tempest/services/volume/v2/json/volumes_client.py b/tempest/services/volume/v2/json/volumes_client.py
index 85ffb91..a6d081c 100644
--- a/tempest/services/volume/v2/json/volumes_client.py
+++ b/tempest/services/volume/v2/json/volumes_client.py
@@ -16,7 +16,7 @@
from tempest.services.volume.json import volumes_client
-class VolumesV2ClientJSON(volumes_client.BaseVolumesClientJSON):
+class VolumesV2Client(volumes_client.BaseVolumesClient):
"""
Client class to send CRUD Volume V2 API requests to a Cinder endpoint
"""
diff --git a/tempest/stress/actions/server_create_destroy.py b/tempest/stress/actions/server_create_destroy.py
index c0a3178..d0e4eea 100644
--- a/tempest/stress/actions/server_create_destroy.py
+++ b/tempest/stress/actions/server_create_destroy.py
@@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from tempest_lib.common.utils import data_utils
-
+from tempest.common.utils import data_utils
from tempest import config
import tempest.stress.stressaction as stressaction
diff --git a/tempest/stress/actions/ssh_floating.py b/tempest/stress/actions/ssh_floating.py
index b2a30e9..9e540fa 100644
--- a/tempest/stress/actions/ssh_floating.py
+++ b/tempest/stress/actions/ssh_floating.py
@@ -13,8 +13,7 @@
import socket
import subprocess
-from tempest_lib.common.utils import data_utils
-
+from tempest.common.utils import data_utils
from tempest import config
import tempest.stress.stressaction as stressaction
import tempest.test
diff --git a/tempest/stress/actions/volume_attach_delete.py b/tempest/stress/actions/volume_attach_delete.py
index 93400c4..a5e393f 100644
--- a/tempest/stress/actions/volume_attach_delete.py
+++ b/tempest/stress/actions/volume_attach_delete.py
@@ -11,8 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from tempest_lib.common.utils import data_utils
-
+from tempest.common.utils import data_utils
from tempest import config
import tempest.stress.stressaction as stressaction
diff --git a/tempest/stress/actions/volume_attach_verify.py b/tempest/stress/actions/volume_attach_verify.py
index ea53481..1cd96ed 100644
--- a/tempest/stress/actions/volume_attach_verify.py
+++ b/tempest/stress/actions/volume_attach_verify.py
@@ -12,8 +12,7 @@
import re
-from tempest_lib.common.utils import data_utils
-
+from tempest.common.utils import data_utils
from tempest.common.utils.linux import remote_client
from tempest import config
import tempest.stress.stressaction as stressaction
diff --git a/tempest/stress/actions/volume_create_delete.py b/tempest/stress/actions/volume_create_delete.py
index b1899a0..4870055 100644
--- a/tempest/stress/actions/volume_create_delete.py
+++ b/tempest/stress/actions/volume_create_delete.py
@@ -10,8 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from tempest_lib.common.utils import data_utils
-
+from tempest.common.utils import data_utils
import tempest.stress.stressaction as stressaction
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index 3f8e537..bdb39d8 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -22,10 +22,11 @@
import six
from six import moves
from tempest_lib.common import ssh
-from tempest_lib.common.utils import data_utils
+
from tempest import clients
from tempest.common import isolated_creds
+from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest.stress import cleanup
diff --git a/tempest/test.py b/tempest/test.py
index 0d709f6c..80e61c7 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -43,7 +43,7 @@
CONF = config.CONF
-def attr(*args, **kwargs):
+def attr(**kwargs):
"""A decorator which applies the testtools attr decorator
This decorator applies the testtools.testcase.attr if it is in the list of
@@ -98,7 +98,7 @@
return service_list
-def services(*args, **kwargs):
+def services(*args):
"""A decorator used to set an attr for each service used in a test case
This decorator applies a testtools attr for each service that gets
@@ -128,7 +128,7 @@
return decorator
-def stresstest(*args, **kwargs):
+def stresstest(**kwargs):
"""Add stress test decorator
For all functions with this decorator a attr stress will be
@@ -154,7 +154,7 @@
return decorator
-def requires_ext(*args, **kwargs):
+def requires_ext(**kwargs):
"""A decorator to skip tests if an extension is not enabled
@param extension
diff --git a/tempest/tests/cmd/test_javelin.py b/tempest/tests/cmd/test_javelin.py
index a0b250e..f0921d5 100644
--- a/tempest/tests/cmd/test_javelin.py
+++ b/tempest/tests/cmd/test_javelin.py
@@ -109,7 +109,7 @@
self.fake_client.identity.get_tenant_by_name.return_value = \
self.fake_object['tenant']
self.fake_client.identity.get_user_by_username.side_effect = \
- lib_exc.NotFound()
+ lib_exc.NotFound("user is not found")
self.useFixture(mockpatch.PatchObject(javelin, "keystone_admin",
return_value=self.fake_client))
@@ -126,7 +126,7 @@
def test_create_user_missing_tenant(self):
self.fake_client.identity.get_tenant_by_name.side_effect = \
- lib_exc.NotFound()
+ lib_exc.NotFound("tenant is not found")
self.useFixture(mockpatch.PatchObject(javelin, "keystone_admin",
return_value=self.fake_client))
@@ -245,14 +245,49 @@
mocked_function = self.fake_client.volumes.wait_for_volume_status
self.assertFalse(mocked_function.called)
+ def test_create_router(self):
+
+ self.fake_client.networks.list_routers.return_value = {'routers': []}
+ self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+ return_value=self.fake_client))
+
+ javelin.create_routers([self.fake_object])
+
+ mocked_function = self.fake_client.networks.create_router
+ mocked_function.assert_called_once_with(self.fake_object['name'])
+
+ def test_create_router_existing(self):
+ self.fake_client.networks.list_routers.return_value = {
+ 'routers': [self.fake_object]}
+ self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+ return_value=self.fake_client))
+
+ javelin.create_routers([self.fake_object])
+
+ mocked_function = self.fake_client.networks.create_router
+ self.assertFalse(mocked_function.called)
+
+ def test_create_secgroup(self):
+ self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+ return_value=self.fake_client))
+ self.fake_client.secgroups.list_security_groups.return_value = []
+ self.fake_client.secgroups.create_security_group.return_value = \
+ {'id': self.fake_object['secgroup_id']}
+
+ javelin.create_secgroups([self.fake_object])
+
+ mocked_function = self.fake_client.secgroups.create_security_group
+ mocked_function.assert_called_once_with(
+ self.fake_object['name'],
+ self.fake_object['description'])
+
class TestDestroyResources(JavelinUnitTest):
def test_destroy_tenants(self):
fake_tenant = self.fake_object['tenant']
-
- fake_auth = mock.MagicMock()
+ fake_auth = self.fake_client
fake_auth.identity.get_tenant_by_name.return_value = fake_tenant
self.useFixture(mockpatch.PatchObject(javelin, "keystone_admin",
@@ -267,7 +302,7 @@
fake_user = self.fake_object['user']
fake_tenant = self.fake_object['tenant']
- fake_auth = mock.MagicMock()
+ fake_auth = self.fake_client
fake_auth.identity.get_tenant_by_name.return_value = fake_tenant
fake_auth.identity.get_user_by_username.return_value = fake_user
@@ -281,42 +316,40 @@
def test_destroy_objects(self):
- fake_client = mock.MagicMock()
- fake_client.objects.delete_object.return_value = {'status': "200"}, ""
+ self.fake_client.objects.delete_object.return_value = \
+ {'status': "200"}, ""
self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
- return_value=fake_client))
+ return_value=self.fake_client))
javelin.destroy_objects([self.fake_object])
- mocked_function = fake_client.objects.delete_object
+ mocked_function = self.fake_client.objects.delete_object
mocked_function.asswert_called_once(self.fake_object['container'],
self.fake_object['name'])
def test_destroy_images(self):
- fake_client = mock.MagicMock()
self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
- return_value=fake_client))
+ return_value=self.fake_client))
self.useFixture(mockpatch.PatchObject(javelin, "_get_image_by_name",
return_value=self.fake_object['image']))
javelin.destroy_images([self.fake_object])
- mocked_function = fake_client.images.delete_image
+ mocked_function = self.fake_client.images.delete_image
mocked_function.assert_called_once_with(
self.fake_object['image']['id'])
def test_destroy_networks(self):
- fake_client = mock.MagicMock()
self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
- return_value=fake_client))
+ return_value=self.fake_client))
self.useFixture(mockpatch.PatchObject(
javelin, "_get_resource_by_name",
return_value=self.fake_object['resource']))
javelin.destroy_networks([self.fake_object])
- mocked_function = fake_client.networks.delete_network
+ mocked_function = self.fake_client.networks.delete_network
mocked_function.assert_called_once_with(
self.fake_object['resource']['id'])
@@ -334,3 +367,47 @@
mocked_function.assert_called_once_with(self.fake_object.volume['id'])
mocked_function = self.fake_client.volumes.delete_volume
mocked_function.assert_called_once_with(self.fake_object.volume['id'])
+
+ def test_destroy_subnets(self):
+
+ self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+ return_value=self.fake_client))
+ fake_subnet_id = self.fake_object['subnet_id']
+ self.useFixture(mockpatch.PatchObject(javelin, "_get_resource_by_name",
+ return_value={
+ 'id': fake_subnet_id}))
+
+ javelin.destroy_subnets([self.fake_object])
+
+ mocked_function = self.fake_client.networks.delete_subnet
+ mocked_function.assert_called_once_with(fake_subnet_id)
+
+ def test_destroy_routers(self):
+ self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+ return_value=self.fake_client))
+
+ # this function is used on 2 different occasions in the code
+ def _fake_get_resource_by_name(*args):
+ if args[1] == "routers":
+ return {"id": self.fake_object['router_id']}
+ elif args[1] == "subnets":
+ return {"id": self.fake_object['subnet_id']}
+ javelin._get_resource_by_name = _fake_get_resource_by_name
+
+ javelin.destroy_routers([self.fake_object])
+
+ mocked_function = self.fake_client.networks.delete_router
+ mocked_function.assert_called_once_with(
+ self.fake_object['router_id'])
+
+ def test_destroy_secgroup(self):
+ self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+ return_value=self.fake_client))
+ fake_secgroup = {'id': self.fake_object['id']}
+ self.useFixture(mockpatch.PatchObject(javelin, "_get_resource_by_name",
+ return_value=fake_secgroup))
+
+ javelin.destroy_secgroups([self.fake_object])
+
+ mocked_function = self.fake_client.secgroups.delete_security_group
+ mocked_function.assert_called_once_with(self.fake_object['id'])
diff --git a/tempest/tests/common/test_accounts.py b/tempest/tests/common/test_accounts.py
index e713969..8fc3745 100644
--- a/tempest/tests/common/test_accounts.py
+++ b/tempest/tests/common/test_accounts.py
@@ -291,14 +291,12 @@
{'username': 'test_user14', 'tenant_name': 'test_tenant14',
'password': 'p', 'roles': ['role-7', 'role-11'],
'resources': {'network': 'network-2'}}]
- # Clear previous mock using self.test_accounts
- self.accounts_mock.cleanUp()
self.useFixture(mockpatch.Patch(
'tempest.common.accounts.read_accounts_yaml',
return_value=test_accounts))
test_accounts_class = accounts.Accounts('v2', 'test_name')
with mock.patch('tempest.services.compute.json.networks_client.'
- 'NetworksClientJSON.list_networks',
+ 'NetworksClient.list_networks',
return_value=[{'name': 'network-2', 'id': 'fake-id',
'label': 'network-2'}]):
creds = test_accounts_class.get_creds_by_roles(['role-7'])
diff --git a/tempest/tests/common/test_service_clients.py b/tempest/tests/common/test_service_clients.py
index c6c1053..3de7aba 100644
--- a/tempest/tests/common/test_service_clients.py
+++ b/tempest/tests/common/test_service_clients.py
@@ -104,71 +104,71 @@
@mock.patch('tempest_lib.common.rest_client.RestClient.__init__')
def test_service_client_creations_with_specified_args(self, mock_init):
test_clients = [
- baremetal_client.BaremetalClientJSON,
- agents_client.AgentsClientJSON,
- aggregates_client.AggregatesClientJSON,
- availability_zone_client.AvailabilityZoneClientJSON,
- certificates_client.CertificatesClientJSON,
- extensions_client.ExtensionsClientJSON,
- fixed_ips_client.FixedIPsClientJSON,
- flavors_client.FlavorsClientJSON,
- floating_ips_client.FloatingIPsClientJSON,
- hosts_client.HostsClientJSON,
- hypervisor_client.HypervisorClientJSON,
- images_client.ImagesClientJSON,
- instance_usage_audit_log_client.InstanceUsagesAuditLogClientJSON,
- interfaces_client.InterfacesClientJSON,
- keypairs_client.KeyPairsClientJSON,
- limits_client.LimitsClientJSON,
- migrations_client.MigrationsClientJSON,
- nova_net_client.NetworksClientJSON,
- quotas_client.QuotasClientJSON,
- quota_classes_client.QuotaClassesClientJSON,
- nova_secgrop_default_client.SecurityGroupDefaultRulesClientJSON,
- security_groups_client.SecurityGroupsClientJSON,
- servers_client.ServersClientJSON,
- services_client.ServicesClientJSON,
- tenant_usages_client.TenantUsagesClientJSON,
- compute_volumes_extensions_client.VolumesExtensionsClientJSON,
+ baremetal_client.BaremetalClient,
+ agents_client.AgentsClient,
+ aggregates_client.AggregatesClient,
+ availability_zone_client.AvailabilityZoneClient,
+ certificates_client.CertificatesClient,
+ extensions_client.ExtensionsClient,
+ fixed_ips_client.FixedIPsClient,
+ flavors_client.FlavorsClient,
+ floating_ips_client.FloatingIPsClient,
+ hosts_client.HostsClient,
+ hypervisor_client.HypervisorClient,
+ images_client.ImagesClient,
+ instance_usage_audit_log_client.InstanceUsagesAuditLogClient,
+ interfaces_client.InterfacesClient,
+ keypairs_client.KeyPairsClient,
+ limits_client.LimitsClient,
+ migrations_client.MigrationsClient,
+ nova_net_client.NetworksClient,
+ quotas_client.QuotasClient,
+ quota_classes_client.QuotaClassesClient,
+ nova_secgrop_default_client.SecurityGroupDefaultRulesClient,
+ security_groups_client.SecurityGroupsClient,
+ servers_client.ServersClient,
+ services_client.ServicesClient,
+ tenant_usages_client.TenantUsagesClient,
+ compute_volumes_extensions_client.VolumesExtensionsClient,
data_processing_client.DataProcessingClient,
- db_flavor_client.DatabaseFlavorsClientJSON,
- db_version_client.DatabaseVersionsClientJSON,
- messaging_client.MessagingClientJSON,
- network_client.NetworkClientJSON,
+ db_flavor_client.DatabaseFlavorsClient,
+ db_version_client.DatabaseVersionsClient,
+ messaging_client.MessagingClient,
+ network_client.NetworkClient,
account_client.AccountClient,
container_client.ContainerClient,
object_client.ObjectClient,
orchestration_client.OrchestrationClient,
- telemetry_client.TelemetryClientJSON,
- qos_client.QosSpecsClientJSON,
- volume_hosts_client.VolumeHostsClientJSON,
- volume_quotas_client.VolumeQuotasClientJSON,
- volume_services_client.VolumesServicesClientJSON,
- volume_types_client.VolumeTypesClientJSON,
- volume_az_client.VolumeAvailabilityZoneClientJSON,
- backups_client.BackupsClientJSON,
- volume_extensions_client.ExtensionsClientJSON,
- snapshots_client.SnapshotsClientJSON,
- volumes_client.VolumesClientJSON,
- volume_v2_hosts_client.VolumeHostsV2ClientJSON,
+ telemetry_client.TelemetryClient,
+ qos_client.QosSpecsClient,
+ volume_hosts_client.VolumeHostsClient,
+ volume_quotas_client.VolumeQuotasClient,
+ volume_services_client.VolumesServicesClient,
+ volume_types_client.VolumeTypesClient,
+ volume_az_client.VolumeAvailabilityZoneClient,
+ backups_client.BackupsClient,
+ volume_extensions_client.ExtensionsClient,
+ snapshots_client.SnapshotsClient,
+ volumes_client.VolumesClient,
+ volume_v2_hosts_client.VolumeHostsV2Client,
volume_v2_quotas_client.VolumeQuotasV2Client,
- volume_v2_services_client.VolumesServicesV2ClientJSON,
- volume_v2_types_client.VolumeTypesV2ClientJSON,
- volume_v2_az_client.VolumeV2AvailabilityZoneClientJSON,
- volume_v2_backups_client.BackupsClientV2JSON,
- volume_v2_extensions_client.ExtensionsV2ClientJSON,
- volume_v2_qos_client.QosSpecsV2ClientJSON,
- volume_v2_snapshots_client.SnapshotsV2ClientJSON,
- volume_v2_volumes_client.VolumesV2ClientJSON,
- identity_v2_identity_client.IdentityClientJSON,
- credentials_client.CredentialsClientJSON,
- endpoints_client.EndPointClientJSON,
- identity_v3_identity_client.IdentityV3ClientJSON,
- policy_client.PolicyClientJSON,
- region_client.RegionClientJSON,
- service_client.ServiceClientJSON,
- image_client.ImageClientJSON,
- image_v2_client.ImageClientV2JSON
+ volume_v2_services_client.VolumesServicesV2Client,
+ volume_v2_types_client.VolumeTypesV2Client,
+ volume_v2_az_client.VolumeV2AvailabilityZoneClient,
+ volume_v2_backups_client.BackupsClientV2,
+ volume_v2_extensions_client.ExtensionsV2Client,
+ volume_v2_qos_client.QosSpecsV2Client,
+ volume_v2_snapshots_client.SnapshotsV2Client,
+ volume_v2_volumes_client.VolumesV2Client,
+ identity_v2_identity_client.IdentityClient,
+ credentials_client.CredentialsClient,
+ endpoints_client.EndPointClient,
+ identity_v3_identity_client.IdentityV3Client,
+ policy_client.PolicyClient,
+ region_client.RegionClient,
+ service_client.ServiceClient,
+ image_client.ImageClient,
+ image_v2_client.ImageClientV2
]
for client in test_clients:
diff --git a/tempest/tests/common/utils/linux/test_remote_client.py b/tempest/tests/common/utils/linux/test_remote_client.py
index 3506856..3ff8e0d 100644
--- a/tempest/tests/common/utils/linux/test_remote_client.py
+++ b/tempest/tests/common/utils/linux/test_remote_client.py
@@ -28,9 +28,9 @@
super(TestRemoteClient, self).setUp()
self.useFixture(fake_config.ConfigFixture())
self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate)
- cfg.CONF.set_default('ip_version_for_ssh', 4, group='compute')
+ cfg.CONF.set_default('ip_version_for_ssh', 4, group='validation')
cfg.CONF.set_default('network_for_ssh', 'public', group='compute')
- cfg.CONF.set_default('ssh_channel_timeout', 1, group='compute')
+ cfg.CONF.set_default('connect_timeout', 1, group='validation')
self.conn = remote_client.RemoteClient('127.0.0.1', 'user', 'pass')
self.ssh_mock = self.useFixture(mockpatch.PatchObject(self.conn,
@@ -79,8 +79,7 @@
def test_get_number_of_vcpus(self):
self.ssh_mock.mock.exec_command.return_value = '16'
self.assertEqual(self.conn.get_number_of_vcpus(), 16)
- self._assert_exec_called_with(
- 'cat /proc/cpuinfo | grep processor | wc -l')
+ self._assert_exec_called_with('grep -c processor /proc/cpuinfo')
def test_get_partitions(self):
proc_partitions = """major minor #blocks name
diff --git a/tempest/tests/test_decorators.py b/tempest/tests/test_decorators.py
index e5f51f2..ce3eb7e 100644
--- a/tempest/tests/test_decorators.py
+++ b/tempest/tests/test_decorators.py
@@ -213,8 +213,8 @@
service='compute')
def test_requires_ext_decorator_with_all_ext_enabled(self):
- # disable fixture so the default (all) is used.
- self.config_fixture.cleanUp()
+ cfg.CONF.set_default('api_extensions', 'all',
+ group='compute-feature-enabled')
self._test_requires_ext_helper(expected_to_skip=False,
extension='random_ext',
service='compute')
diff --git a/tempest/tests/test_tenant_isolation.py b/tempest/tests/test_tenant_isolation.py
index 72a63c3..fa1b6f7 100644
--- a/tempest/tests/test_tenant_isolation.py
+++ b/tempest/tests/test_tenant_isolation.py
@@ -46,13 +46,13 @@
def test_tempest_client(self):
iso_creds = isolated_creds.IsolatedCreds(name='test class')
self.assertTrue(isinstance(iso_creds.identity_admin_client,
- json_iden_client.IdentityClientJSON))
+ json_iden_client.IdentityClient))
self.assertTrue(isinstance(iso_creds.network_admin_client,
- json_network_client.NetworkClientJSON))
+ json_network_client.NetworkClient))
def _mock_user_create(self, id, name):
user_fix = self.useFixture(mockpatch.PatchObject(
- json_iden_client.IdentityClientJSON,
+ json_iden_client.IdentityClient,
'create_user',
return_value=(service_client.ResponseBody
(200, {'id': id, 'name': name}))))
@@ -60,7 +60,7 @@
def _mock_tenant_create(self, id, name):
tenant_fix = self.useFixture(mockpatch.PatchObject(
- json_iden_client.IdentityClientJSON,
+ json_iden_client.IdentityClient,
'create_tenant',
return_value=(service_client.ResponseBody
(200, {'id': id, 'name': name}))))
@@ -68,7 +68,7 @@
def _mock_list_roles(self, id, name):
roles_fix = self.useFixture(mockpatch.PatchObject(
- json_iden_client.IdentityClientJSON,
+ json_iden_client.IdentityClient,
'list_roles',
return_value=(service_client.ResponseBodyList
(200,
@@ -78,7 +78,7 @@
def _mock_list_2_roles(self):
roles_fix = self.useFixture(mockpatch.PatchObject(
- json_iden_client.IdentityClientJSON,
+ json_iden_client.IdentityClient,
'list_roles',
return_value=(service_client.ResponseBodyList
(200,
@@ -89,7 +89,7 @@
def _mock_assign_user_role(self):
tenant_fix = self.useFixture(mockpatch.PatchObject(
- json_iden_client.IdentityClientJSON,
+ json_iden_client.IdentityClient,
'assign_user_role',
return_value=(service_client.ResponseBody
(200, {}))))
@@ -97,7 +97,7 @@
def _mock_list_role(self):
roles_fix = self.useFixture(mockpatch.PatchObject(
- json_iden_client.IdentityClientJSON,
+ json_iden_client.IdentityClient,
'list_roles',
return_value=(service_client.ResponseBodyList
(200, [{'id': '1', 'name': 'FakeRole'}]))))
@@ -105,7 +105,7 @@
def _mock_list_ec2_credentials(self, user_id, tenant_id):
ec2_creds_fix = self.useFixture(mockpatch.PatchObject(
- json_iden_client.IdentityClientJSON,
+ json_iden_client.IdentityClient,
'list_user_ec2_credentials',
return_value=(service_client.ResponseBodyList
(200, [{'access': 'fake_access',
@@ -131,7 +131,7 @@
def _mock_router_create(self, id, name):
router_fix = self.useFixture(mockpatch.PatchObject(
- json_network_client.NetworkClientJSON,
+ json_network_client.NetworkClient,
'create_router',
return_value={'router': {'id': id, 'name': name}}))
return router_fix
@@ -139,8 +139,7 @@
@mock.patch('tempest_lib.common.rest_client.RestClient')
def test_primary_creds(self, MockRestClient):
cfg.CONF.set_default('neutron', False, 'service_available')
- iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password')
+ iso_creds = isolated_creds.IsolatedCreds(name='test class')
self._mock_assign_user_role()
self._mock_list_role()
self._mock_tenant_create('1234', 'fake_prim_tenant')
@@ -155,17 +154,16 @@
@mock.patch('tempest_lib.common.rest_client.RestClient')
def test_admin_creds(self, MockRestClient):
cfg.CONF.set_default('neutron', False, 'service_available')
- iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password')
+ iso_creds = isolated_creds.IsolatedCreds(name='test class')
self._mock_list_roles('1234', 'admin')
self._mock_user_create('1234', 'fake_admin_user')
self._mock_tenant_create('1234', 'fake_admin_tenant')
- user_mock = mock.patch.object(json_iden_client.IdentityClientJSON,
+ user_mock = mock.patch.object(json_iden_client.IdentityClient,
'assign_user_role')
user_mock.start()
self.addCleanup(user_mock.stop)
- with mock.patch.object(json_iden_client.IdentityClientJSON,
+ with mock.patch.object(json_iden_client.IdentityClient,
'assign_user_role') as user_mock:
admin_creds = iso_creds.get_admin_creds()
user_mock.assert_has_calls([
@@ -179,17 +177,16 @@
@mock.patch('tempest_lib.common.rest_client.RestClient')
def test_role_creds(self, MockRestClient):
cfg.CONF.set_default('neutron', False, 'service_available')
- iso_creds = isolated_creds.IsolatedCreds('v2', 'test class',
- password='fake_password')
+ iso_creds = isolated_creds.IsolatedCreds('v2', 'test class')
self._mock_list_2_roles()
self._mock_user_create('1234', 'fake_role_user')
self._mock_tenant_create('1234', 'fake_role_tenant')
- user_mock = mock.patch.object(json_iden_client.IdentityClientJSON,
+ user_mock = mock.patch.object(json_iden_client.IdentityClient,
'assign_user_role')
user_mock.start()
self.addCleanup(user_mock.stop)
- with mock.patch.object(json_iden_client.IdentityClientJSON,
+ with mock.patch.object(json_iden_client.IdentityClient,
'assign_user_role') as user_mock:
role_creds = iso_creds.get_creds_by_roles(roles=['role1', 'role2'])
calls = user_mock.mock_calls
@@ -208,31 +205,25 @@
@mock.patch('tempest_lib.common.rest_client.RestClient')
def test_all_cred_cleanup(self, MockRestClient):
cfg.CONF.set_default('neutron', False, 'service_available')
- iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password')
+ iso_creds = isolated_creds.IsolatedCreds(name='test class')
self._mock_assign_user_role()
- roles_fix = self._mock_list_role()
- tenant_fix = self._mock_tenant_create('1234', 'fake_prim_tenant')
- user_fix = self._mock_user_create('1234', 'fake_prim_user')
+ self._mock_list_role()
+ self._mock_tenant_create('1234', 'fake_prim_tenant')
+ self._mock_user_create('1234', 'fake_prim_user')
iso_creds.get_primary_creds()
- tenant_fix.cleanUp()
- user_fix.cleanUp()
- tenant_fix = self._mock_tenant_create('12345', 'fake_alt_tenant')
- user_fix = self._mock_user_create('12345', 'fake_alt_user')
+ self._mock_tenant_create('12345', 'fake_alt_tenant')
+ self._mock_user_create('12345', 'fake_alt_user')
iso_creds.get_alt_creds()
- tenant_fix.cleanUp()
- user_fix.cleanUp()
- roles_fix.cleanUp()
- tenant_fix = self._mock_tenant_create('123456', 'fake_admin_tenant')
- user_fix = self._mock_user_create('123456', 'fake_admin_user')
+ self._mock_tenant_create('123456', 'fake_admin_tenant')
+ self._mock_user_create('123456', 'fake_admin_user')
self._mock_list_roles('123456', 'admin')
iso_creds.get_admin_creds()
user_mock = self.patch(
'tempest.services.identity.v2.json.identity_client.'
- 'IdentityClientJSON.delete_user')
+ 'IdentityClient.delete_user')
tenant_mock = self.patch(
'tempest.services.identity.v2.json.identity_client.'
- 'IdentityClientJSON.delete_tenant')
+ 'IdentityClient.delete_tenant')
iso_creds.clear_isolated_creds()
# Verify user delete calls
calls = user_mock.mock_calls
@@ -254,8 +245,7 @@
@mock.patch('tempest_lib.common.rest_client.RestClient')
def test_alt_creds(self, MockRestClient):
cfg.CONF.set_default('neutron', False, 'service_available')
- iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password')
+ iso_creds = isolated_creds.IsolatedCreds(name='test class')
self._mock_assign_user_role()
self._mock_list_role()
self._mock_user_create('1234', 'fake_alt_user')
@@ -270,8 +260,7 @@
@mock.patch('tempest_lib.common.rest_client.RestClient')
def test_no_network_creation_with_config_set(self, MockRestClient):
cfg.CONF.set_default('create_isolated_networks', False, group='auth')
- iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password')
+ iso_creds = isolated_creds.IsolatedCreds(name='test class')
self._mock_assign_user_role()
self._mock_list_role()
self._mock_user_create('1234', 'fake_prim_user')
@@ -299,8 +288,7 @@
@mock.patch('tempest_lib.common.rest_client.RestClient')
def test_network_creation(self, MockRestClient):
- iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password')
+ iso_creds = isolated_creds.IsolatedCreds(name='test class')
self._mock_assign_user_role()
self._mock_list_role()
self._mock_user_create('1234', 'fake_prim_user')
@@ -309,7 +297,7 @@
self._mock_subnet_create(iso_creds, '1234', 'fake_subnet')
self._mock_router_create('1234', 'fake_router')
router_interface_mock = self.patch(
- 'tempest.services.network.json.network_client.NetworkClientJSON.'
+ 'tempest.services.network.json.network_client.NetworkClient.'
'add_router_interface_with_subnet_id')
primary_creds = iso_creds.get_primary_creds()
router_interface_mock.called_once_with('1234', '1234')
@@ -331,57 +319,45 @@
"description": args['name'],
"security_group_rules": [],
"id": "sg-%s" % args['tenant_id']}]}
- iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password')
+ iso_creds = isolated_creds.IsolatedCreds(name='test class')
# Create primary tenant and network
self._mock_assign_user_role()
- roles_fix = self._mock_list_role()
- user_fix = self._mock_user_create('1234', 'fake_prim_user')
- tenant_fix = self._mock_tenant_create('1234', 'fake_prim_tenant')
- net_fix = self._mock_network_create(iso_creds, '1234', 'fake_net')
- subnet_fix = self._mock_subnet_create(iso_creds, '1234', 'fake_subnet')
- router_fix = self._mock_router_create('1234', 'fake_router')
+ self._mock_list_role()
+ self._mock_user_create('1234', 'fake_prim_user')
+ self._mock_tenant_create('1234', 'fake_prim_tenant')
+ self._mock_network_create(iso_creds, '1234', 'fake_net')
+ self._mock_subnet_create(iso_creds, '1234', 'fake_subnet')
+ self._mock_router_create('1234', 'fake_router')
router_interface_mock = self.patch(
- 'tempest.services.network.json.network_client.NetworkClientJSON.'
+ 'tempest.services.network.json.network_client.NetworkClient.'
'add_router_interface_with_subnet_id')
iso_creds.get_primary_creds()
router_interface_mock.called_once_with('1234', '1234')
router_interface_mock.reset_mock()
- tenant_fix.cleanUp()
- user_fix.cleanUp()
- net_fix.cleanUp()
- subnet_fix.cleanUp()
- router_fix.cleanUp()
# Create alternate tenant and network
- user_fix = self._mock_user_create('12345', 'fake_alt_user')
- tenant_fix = self._mock_tenant_create('12345', 'fake_alt_tenant')
- net_fix = self._mock_network_create(iso_creds, '12345', 'fake_alt_net')
- subnet_fix = self._mock_subnet_create(iso_creds, '12345',
- 'fake_alt_subnet')
- router_fix = self._mock_router_create('12345', 'fake_alt_router')
+ self._mock_user_create('12345', 'fake_alt_user')
+ self._mock_tenant_create('12345', 'fake_alt_tenant')
+ self._mock_network_create(iso_creds, '12345', 'fake_alt_net')
+ self._mock_subnet_create(iso_creds, '12345',
+ 'fake_alt_subnet')
+ self._mock_router_create('12345', 'fake_alt_router')
iso_creds.get_alt_creds()
router_interface_mock.called_once_with('12345', '12345')
router_interface_mock.reset_mock()
- tenant_fix.cleanUp()
- user_fix.cleanUp()
- net_fix.cleanUp()
- subnet_fix.cleanUp()
- router_fix.cleanUp()
- roles_fix.cleanUp()
# Create admin tenant and networks
- user_fix = self._mock_user_create('123456', 'fake_admin_user')
- tenant_fix = self._mock_tenant_create('123456', 'fake_admin_tenant')
- net_fix = self._mock_network_create(iso_creds, '123456',
- 'fake_admin_net')
- subnet_fix = self._mock_subnet_create(iso_creds, '123456',
- 'fake_admin_subnet')
- router_fix = self._mock_router_create('123456', 'fake_admin_router')
+ self._mock_user_create('123456', 'fake_admin_user')
+ self._mock_tenant_create('123456', 'fake_admin_tenant')
+ self._mock_network_create(iso_creds, '123456',
+ 'fake_admin_net')
+ self._mock_subnet_create(iso_creds, '123456',
+ 'fake_admin_subnet')
+ self._mock_router_create('123456', 'fake_admin_router')
self._mock_list_roles('123456', 'admin')
iso_creds.get_admin_creds()
self.patch('tempest.services.identity.v2.json.identity_client.'
- 'IdentityClientJSON.delete_user')
+ 'IdentityClient.delete_user')
self.patch('tempest.services.identity.v2.json.identity_client.'
- 'IdentityClientJSON.delete_tenant')
+ 'IdentityClient.delete_tenant')
net = mock.patch.object(iso_creds.network_admin_client,
'delete_network')
net_mock = net.start()
@@ -392,7 +368,7 @@
'delete_router')
router_mock = router.start()
remove_router_interface_mock = self.patch(
- 'tempest.services.network.json.network_client.NetworkClientJSON.'
+ 'tempest.services.network.json.network_client.NetworkClient.'
'remove_router_interface_with_subnet_id')
return_values = ({'status': 200}, {'ports': []})
port_list_mock = mock.patch.object(iso_creds.network_admin_client,
@@ -408,7 +384,7 @@
return_values = (fake_http.fake_httplib({}, status=204), {})
remove_secgroup_mock = self.patch(
'tempest.services.network.json.network_client.'
- 'NetworkClientJSON.delete', return_value=return_values)
+ 'NetworkClient.delete', return_value=return_values)
iso_creds.clear_isolated_creds()
# Verify default security group delete
calls = remove_secgroup_mock.mock_calls
@@ -453,8 +429,7 @@
@mock.patch('tempest_lib.common.rest_client.RestClient')
def test_network_alt_creation(self, MockRestClient):
- iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password')
+ iso_creds = isolated_creds.IsolatedCreds(name='test class')
self._mock_assign_user_role()
self._mock_list_role()
self._mock_user_create('1234', 'fake_alt_user')
@@ -463,7 +438,7 @@
self._mock_subnet_create(iso_creds, '1234', 'fake_alt_subnet')
self._mock_router_create('1234', 'fake_alt_router')
router_interface_mock = self.patch(
- 'tempest.services.network.json.network_client.NetworkClientJSON.'
+ 'tempest.services.network.json.network_client.NetworkClient.'
'add_router_interface_with_subnet_id')
alt_creds = iso_creds.get_alt_creds()
router_interface_mock.called_once_with('1234', '1234')
@@ -479,8 +454,7 @@
@mock.patch('tempest_lib.common.rest_client.RestClient')
def test_network_admin_creation(self, MockRestClient):
- iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password')
+ iso_creds = isolated_creds.IsolatedCreds(name='test class')
self._mock_assign_user_role()
self._mock_user_create('1234', 'fake_admin_user')
self._mock_tenant_create('1234', 'fake_admin_tenant')
@@ -488,7 +462,7 @@
self._mock_subnet_create(iso_creds, '1234', 'fake_admin_subnet')
self._mock_router_create('1234', 'fake_admin_router')
router_interface_mock = self.patch(
- 'tempest.services.network.json.network_client.NetworkClientJSON.'
+ 'tempest.services.network.json.network_client.NetworkClient.'
'add_router_interface_with_subnet_id')
self._mock_list_roles('123456', 'admin')
admin_creds = iso_creds.get_admin_creds()
@@ -512,7 +486,6 @@
'dhcp': False,
}
iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password',
network_resources=net_dict)
self._mock_assign_user_role()
self._mock_list_role()
@@ -548,7 +521,6 @@
'dhcp': False,
}
iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password',
network_resources=net_dict)
self._mock_assign_user_role()
self._mock_list_role()
@@ -566,7 +538,6 @@
'dhcp': False,
}
iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password',
network_resources=net_dict)
self._mock_assign_user_role()
self._mock_list_role()
@@ -584,7 +555,6 @@
'dhcp': True,
}
iso_creds = isolated_creds.IsolatedCreds(name='test class',
- password='fake_password',
network_resources=net_dict)
self._mock_assign_user_role()
self._mock_list_role()
diff --git a/tempest/thirdparty/boto/test_ec2_instance_run.py b/tempest/thirdparty/boto/test_ec2_instance_run.py
index b7f0e81..920f602 100644
--- a/tempest/thirdparty/boto/test_ec2_instance_run.py
+++ b/tempest/thirdparty/boto/test_ec2_instance_run.py
@@ -14,8 +14,8 @@
# under the License.
from oslo_log import log as logging
-from tempest_lib.common.utils import data_utils
+from tempest.common.utils import data_utils
from tempest.common.utils.linux import remote_client
from tempest import config
from tempest import exceptions
diff --git a/tempest/thirdparty/boto/test_ec2_keys.py b/tempest/thirdparty/boto/test_ec2_keys.py
index 58a5776..1b58cb4 100644
--- a/tempest/thirdparty/boto/test_ec2_keys.py
+++ b/tempest/thirdparty/boto/test_ec2_keys.py
@@ -13,8 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
+from tempest.common.utils import data_utils
from tempest import test
from tempest.thirdparty.boto import test as boto_test
diff --git a/tempest/thirdparty/boto/test_ec2_security_groups.py b/tempest/thirdparty/boto/test_ec2_security_groups.py
index 94fab09..88ff154 100644
--- a/tempest/thirdparty/boto/test_ec2_security_groups.py
+++ b/tempest/thirdparty/boto/test_ec2_security_groups.py
@@ -13,8 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
+from tempest.common.utils import data_utils
from tempest import test
from tempest.thirdparty.boto import test as boto_test
diff --git a/tempest/thirdparty/boto/test_s3_buckets.py b/tempest/thirdparty/boto/test_s3_buckets.py
index 45401fd..f008973 100644
--- a/tempest/thirdparty/boto/test_s3_buckets.py
+++ b/tempest/thirdparty/boto/test_s3_buckets.py
@@ -13,8 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.common.utils import data_utils
-
+from tempest.common.utils import data_utils
from tempest import test
from tempest.thirdparty.boto import test as boto_test
diff --git a/tempest/thirdparty/boto/test_s3_ec2_images.py b/tempest/thirdparty/boto/test_s3_ec2_images.py
index 1521249..c41c7ac 100644
--- a/tempest/thirdparty/boto/test_s3_ec2_images.py
+++ b/tempest/thirdparty/boto/test_s3_ec2_images.py
@@ -15,8 +15,7 @@
import os
-from tempest_lib.common.utils import data_utils
-
+from tempest.common.utils import data_utils
from tempest import config
from tempest import test
from tempest.thirdparty.boto import test as boto_test
diff --git a/tempest/thirdparty/boto/test_s3_objects.py b/tempest/thirdparty/boto/test_s3_objects.py
index dba231c..c42d85c 100644
--- a/tempest/thirdparty/boto/test_s3_objects.py
+++ b/tempest/thirdparty/boto/test_s3_objects.py
@@ -16,8 +16,8 @@
import contextlib
import boto.s3.key
-from tempest_lib.common.utils import data_utils
+from tempest.common.utils import data_utils
from tempest import test
from tempest.thirdparty.boto import test as boto_test
diff --git a/tox.ini b/tox.ini
index b495fd6..cf7013d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -13,13 +13,7 @@
[testenv]
setenv = VIRTUAL_ENV={envdir}
OS_TEST_PATH=./tempest/tests
-passenv = OS_STDOUT_CAPTURE
- OS_STDERR_CAPTURE
- OS_TEST_TIMEOUT
- OS_TEST_LOCK_PATH
- OS_TEST_PATH
- TEMPEST_CONFIG
- TEMPEST_CONFIG_DIR
+passenv = OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_TEST_TIMEOUT OS_TEST_LOCK_PATH OS_TEST_PATH TEMPEST_CONFIG TEMPEST_CONFIG_DIR http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
usedevelop = True
install_command = pip install -U {opts} {packages}
whitelist_externals = *