Merge "Remove migrated utils code"
diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst
index 08f37cc..f772aa3 100644
--- a/doc/source/configuration.rst
+++ b/doc/source/configuration.rst
@@ -45,6 +45,8 @@
#. To enable tenant_isolation in the auth section with the
allow_tenant_isolation option.
+This is also the currently the default credential provider enabled by tempest,
+due to it's common use and ease of configuration.
Locking Test Accounts
"""""""""""""""""""""
@@ -58,9 +60,8 @@
accounts.yaml before executing any of its tests so that each class is isolated
like in tenant isolation.
-Currently, this mechanism has some limitations, first only non-admin users with
-the same role set can be used at one time. The second limitation is around
-networking, locking test accounts will only work with a single flat network as
+Currently, this mechanism has some limitations, mostly around networking. The
+locking test accounts provider will only work with a single flat network as
the default for each tenant/project. If another network configuration is used
in your cloud you might face unexpected failures.
@@ -73,6 +74,8 @@
starvation issue when running in parallel make sure you have at least 2
times the number of parallel workers you are using to execute tempest
available in the file.
+
+ You can check the sample file packaged in tempest for the yaml format
#. Provide tempest with the location of you accounts.yaml file with the
test_accounts_file option in the auth section
@@ -85,8 +88,7 @@
to use it if parallel execution isn't needed. If the role restrictions were too
limiting with the locking accounts provider and tenant isolation is not wanted
then you can use the non-locking test accounts credential provider without the
-accounts.yaml file. This is also the currently the default configuration for
-tempest, since it doesn't require elevated permissions or the extra file.
+accounts.yaml file.
To use the non-locking test accounts provider you have 2 ways to configure it.
First you can specify the sets of credentials in the configuration file like
@@ -102,14 +104,19 @@
#. alt_password
#. alt_tenant_name
-You should use this if you need to specify credentials with different roles.
-(i.e. you want to use admin credentials) However, this isn't a requirement for
-its usage.
+The only restriction with using the traditional config options for credentials
+is that if a test requires specific roles on accounts these tests can not be
+run. This is because the config options do not give sufficient flexibility to
+describe the roles assigned to a user for running the tests.
You also can use the accounts.yaml file to specify the credentials used for
testing. This will just allocate them serially so you only need to provide
a pair of credentials. Do note that all the restrictions associated with
-locking test accounts applies to using the accounts.yaml file this way too.
+locking test accounts applies to using the accounts.yaml file this way too,
+except since you can't run in parallel only 2 of each type of credential is
+required to run. However, the limitation on tests which require specific roles
+does not apply here.
+
The procedure for doing this is very similar to with the locking accounts
provider just don't set the locking_credentials_provider to true and you
only should need a single pair of credentials.
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index d81d3bb..a2db4f4 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -156,6 +156,7 @@
# The endpoint type to use for the baremetal provisioning service
# (string value)
+# Allowed values: public, admin, internal, publicURL, adminURL, internalURL
#endpoint_type = publicURL
# Timeout for Ironic node to completely provision (integer value)
@@ -341,6 +342,7 @@
#region =
# The endpoint type to use for the compute service. (string value)
+# Allowed values: public, admin, internal, publicURL, adminURL, internalURL
#endpoint_type = publicURL
# Path to a private key file for SSH access to remote hosts (string
@@ -467,6 +469,7 @@
# The endpoint type to use for the data processing service. (string
# value)
+# Allowed values: public, admin, internal, publicURL, adminURL, internalURL
#endpoint_type = publicURL
@@ -550,6 +553,7 @@
#region = RegionOne
# The endpoint type to use for the identity service. (string value)
+# Allowed values: public, admin, internal, publicURL, adminURL, internalURL
#endpoint_type = publicURL
# Username to use for Nova API requests. (string value)
@@ -631,6 +635,7 @@
#region =
# The endpoint type to use for the image service. (string value)
+# Allowed values: public, admin, internal, publicURL, adminURL, internalURL
#endpoint_type = publicURL
# http accessible image (string value)
@@ -739,6 +744,7 @@
#region =
# The endpoint type to use for the network service. (string value)
+# Allowed values: public, admin, internal, publicURL, adminURL, internalURL
#endpoint_type = publicURL
# The cidr block to allocate tenant ipv4 subnets from (string value)
@@ -781,6 +787,7 @@
# vnic_type to use when Launching instances with pre-configured ports.
# Supported ports are: ['normal','direct','macvtap'] (string value)
+# Allowed values: <None>, normal, direct, macvtap
#port_vnic_type = <None>
@@ -819,6 +826,7 @@
# The endpoint type to use for the object-store service. (string
# value)
+# Allowed values: public, admin, internal, publicURL, adminURL, internalURL
#endpoint_type = publicURL
# Number of seconds to time on waiting for a container to container
@@ -884,6 +892,7 @@
# The endpoint type to use for the orchestration service. (string
# value)
+# Allowed values: public, admin, internal, publicURL, adminURL, internalURL
#endpoint_type = publicURL
# Time in seconds between build status checks. (integer value)
@@ -950,6 +959,7 @@
# DHCP client used by images to renew DCHP lease. If left empty,
# update operation will be skipped. Supported clients: "udhcpc",
# "dhclient" (string value)
+# Allowed values: udhcpc, dhclient
#dhcp_client = udhcpc
@@ -1049,6 +1059,7 @@
#catalog_type = metering
# The endpoint type to use for the telemetry service. (string value)
+# Allowed values: public, admin, internal, publicURL, adminURL, internalURL
#endpoint_type = publicURL
# This variable is used as flag to enable notification tests (boolean
@@ -1078,6 +1089,7 @@
#region =
# The endpoint type to use for the volume service. (string value)
+# Allowed values: public, admin, internal, publicURL, adminURL, internalURL
#endpoint_type = publicURL
# Name of the backend1 (must be declared in cinder.conf) (string
diff --git a/tempest/api/compute/admin/test_agents.py b/tempest/api/compute/admin/test_agents.py
index 5f879a3..f801f8a 100644
--- a/tempest/api/compute/admin/test_agents.py
+++ b/tempest/api/compute/admin/test_agents.py
@@ -28,8 +28,8 @@
"""
@classmethod
- def resource_setup(cls):
- super(AgentsAdminTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(AgentsAdminTestJSON, cls).setup_clients()
cls.client = cls.os_adm.agents_client
def setUp(self):
diff --git a/tempest/api/compute/admin/test_aggregates.py b/tempest/api/compute/admin/test_aggregates.py
index 1753c17..b5e969e 100644
--- a/tempest/api/compute/admin/test_aggregates.py
+++ b/tempest/api/compute/admin/test_aggregates.py
@@ -30,9 +30,13 @@
_host_key = 'OS-EXT-SRV-ATTR:host'
@classmethod
+ def setup_clients(cls):
+ super(AggregatesAdminTestJSON, cls).setup_clients()
+ cls.client = cls.os_adm.aggregates_client
+
+ @classmethod
def resource_setup(cls):
super(AggregatesAdminTestJSON, cls).resource_setup()
- cls.client = cls.os_adm.aggregates_client
cls.aggregate_name_prefix = 'test_aggregate_'
cls.az_name_prefix = 'test_az_'
diff --git a/tempest/api/compute/admin/test_aggregates_negative.py b/tempest/api/compute/admin/test_aggregates_negative.py
index 0ecc593..07c8c4e 100644
--- a/tempest/api/compute/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/admin/test_aggregates_negative.py
@@ -28,10 +28,14 @@
"""
@classmethod
- def resource_setup(cls):
- super(AggregatesAdminNegativeTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(AggregatesAdminNegativeTestJSON, cls).setup_clients()
cls.client = cls.os_adm.aggregates_client
cls.user_client = cls.aggregates_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(AggregatesAdminNegativeTestJSON, cls).resource_setup()
cls.aggregate_name_prefix = 'test_aggregate_'
cls.az_name_prefix = 'test_az_'
diff --git a/tempest/api/compute/admin/test_availability_zone.py b/tempest/api/compute/admin/test_availability_zone.py
index 9d24b00..eadc15a 100644
--- a/tempest/api/compute/admin/test_availability_zone.py
+++ b/tempest/api/compute/admin/test_availability_zone.py
@@ -24,8 +24,8 @@
_api_version = 2
@classmethod
- def resource_setup(cls):
- super(AZAdminV2TestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(AZAdminV2TestJSON, cls).setup_clients()
cls.client = cls.availability_zone_admin_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/admin/test_availability_zone_negative.py b/tempest/api/compute/admin/test_availability_zone_negative.py
index 69bee39..d6e577e 100644
--- a/tempest/api/compute/admin/test_availability_zone_negative.py
+++ b/tempest/api/compute/admin/test_availability_zone_negative.py
@@ -25,8 +25,8 @@
"""
@classmethod
- def resource_setup(cls):
- super(AZAdminNegativeTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(AZAdminNegativeTestJSON, cls).setup_clients()
cls.non_adm_client = cls.availability_zone_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/admin/test_fixed_ips.py b/tempest/api/compute/admin/test_fixed_ips.py
index 820b9b0..acfd659 100644
--- a/tempest/api/compute/admin/test_fixed_ips.py
+++ b/tempest/api/compute/admin/test_fixed_ips.py
@@ -23,12 +23,20 @@
class FixedIPsTestJson(base.BaseV2ComputeAdminTest):
@classmethod
- def resource_setup(cls):
- super(FixedIPsTestJson, cls).resource_setup()
+ def skip_checks(cls):
+ super(FixedIPsTestJson, cls).skip_checks()
if CONF.service_available.neutron:
msg = ("%s skipped as neutron is available" % cls.__name__)
raise cls.skipException(msg)
+
+ @classmethod
+ def setup_clients(cls):
+ super(FixedIPsTestJson, cls).setup_clients()
cls.client = cls.os_adm.fixed_ips_client
+
+ @classmethod
+ 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'])
for ip_set in server['addresses']:
diff --git a/tempest/api/compute/admin/test_fixed_ips_negative.py b/tempest/api/compute/admin/test_fixed_ips_negative.py
index 39ceda3..052ed71 100644
--- a/tempest/api/compute/admin/test_fixed_ips_negative.py
+++ b/tempest/api/compute/admin/test_fixed_ips_negative.py
@@ -24,13 +24,21 @@
class FixedIPsNegativeTestJson(base.BaseV2ComputeAdminTest):
@classmethod
- def resource_setup(cls):
- super(FixedIPsNegativeTestJson, cls).resource_setup()
+ def skip_checks(cls):
+ super(FixedIPsNegativeTestJson, cls).skip_checks()
if CONF.service_available.neutron:
msg = ("%s skipped as neutron is available" % cls.__name__)
raise cls.skipException(msg)
+
+ @classmethod
+ def setup_clients(cls):
+ super(FixedIPsNegativeTestJson, cls).setup_clients()
cls.client = cls.os_adm.fixed_ips_client
cls.non_admin_client = cls.fixed_ips_client
+
+ @classmethod
+ 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'])
for ip_set in server['addresses']:
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index 2c907f7..df4624c 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -29,14 +29,22 @@
"""
@classmethod
- def resource_setup(cls):
- super(FlavorsAdminTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(FlavorsAdminTestJSON, cls).skip_checks()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
+ @classmethod
+ def setup_clients(cls):
+ super(FlavorsAdminTestJSON, cls).setup_clients()
cls.client = cls.os_adm.flavors_client
cls.user_client = cls.os.flavors_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(FlavorsAdminTestJSON, cls).resource_setup()
+
cls.flavor_name_prefix = 'test_flavor_'
cls.ram = 512
cls.vcpus = 1
diff --git a/tempest/api/compute/admin/test_flavors_access.py b/tempest/api/compute/admin/test_flavors_access.py
index e5a0ed9..b7edcab 100644
--- a/tempest/api/compute/admin/test_flavors_access.py
+++ b/tempest/api/compute/admin/test_flavors_access.py
@@ -27,14 +27,21 @@
"""
@classmethod
- def resource_setup(cls):
- super(FlavorsAccessTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(FlavorsAccessTestJSON, cls).skip_checks()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
- # Compute admin flavor client
+ @classmethod
+ def setup_clients(cls):
+ super(FlavorsAccessTestJSON, cls).setup_clients()
cls.client = cls.os_adm.flavors_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(FlavorsAccessTestJSON, cls).resource_setup()
+
# Non admin tenant ID
cls.tenant_id = cls.flavors_client.tenant_id
# Compute admin tenant ID
diff --git a/tempest/api/compute/admin/test_flavors_access_negative.py b/tempest/api/compute/admin/test_flavors_access_negative.py
index 44b7fd1..97930c1 100644
--- a/tempest/api/compute/admin/test_flavors_access_negative.py
+++ b/tempest/api/compute/admin/test_flavors_access_negative.py
@@ -30,13 +30,21 @@
"""
@classmethod
- def resource_setup(cls):
- super(FlavorsAccessNegativeTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(FlavorsAccessNegativeTestJSON, cls).skip_checks()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
+ @classmethod
+ def setup_clients(cls):
+ super(FlavorsAccessNegativeTestJSON, cls).setup_clients()
cls.client = cls.os_adm.flavors_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(FlavorsAccessNegativeTestJSON, cls).resource_setup()
+
cls.tenant_id = cls.flavors_client.tenant_id
cls.flavor_name_prefix = 'test_flavor_access_'
cls.ram = 512
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs.py b/tempest/api/compute/admin/test_flavors_extra_specs.py
index 2af483d..b83a063 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs.py
@@ -28,13 +28,20 @@
"""
@classmethod
- def resource_setup(cls):
- super(FlavorsExtraSpecsTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(FlavorsExtraSpecsTestJSON, cls).skip_checks()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
+ @classmethod
+ def setup_clients(cls):
+ super(FlavorsExtraSpecsTestJSON, cls).setup_clients()
cls.client = cls.os_adm.flavors_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(FlavorsExtraSpecsTestJSON, cls).resource_setup()
flavor_name = data_utils.rand_name('test_flavor')
ram = 512
vcpus = 1
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 70e8945..2236a8a 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
@@ -29,13 +29,21 @@
"""
@classmethod
- def resource_setup(cls):
- super(FlavorsExtraSpecsNegativeTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(FlavorsExtraSpecsNegativeTestJSON, cls).skip_checks()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
+ @classmethod
+ def setup_clients(cls):
+ super(FlavorsExtraSpecsNegativeTestJSON, cls).setup_clients()
cls.client = cls.os_adm.flavors_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(FlavorsExtraSpecsNegativeTestJSON, cls).resource_setup()
+
flavor_name = data_utils.rand_name('test_flavor')
ram = 512
vcpus = 1
diff --git a/tempest/api/compute/admin/test_flavors_negative.py b/tempest/api/compute/admin/test_flavors_negative.py
index bb56cb2..c7eb9ae 100644
--- a/tempest/api/compute/admin/test_flavors_negative.py
+++ b/tempest/api/compute/admin/test_flavors_negative.py
@@ -36,14 +36,21 @@
"""
@classmethod
- def resource_setup(cls):
- super(FlavorsAdminNegativeTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(FlavorsAdminNegativeTestJSON, cls).skip_checks()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
+ @classmethod
+ def setup_clients(cls):
+ super(FlavorsAdminNegativeTestJSON, cls).setup_clients()
cls.client = cls.os_adm.flavors_client
cls.user_client = cls.os.flavors_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(FlavorsAdminNegativeTestJSON, cls).resource_setup()
cls.flavor_name_prefix = 'test_flavor_'
cls.ram = 512
cls.vcpus = 1
diff --git a/tempest/api/compute/admin/test_floating_ips_bulk.py b/tempest/api/compute/admin/test_floating_ips_bulk.py
index 7ca081a..3c5f507 100644
--- a/tempest/api/compute/admin/test_floating_ips_bulk.py
+++ b/tempest/api/compute/admin/test_floating_ips_bulk.py
@@ -31,9 +31,13 @@
"""
@classmethod
+ def setup_clients(cls):
+ super(FloatingIPsBulkAdminTestJSON, cls).setup_clients()
+ cls.client = cls.os_adm.floating_ips_client
+
+ @classmethod
def resource_setup(cls):
super(FloatingIPsBulkAdminTestJSON, cls).resource_setup()
- cls.client = cls.os_adm.floating_ips_client
cls.ip_range = CONF.compute.floating_ip_range
cls.verify_unallocated_floating_ip_range(cls.ip_range)
diff --git a/tempest/api/compute/admin/test_hosts.py b/tempest/api/compute/admin/test_hosts.py
index bef5d1f..e525358 100644
--- a/tempest/api/compute/admin/test_hosts.py
+++ b/tempest/api/compute/admin/test_hosts.py
@@ -24,8 +24,8 @@
"""
@classmethod
- def resource_setup(cls):
- super(HostsAdminTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(HostsAdminTestJSON, cls).setup_clients()
cls.client = cls.os_adm.hosts_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/admin/test_hosts_negative.py b/tempest/api/compute/admin/test_hosts_negative.py
index e26ea5a..95be59e 100644
--- a/tempest/api/compute/admin/test_hosts_negative.py
+++ b/tempest/api/compute/admin/test_hosts_negative.py
@@ -26,8 +26,8 @@
"""
@classmethod
- def resource_setup(cls):
- super(HostsAdminNegativeTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(HostsAdminNegativeTestJSON, cls).setup_clients()
cls.client = cls.os_adm.hosts_client
cls.non_admin_client = cls.os.hosts_client
diff --git a/tempest/api/compute/admin/test_hypervisor.py b/tempest/api/compute/admin/test_hypervisor.py
index c65bded..5e83e95 100644
--- a/tempest/api/compute/admin/test_hypervisor.py
+++ b/tempest/api/compute/admin/test_hypervisor.py
@@ -24,8 +24,8 @@
"""
@classmethod
- def resource_setup(cls):
- super(HypervisorAdminTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(HypervisorAdminTestJSON, cls).setup_clients()
cls.client = cls.os_adm.hypervisor_client
def _list_hypervisors(self):
diff --git a/tempest/api/compute/admin/test_hypervisor_negative.py b/tempest/api/compute/admin/test_hypervisor_negative.py
index 0bf1711..c7de6be 100644
--- a/tempest/api/compute/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/admin/test_hypervisor_negative.py
@@ -29,8 +29,8 @@
"""
@classmethod
- def resource_setup(cls):
- super(HypervisorAdminNegativeTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(HypervisorAdminNegativeTestJSON, cls).setup_clients()
cls.client = cls.os_adm.hypervisor_client
cls.non_adm_client = cls.hypervisor_client
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 1a86b2d..6565810 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log.py
@@ -23,8 +23,8 @@
class InstanceUsageAuditLogTestJSON(base.BaseV2ComputeAdminTest):
@classmethod
- def resource_setup(cls):
- super(InstanceUsageAuditLogTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(InstanceUsageAuditLogTestJSON, cls).setup_clients()
cls.adm_client = cls.os_adm.instance_usages_audit_log_client
@test.attr(type='gate')
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 b1be1ed..e9f3371 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
@@ -25,8 +25,8 @@
class InstanceUsageAuditLogNegativeTestJSON(base.BaseV2ComputeAdminTest):
@classmethod
- def resource_setup(cls):
- super(InstanceUsageAuditLogNegativeTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(InstanceUsageAuditLogNegativeTestJSON, cls).setup_clients()
cls.adm_client = cls.os_adm.instance_usages_audit_log_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/admin/test_migrations.py b/tempest/api/compute/admin/test_migrations.py
index 67e4fe3..3c31e77 100644
--- a/tempest/api/compute/admin/test_migrations.py
+++ b/tempest/api/compute/admin/test_migrations.py
@@ -24,8 +24,8 @@
class MigrationsAdminTest(base.BaseV2ComputeAdminTest):
@classmethod
- def resource_setup(cls):
- super(MigrationsAdminTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(MigrationsAdminTest, cls).setup_clients()
cls.client = cls.os_adm.migrations_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/admin/test_networks.py b/tempest/api/compute/admin/test_networks.py
index fa72c01..c20d483 100644
--- a/tempest/api/compute/admin/test_networks.py
+++ b/tempest/api/compute/admin/test_networks.py
@@ -30,8 +30,8 @@
"""
@classmethod
- def resource_setup(cls):
- super(NetworksTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(NetworksTest, cls).setup_clients()
cls.client = cls.os_adm.networks_client
@test.idempotent_id('d206d211-8912-486f-86e2-a9d090d1f416')
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index ba0ea1e..773f23e 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -34,9 +34,13 @@
super(QuotasAdminTestJSON, self).setUp()
@classmethod
+ def setup_clients(cls):
+ super(QuotasAdminTestJSON, cls).setup_clients()
+ cls.adm_client = cls.os_adm.quotas_client
+
+ @classmethod
def resource_setup(cls):
super(QuotasAdminTestJSON, cls).resource_setup()
- cls.adm_client = cls.os_adm.quotas_client
# NOTE(afazekas): these test cases should always create and use a new
# tenant most of them should be skipped if we can't do that
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
index 6140a0b..caa329e 100644
--- a/tempest/api/compute/admin/test_quotas_negative.py
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -27,12 +27,15 @@
force_tenant_isolation = True
@classmethod
- def resource_setup(cls):
- super(QuotasAdminNegativeTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(QuotasAdminNegativeTestJSON, cls).setup_clients()
cls.client = cls.os.quotas_client
cls.adm_client = cls.os_adm.quotas_client
cls.sg_client = cls.security_groups_client
+ @classmethod
+ def resource_setup(cls):
+ super(QuotasAdminNegativeTestJSON, cls).resource_setup()
# NOTE(afazekas): these test cases should always create and use a new
# tenant most of them should be skipped if we can't do that
cls.demo_tenant_id = cls.client.tenant_id
diff --git a/tempest/api/compute/admin/test_security_groups.py b/tempest/api/compute/admin/test_security_groups.py
index 388f249..578f73b 100644
--- a/tempest/api/compute/admin/test_security_groups.py
+++ b/tempest/api/compute/admin/test_security_groups.py
@@ -26,8 +26,8 @@
class SecurityGroupsTestAdminJSON(base.BaseV2ComputeAdminTest):
@classmethod
- def resource_setup(cls):
- super(SecurityGroupsTestAdminJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(SecurityGroupsTestAdminJSON, cls).setup_clients()
cls.adm_client = cls.os_adm.security_groups_client
cls.client = cls.security_groups_client
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 229b816..c872184 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -28,12 +28,16 @@
_host_key = 'OS-EXT-SRV-ATTR:host'
@classmethod
- def resource_setup(cls):
- super(ServersAdminTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(ServersAdminTestJSON, cls).setup_clients()
cls.client = cls.os_adm.servers_client
cls.non_admin_client = cls.servers_client
cls.flavors_client = cls.os_adm.flavors_client
+ @classmethod
+ def resource_setup(cls):
+ super(ServersAdminTestJSON, cls).resource_setup()
+
cls.s1_name = data_utils.rand_name('server')
server = cls.create_test_server(name=cls.s1_name,
wait_until='ACTIVE')
diff --git a/tempest/api/compute/admin/test_servers_negative.py b/tempest/api/compute/admin/test_servers_negative.py
index 47373a3..edcb052 100644
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -33,11 +33,15 @@
"""
@classmethod
- def resource_setup(cls):
- super(ServersAdminNegativeTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(ServersAdminNegativeTestJSON, cls).setup_clients()
cls.client = cls.os_adm.servers_client
cls.non_adm_client = cls.servers_client
cls.flavors_client = cls.os_adm.flavors_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(ServersAdminNegativeTestJSON, cls).resource_setup()
cls.tenant_id = cls.client.tenant_id
cls.s1_name = data_utils.rand_name('server')
diff --git a/tempest/api/compute/admin/test_services.py b/tempest/api/compute/admin/test_services.py
index a6f79aa..932a74e 100644
--- a/tempest/api/compute/admin/test_services.py
+++ b/tempest/api/compute/admin/test_services.py
@@ -25,8 +25,8 @@
"""
@classmethod
- def resource_setup(cls):
- super(ServicesAdminTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(ServicesAdminTestJSON, cls).setup_clients()
cls.client = cls.os_adm.services_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/admin/test_services_negative.py b/tempest/api/compute/admin/test_services_negative.py
index f97b343..2d4ec51 100644
--- a/tempest/api/compute/admin/test_services_negative.py
+++ b/tempest/api/compute/admin/test_services_negative.py
@@ -25,8 +25,8 @@
"""
@classmethod
- def resource_setup(cls):
- super(ServicesAdminNegativeTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(ServicesAdminNegativeTestJSON, cls).setup_clients()
cls.client = cls.os_adm.services_client
cls.non_admin_client = cls.services_client
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage.py b/tempest/api/compute/admin/test_simple_tenant_usage.py
index be62b1d..cf7b672 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage.py
@@ -23,10 +23,14 @@
class TenantUsagesTestJSON(base.BaseV2ComputeAdminTest):
@classmethod
- def resource_setup(cls):
- super(TenantUsagesTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(TenantUsagesTestJSON, cls).setup_clients()
cls.adm_client = cls.os_adm.tenant_usages_client
cls.client = cls.os.tenant_usages_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(TenantUsagesTestJSON, cls).resource_setup()
cls.tenant_id = cls.client.tenant_id
# Create a server in the demo tenant
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 38657a4..a83d727 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
@@ -23,11 +23,14 @@
class TenantUsagesNegativeTestJSON(base.BaseV2ComputeAdminTest):
@classmethod
- def resource_setup(cls):
- super(TenantUsagesNegativeTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(TenantUsagesNegativeTestJSON, cls).setup_clients()
cls.adm_client = cls.os_adm.tenant_usages_client
cls.client = cls.os.tenant_usages_client
- cls.identity_client = cls._get_identity_admin_client()
+
+ @classmethod
+ def resource_setup(cls):
+ super(TenantUsagesNegativeTestJSON, cls).resource_setup()
now = datetime.datetime.now()
cls.start = cls._parse_strtime(now - datetime.timedelta(days=1))
cls.end = cls._parse_strtime(now + datetime.timedelta(days=1))
diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py
index b9056c7..8a66282 100644
--- a/tempest/api/compute/flavors/test_flavors.py
+++ b/tempest/api/compute/flavors/test_flavors.py
@@ -24,8 +24,8 @@
_min_ram = 'minRam'
@classmethod
- def resource_setup(cls):
- super(FlavorsV2TestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(FlavorsV2TestJSON, cls).setup_clients()
cls.client = cls.flavors_client
@test.attr(type='smoke')
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index f1b8203..ab21ad7 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -27,14 +27,21 @@
class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(ImagesMetadataTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(ImagesMetadataTestJSON, cls).skip_checks()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
+ @classmethod
+ def setup_clients(cls):
+ super(ImagesMetadataTestJSON, cls).setup_clients()
cls.glance_client = cls.os.image_client
cls.client = cls.images_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(ImagesMetadataTestJSON, cls).resource_setup()
cls.image_id = None
name = data_utils.rand_name('image')
diff --git a/tempest/api/compute/images/test_image_metadata_negative.py b/tempest/api/compute/images/test_image_metadata_negative.py
index e31d04e..3c2302a 100644
--- a/tempest/api/compute/images/test_image_metadata_negative.py
+++ b/tempest/api/compute/images/test_image_metadata_negative.py
@@ -23,8 +23,8 @@
class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(ImagesMetadataTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(ImagesMetadataTestJSON, cls).setup_clients()
cls.client = cls.images_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/images/test_images.py b/tempest/api/compute/images/test_images.py
index 7ec51ef..53d0e95 100644
--- a/tempest/api/compute/images/test_images.py
+++ b/tempest/api/compute/images/test_images.py
@@ -24,17 +24,19 @@
class ImagesTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(ImagesTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(ImagesTestJSON, cls).skip_checks()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
-
if not CONF.compute_feature_enabled.snapshot:
skip_msg = ("%s skipped as instance snapshotting is not supported"
% cls.__name__)
raise cls.skipException(skip_msg)
+ @classmethod
+ def setup_clients(cls):
+ super(ImagesTestJSON, cls).setup_clients()
cls.client = cls.images_client
cls.servers_client = cls.servers_client
diff --git a/tempest/api/compute/images/test_images_negative.py b/tempest/api/compute/images/test_images_negative.py
index 451890e..10e468e 100644
--- a/tempest/api/compute/images/test_images_negative.py
+++ b/tempest/api/compute/images/test_images_negative.py
@@ -25,17 +25,19 @@
class ImagesNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(ImagesNegativeTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(ImagesNegativeTestJSON, cls).skip_checks()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
-
if not CONF.compute_feature_enabled.snapshot:
skip_msg = ("%s skipped as instance snapshotting is not supported"
% cls.__name__)
raise cls.skipException(skip_msg)
+ @classmethod
+ def setup_clients(cls):
+ super(ImagesNegativeTestJSON, cls).setup_clients()
cls.client = cls.images_client
cls.servers_client = cls.servers_client
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index f6041ce..b5edc1d 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -47,9 +47,8 @@
self.__class__.server_id = self.rebuild_server(self.server_id)
@classmethod
- def resource_setup(cls):
- super(ImagesOneServerTestJSON, cls).resource_setup()
- cls.client = cls.images_client
+ def skip_checks(cls):
+ super(ImagesOneServerTestJSON, cls).skip_checks()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
@@ -59,6 +58,14 @@
% cls.__name__)
raise cls.skipException(skip_msg)
+ @classmethod
+ def setup_clients(cls):
+ super(ImagesOneServerTestJSON, cls).setup_clients()
+ cls.client = cls.images_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(ImagesOneServerTestJSON, cls).resource_setup()
server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
diff --git a/tempest/api/compute/images/test_images_oneserver_negative.py b/tempest/api/compute/images/test_images_oneserver_negative.py
index 1554f86..f1de320 100644
--- a/tempest/api/compute/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/images/test_images_oneserver_negative.py
@@ -56,9 +56,8 @@
self.__class__.server_id = self.rebuild_server(self.server_id)
@classmethod
- def resource_setup(cls):
- super(ImagesOneServerNegativeTestJSON, cls).resource_setup()
- cls.client = cls.images_client
+ def skip_checks(cls):
+ super(ImagesOneServerNegativeTestJSON, cls).skip_checks()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
@@ -68,6 +67,14 @@
% cls.__name__)
raise cls.skipException(skip_msg)
+ @classmethod
+ def setup_clients(cls):
+ super(ImagesOneServerNegativeTestJSON, cls).setup_clients()
+ cls.client = cls.images_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(ImagesOneServerNegativeTestJSON, cls).resource_setup()
server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index c91d0ff..f5a98ce 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -32,14 +32,22 @@
class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(ListImageFiltersTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(ListImageFiltersTestJSON, cls).skip_checks()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
+
+ @classmethod
+ def setup_clients(cls):
+ super(ListImageFiltersTestJSON, cls).setup_clients()
cls.client = cls.images_client
cls.glance_client = cls.os.image_client
+ @classmethod
+ def resource_setup(cls):
+ super(ListImageFiltersTestJSON, cls).resource_setup()
+
def _create_image():
name = data_utils.rand_name('image')
body = cls.glance_client.create_image(name=name,
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 c246186..204bf3e 100644
--- a/tempest/api/compute/images/test_list_image_filters_negative.py
+++ b/tempest/api/compute/images/test_list_image_filters_negative.py
@@ -25,11 +25,15 @@
class ListImageFiltersNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(ListImageFiltersNegativeTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(ListImageFiltersNegativeTestJSON, cls).skip_checks()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
+
+ @classmethod
+ def setup_clients(cls):
+ super(ListImageFiltersNegativeTestJSON, cls).setup_clients()
cls.client = cls.images_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/images/test_list_images.py b/tempest/api/compute/images/test_list_images.py
index 36451ec..7a7a363 100644
--- a/tempest/api/compute/images/test_list_images.py
+++ b/tempest/api/compute/images/test_list_images.py
@@ -23,11 +23,15 @@
class ListImagesTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(ListImagesTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(ListImagesTestJSON, cls).skip_checks()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
+
+ @classmethod
+ def setup_clients(cls):
+ super(ListImagesTestJSON, cls).setup_clients()
cls.client = cls.images_client
@test.attr(type='smoke')
diff --git a/tempest/api/compute/keypairs/test_keypairs.py b/tempest/api/compute/keypairs/test_keypairs.py
index d11de7b..6e59601 100644
--- a/tempest/api/compute/keypairs/test_keypairs.py
+++ b/tempest/api/compute/keypairs/test_keypairs.py
@@ -24,8 +24,8 @@
_api_version = 2
@classmethod
- def resource_setup(cls):
- super(KeyPairsV2TestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(KeyPairsV2TestJSON, cls).setup_clients()
cls.client = cls.keypairs_client
def _delete_keypair(self, keypair_name):
diff --git a/tempest/api/compute/keypairs/test_keypairs_negative.py b/tempest/api/compute/keypairs/test_keypairs_negative.py
index 02cd3f8..7a1a5e3 100644
--- a/tempest/api/compute/keypairs/test_keypairs_negative.py
+++ b/tempest/api/compute/keypairs/test_keypairs_negative.py
@@ -24,8 +24,8 @@
class KeyPairsNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(KeyPairsNegativeTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(KeyPairsNegativeTestJSON, cls).setup_clients()
cls.client = cls.keypairs_client
def _create_keypair(self, keypair_name, pub_key=None):
diff --git a/tempest/api/compute/servers/test_availability_zone.py b/tempest/api/compute/servers/test_availability_zone.py
index 5962042..f3650ac 100644
--- a/tempest/api/compute/servers/test_availability_zone.py
+++ b/tempest/api/compute/servers/test_availability_zone.py
@@ -24,8 +24,8 @@
_api_version = 2
@classmethod
- def resource_setup(cls):
- super(AZV2TestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(AZV2TestJSON, cls).setup_clients()
cls.client = cls.availability_zone_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index 8137d95..7f3716c 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -31,8 +31,18 @@
disk_config = 'AUTO'
@classmethod
- def resource_setup(cls):
+ def setup_credentials(cls):
cls.prepare_instance_network()
+ super(ServersTestJSON, cls).setup_credentials()
+
+ @classmethod
+ def setup_clients(cls):
+ super(ServersTestJSON, cls).setup_clients()
+ cls.client = cls.servers_client
+ cls.network_client = cls.os.network_client
+
+ @classmethod
+ def resource_setup(cls):
super(ServersTestJSON, cls).resource_setup()
cls.meta = {'hello': 'world'}
cls.accessIPv4 = '1.1.1.1'
@@ -41,8 +51,6 @@
file_contents = 'This is a test file.'
personality = [{'path': '/test.txt',
'contents': base64.b64encode(file_contents)}]
- cls.client = cls.servers_client
- cls.network_client = cls.os.network_client
disk_config = cls.disk_config
cls.server_initial = cls.create_test_server(name=cls.name,
meta=cls.meta,
@@ -194,9 +202,9 @@
disk_config = 'AUTO'
@classmethod
- def resource_setup(cls):
+ def setup_clients(cls):
cls.prepare_instance_network()
- super(ServersWithSpecificFlavorTestJSON, cls).resource_setup()
+ super(ServersWithSpecificFlavorTestJSON, cls).setup_clients()
cls.flavor_client = cls.os_adm.flavors_client
cls.client = cls.servers_client
@@ -277,8 +285,8 @@
disk_config = 'MANUAL'
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(ServersTestManualDisk, cls).skip_checks()
if not CONF.compute_feature_enabled.disk_config:
msg = "DiskConfig extension not enabled."
raise cls.skipException(msg)
- super(ServersTestManualDisk, cls).resource_setup()
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
index 6155958..7160265 100644
--- a/tempest/api/compute/servers/test_delete_server.py
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -28,8 +28,8 @@
# for preventing "Quota exceeded for instances"
@classmethod
- def resource_setup(cls):
- super(DeleteServersTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(DeleteServersTestJSON, cls).setup_clients()
cls.client = cls.servers_client
@test.attr(type='gate')
@@ -141,8 +141,8 @@
# for preventing "Quota exceeded for instances".
@classmethod
- def resource_setup(cls):
- super(DeleteServersAdminTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(DeleteServersAdminTestJSON, cls).setup_clients()
cls.non_admin_client = cls.servers_client
cls.admin_client = cls.os_adm.servers_client
diff --git a/tempest/api/compute/servers/test_disk_config.py b/tempest/api/compute/servers/test_disk_config.py
index a15a9b7..c4cb2bd 100644
--- a/tempest/api/compute/servers/test_disk_config.py
+++ b/tempest/api/compute/servers/test_disk_config.py
@@ -25,12 +25,20 @@
class ServerDiskConfigTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(ServerDiskConfigTestJSON, cls).skip_checks()
if not CONF.compute_feature_enabled.disk_config:
msg = "DiskConfig extension not enabled."
raise cls.skipException(msg)
- super(ServerDiskConfigTestJSON, cls).resource_setup()
+
+ @classmethod
+ def setup_clients(cls):
+ super(ServerDiskConfigTestJSON, cls).setup_clients()
cls.client = cls.os.servers_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(ServerDiskConfigTestJSON, cls).resource_setup()
server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
diff --git a/tempest/api/compute/servers/test_instance_actions.py b/tempest/api/compute/servers/test_instance_actions.py
index b00221c..c804170 100644
--- a/tempest/api/compute/servers/test_instance_actions.py
+++ b/tempest/api/compute/servers/test_instance_actions.py
@@ -20,9 +20,13 @@
class InstanceActionsTestJSON(base.BaseV2ComputeTest):
@classmethod
+ def setup_clients(cls):
+ super(InstanceActionsTestJSON, cls).setup_clients()
+ cls.client = cls.servers_client
+
+ @classmethod
def resource_setup(cls):
super(InstanceActionsTestJSON, cls).resource_setup()
- cls.client = cls.servers_client
server = cls.create_test_server(wait_until='ACTIVE')
cls.request_id = server.response['x-compute-request-id']
cls.server_id = server['id']
diff --git a/tempest/api/compute/servers/test_instance_actions_negative.py b/tempest/api/compute/servers/test_instance_actions_negative.py
index fc74717..7635eb8 100644
--- a/tempest/api/compute/servers/test_instance_actions_negative.py
+++ b/tempest/api/compute/servers/test_instance_actions_negative.py
@@ -23,9 +23,13 @@
class InstanceActionsNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
+ def setup_clients(cls):
+ super(InstanceActionsNegativeTestJSON, cls).setup_clients()
+ cls.client = cls.servers_client
+
+ @classmethod
def resource_setup(cls):
super(InstanceActionsNegativeTestJSON, cls).resource_setup()
- cls.client = cls.servers_client
server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
diff --git a/tempest/api/compute/servers/test_list_servers_negative.py b/tempest/api/compute/servers/test_list_servers_negative.py
index 7837ac1..1c466c5 100644
--- a/tempest/api/compute/servers/test_list_servers_negative.py
+++ b/tempest/api/compute/servers/test_list_servers_negative.py
@@ -24,9 +24,13 @@
force_tenant_isolation = True
@classmethod
+ def setup_clients(cls):
+ super(ListServersNegativeTestJSON, cls).setup_clients()
+ cls.client = cls.servers_client
+
+ @classmethod
def resource_setup(cls):
super(ListServersNegativeTestJSON, cls).resource_setup()
- cls.client = cls.servers_client
# The following servers are created for use
# by the test methods in this class. These
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index fa19fdc..131b241 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -53,10 +53,14 @@
super(ServerActionsTestJSON, self).tearDown()
@classmethod
+ def setup_clients(cls):
+ super(ServerActionsTestJSON, cls).setup_clients()
+ cls.client = cls.servers_client
+
+ @classmethod
def resource_setup(cls):
cls.prepare_instance_network()
super(ServerActionsTestJSON, cls).resource_setup()
- cls.client = cls.servers_client
cls.server_id = cls.rebuild_server(None)
@test.idempotent_id('6158df09-4b82-4ab3-af6d-29cf36af858d')
diff --git a/tempest/api/compute/servers/test_server_group.py b/tempest/api/compute/servers/test_server_group.py
index bf6eaab..12edfa5 100644
--- a/tempest/api/compute/servers/test_server_group.py
+++ b/tempest/api/compute/servers/test_server_group.py
@@ -28,12 +28,20 @@
It also adds the tests for list and get details of server-groups
"""
@classmethod
- def resource_setup(cls):
- super(ServerGroupTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(ServerGroupTestJSON, cls).skip_checks()
if not test.is_extension_enabled('os-server-groups', 'compute'):
msg = "os-server-groups extension is not enabled."
raise cls.skipException(msg)
+
+ @classmethod
+ def setup_clients(cls):
+ super(ServerGroupTestJSON, cls).setup_clients()
cls.client = cls.servers_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(ServerGroupTestJSON, cls).resource_setup()
server_group_name = data_utils.rand_name('server-group')
cls.policy = ['affinity']
diff --git a/tempest/api/compute/servers/test_server_metadata.py b/tempest/api/compute/servers/test_server_metadata.py
index 4a14228..3bdd380 100644
--- a/tempest/api/compute/servers/test_server_metadata.py
+++ b/tempest/api/compute/servers/test_server_metadata.py
@@ -20,10 +20,14 @@
class ServerMetadataTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(ServerMetadataTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(ServerMetadataTestJSON, cls).setup_clients()
cls.client = cls.servers_client
cls.quotas = cls.quotas_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(ServerMetadataTestJSON, cls).resource_setup()
server = cls.create_test_server(meta={}, wait_until='ACTIVE')
cls.server_id = server['id']
diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py
index 9f78dc4..5e1765d 100644
--- a/tempest/api/compute/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -23,10 +23,14 @@
class ServerMetadataNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(ServerMetadataNegativeTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(ServerMetadataNegativeTestJSON, cls).setup_clients()
cls.client = cls.servers_client
cls.quotas = cls.quotas_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(ServerMetadataNegativeTestJSON, cls).resource_setup()
cls.tenant_id = cls.client.tenant_id
server = cls.create_test_server(meta={}, wait_until='ACTIVE')
diff --git a/tempest/api/compute/servers/test_server_password.py b/tempest/api/compute/servers/test_server_password.py
index 57fa408..a82fddf 100644
--- a/tempest/api/compute/servers/test_server_password.py
+++ b/tempest/api/compute/servers/test_server_password.py
@@ -21,9 +21,13 @@
class ServerPasswordTestJSON(base.BaseV2ComputeTest):
@classmethod
+ def setup_clients(cls):
+ super(ServerPasswordTestJSON, cls).setup_clients()
+ cls.client = cls.servers_client
+
+ @classmethod
def resource_setup(cls):
super(ServerPasswordTestJSON, cls).resource_setup()
- cls.client = cls.servers_client
cls.server = cls.create_test_server(wait_until="ACTIVE")
@test.attr(type='gate')
diff --git a/tempest/api/compute/servers/test_server_personality.py b/tempest/api/compute/servers/test_server_personality.py
index b08dbf1..dbfee8f 100644
--- a/tempest/api/compute/servers/test_server_personality.py
+++ b/tempest/api/compute/servers/test_server_personality.py
@@ -23,8 +23,8 @@
class ServerPersonalityTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(ServerPersonalityTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(ServerPersonalityTestJSON, cls).setup_clients()
cls.client = cls.servers_client
cls.user_client = cls.limits_client
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index 35f7880..73ac9be 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -22,8 +22,8 @@
class ServersTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
- super(ServersTestJSON, cls).resource_setup()
+ def setup_clients(cls):
+ super(ServersTestJSON, cls).setup_clients()
cls.client = cls.servers_client
def tearDown(self):
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index 5d0d93d..853e262 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -41,11 +41,19 @@
super(ServersNegativeTestJSON, self).tearDown()
@classmethod
+ def setup_credentials(cls):
+ super(ServersNegativeTestJSON, cls).setup_credentials()
+ cls.alt_os = clients.Manager(cls.isolated_creds.get_alt_creds())
+
+ @classmethod
+ def setup_clients(cls):
+ super(ServersNegativeTestJSON, cls).setup_clients()
+ cls.client = cls.servers_client
+ cls.alt_client = cls.alt_os.servers_client
+
+ @classmethod
def resource_setup(cls):
super(ServersNegativeTestJSON, cls).resource_setup()
- cls.client = cls.servers_client
- cls.alt_os = clients.Manager(cls.isolated_creds.get_alt_creds())
- cls.alt_client = cls.alt_os.servers_client
server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
diff --git a/tempest/api/compute/test_live_block_migration.py b/tempest/api/compute/test_live_block_migration.py
index d2221e1..c3f91ee 100644
--- a/tempest/api/compute/test_live_block_migration.py
+++ b/tempest/api/compute/test_live_block_migration.py
@@ -27,12 +27,15 @@
_host_key = 'OS-EXT-SRV-ATTR:host'
@classmethod
- def resource_setup(cls):
- super(LiveBlockMigrationTestJSON, cls).resource_setup()
-
+ def setup_clients(cls):
+ super(LiveBlockMigrationTestJSON, cls).setup_clients()
cls.admin_hosts_client = cls.os_adm.hosts_client
cls.admin_servers_client = cls.os_adm.servers_client
+ @classmethod
+ def resource_setup(cls):
+ super(LiveBlockMigrationTestJSON, cls).resource_setup()
+
cls.created_server_ids = []
def _get_compute_hostnames(self):
diff --git a/tempest/api/compute/test_live_block_migration_negative.py b/tempest/api/compute/test_live_block_migration_negative.py
index bced359..e1d353f 100644
--- a/tempest/api/compute/test_live_block_migration_negative.py
+++ b/tempest/api/compute/test_live_block_migration_negative.py
@@ -27,10 +27,14 @@
_host_key = 'OS-EXT-SRV-ATTR:host'
@classmethod
- def resource_setup(cls):
- super(LiveBlockMigrationNegativeTestJSON, cls).resource_setup()
+ def skip_checks(cls):
+ super(LiveBlockMigrationNegativeTestJSON, cls).skip_checks()
if not CONF.compute_feature_enabled.live_migration:
raise cls.skipException("Live migration is not enabled")
+
+ @classmethod
+ def setup_clients(cls):
+ super(LiveBlockMigrationNegativeTestJSON, cls).setup_clients()
cls.admin_hosts_client = cls.os_adm.hosts_client
cls.admin_servers_client = cls.os_adm.servers_client
diff --git a/tempest/api/compute/test_networks.py b/tempest/api/compute/test_networks.py
index c30beb7..2279723 100644
--- a/tempest/api/compute/test_networks.py
+++ b/tempest/api/compute/test_networks.py
@@ -21,10 +21,14 @@
class NetworksTestJSON(base.BaseV2ComputeTest):
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(NetworksTestJSON, cls).skip_checks()
if CONF.service_available.neutron:
raise cls.skipException('nova-network is not available.')
- super(NetworksTestJSON, cls).resource_setup()
+
+ @classmethod
+ def setup_clients(cls):
+ super(NetworksTestJSON, cls).setup_clients()
cls.client = cls.os.networks_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/test_quotas.py b/tempest/api/compute/test_quotas.py
index 1df67d9..86bf5fa 100644
--- a/tempest/api/compute/test_quotas.py
+++ b/tempest/api/compute/test_quotas.py
@@ -26,9 +26,13 @@
super(QuotasTestJSON, self).setUp()
@classmethod
+ def setup_clients(cls):
+ super(QuotasTestJSON, cls).setup_clients()
+ cls.client = cls.quotas_client
+
+ @classmethod
def resource_setup(cls):
super(QuotasTestJSON, cls).resource_setup()
- cls.client = cls.quotas_client
cls.tenant_id = cls.client.tenant_id
cls.user_id = cls.client.user_id
cls.default_quota_set = set(('injected_file_content_bytes',
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index 42062e7..f75f4c8 100644
--- a/tempest/api/object_storage/base.py
+++ b/tempest/api/object_storage/base.py
@@ -32,22 +32,23 @@
if not CONF.service_available.swift:
skip_msg = ("%s skipped as swift is not available" % cls.__name__)
raise cls.skipException(skip_msg)
- if not CONF.auth.allow_tenant_isolation and \
- not CONF.auth.locking_credentials_provider:
- skip_msg = ("%s skipped because a credential provider able to "
- "provide credentials by role is needed" % cls.__name__)
- raise cls.skipException(skip_msg)
@classmethod
def setup_credentials(cls):
cls.set_network_resources()
super(BaseObjectTest, cls).setup_credentials()
-
cls.isolated_creds = credentials.get_isolated_credentials(
cls.__name__, network_resources=cls.network_resources)
- # Get isolated creds for normal user
- cls.os = clients.Manager(cls.isolated_creds.get_creds_by_roles(
- [CONF.object_storage.operator_role]))
+ operator_role = CONF.object_storage.operator_role
+ if not cls.isolated_creds.is_role_available(operator_role):
+ skip_msg = ("%s skipped because the configured credential provider"
+ " is not able to provide credentials with the %s role "
+ "assigned." % (cls.__name__, operator_role))
+ raise cls.skipException(skip_msg)
+ else:
+ # Get isolated creds for normal user
+ cls.os = clients.Manager(cls.isolated_creds.get_creds_by_roles(
+ [operator_role]))
@classmethod
def setup_clients(cls):
diff --git a/tempest/api/object_storage/test_account_quotas.py b/tempest/api/object_storage/test_account_quotas.py
index c1c766f..364d6e1 100644
--- a/tempest/api/object_storage/test_account_quotas.py
+++ b/tempest/api/object_storage/test_account_quotas.py
@@ -27,9 +27,16 @@
@classmethod
def setup_credentials(cls):
super(AccountQuotasTest, cls).setup_credentials()
- cls.os_reselleradmin = clients.Manager(
- cls.isolated_creds.get_creds_by_roles(
- roles=[CONF.object_storage.reseller_admin_role]))
+ reseller_admin_role = CONF.object_storage.reseller_admin_role
+ if not cls.isolated_creds.is_role_available(reseller_admin_role):
+ skip_msg = ("%s skipped because the configured credential provider"
+ " is not able to provide credentials with the %s role "
+ "assigned." % (cls.__name__, reseller_admin_role))
+ raise cls.skipException(skip_msg)
+ else:
+ cls.os_reselleradmin = clients.Manager(
+ cls.isolated_creds.get_creds_by_roles(
+ roles=[reseller_admin_role]))
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/object_storage/test_account_quotas_negative.py b/tempest/api/object_storage/test_account_quotas_negative.py
index 5e44c53..101b040 100644
--- a/tempest/api/object_storage/test_account_quotas_negative.py
+++ b/tempest/api/object_storage/test_account_quotas_negative.py
@@ -29,9 +29,16 @@
@classmethod
def setup_credentials(cls):
super(AccountQuotasNegativeTest, cls).setup_credentials()
- cls.os_reselleradmin = clients.Manager(
- cls.isolated_creds.get_creds_by_roles(
- roles=[CONF.object_storage.reseller_admin_role]))
+ reseller_admin_role = CONF.object_storage.reseller_admin_role
+ if not cls.isolated_creds.is_role_available(reseller_admin_role):
+ skip_msg = ("%s skipped because the configured credential provider"
+ " is not able to provide credentials with the %s role "
+ "assigned." % (cls.__name__, reseller_admin_role))
+ raise cls.skipException(skip_msg)
+ else:
+ cls.os_reselleradmin = clients.Manager(
+ cls.isolated_creds.get_creds_by_roles(
+ roles=[reseller_admin_role]))
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/orchestration/stacks/test_neutron_resources.py b/tempest/api/orchestration/stacks/test_neutron_resources.py
index 9f8de0d..998e3d0 100644
--- a/tempest/api/orchestration/stacks/test_neutron_resources.py
+++ b/tempest/api/orchestration/stacks/test_neutron_resources.py
@@ -96,7 +96,7 @@
for resource in resources:
cls.test_resources[resource['logical_resource_id']] = resource
- @test.attr(type='slow')
+ @test.attr(type='gate')
@test.idempotent_id('f9e2664c-bc44-4eef-98b6-495e4f9d74b3')
def test_created_resources(self):
"""Verifies created neutron resources."""
@@ -115,7 +115,7 @@
self.assertEqual(resource_type, resource['resource_type'])
self.assertEqual('CREATE_COMPLETE', resource['resource_status'])
- @test.attr(type='slow')
+ @test.attr(type='gate')
@test.idempotent_id('c572b915-edb1-4e90-b196-c7199a6848c0')
@test.services('network')
def test_created_network(self):
@@ -128,7 +128,7 @@
self.assertEqual(self.neutron_basic_template['resources'][
'Network']['properties']['name'], network['name'])
- @test.attr(type='slow')
+ @test.attr(type='gate')
@test.idempotent_id('e8f84b96-f9d7-4684-ad5f-340203e9f2c2')
@test.services('network')
def test_created_subnet(self):
@@ -147,7 +147,7 @@
'Subnet']['properties']['ip_version'], subnet['ip_version'])
self.assertEqual(str(self.subnet_cidr), subnet['cidr'])
- @test.attr(type='slow')
+ @test.attr(type='gate')
@test.idempotent_id('96af4c7f-5069-44bc-bdcf-c0390f8a67d1')
@test.services('network')
def test_created_router(self):
@@ -161,7 +161,7 @@
router['external_gateway_info']['network_id'])
self.assertEqual(True, router['admin_state_up'])
- @test.attr(type='slow')
+ @test.attr(type='gate')
@test.idempotent_id('89f605bd-153e-43ee-a0ed-9919b63423c5')
@test.services('network')
def test_created_router_interface(self):
@@ -185,7 +185,7 @@
self.assertEqual(str(self.subnet_cidr.iter_hosts().next()),
router_interface_ip)
- @test.attr(type='slow')
+ @test.attr(type='gate')
@test.idempotent_id('75d85316-4ac2-4c0e-a1a9-edd2148fc10e')
@test.services('compute', 'network')
def test_created_server(self):
diff --git a/tempest/api_schema/response/compute/v2/servers.py b/tempest/api_schema/response/compute/v2/servers.py
index 0132350..83dbb4f 100644
--- a/tempest/api_schema/response/compute/v2/servers.py
+++ b/tempest/api_schema/response/compute/v2/servers.py
@@ -93,6 +93,15 @@
# these attributes. So they are not 'required'.
'hostId'
)
+# NOTE(gmann): Update OS-EXT-IPS:type and OS-EXT-IPS-MAC:mac_addr
+# attributes in server address. Those are API extension,
+# and some environments return a response without
+# these attributes. So they are not 'required'.
+get_server['response_body']['properties']['server']['properties'][
+ 'addresses']['patternProperties']['^[a-zA-Z0-9-_.]+$']['items'][
+ 'properties'].update({
+ 'OS-EXT-IPS:type': {'type': 'string'},
+ 'OS-EXT-IPS-MAC:mac_addr': parameter_types.mac_address})
list_virtual_interfaces = {
'status_code': [200],
@@ -293,11 +302,21 @@
'accessIPv4': parameter_types.access_ip_v4,
'accessIPv6': parameter_types.access_ip_v6
})
-# NOTE(GMann): OS-DCF:diskConfig, security_groups and accessIPv4/v6 are API
-# extensions, and some environments return a response
+# NOTE(GMann): OS-DCF:diskConfig, security_groups and accessIPv4/v6
+# are API extensions, and some environments return a response
# without these attributes. So they are not 'required'.
list_servers_detail['response_body']['properties']['servers']['items'][
'required'].append('hostId')
+# NOTE(gmann): Update OS-EXT-IPS:type and OS-EXT-IPS-MAC:mac_addr
+# attributes in server address. Those are API extension,
+# and some environments return a response without
+# these attributes. So they are not 'required'.
+list_servers_detail['response_body']['properties']['servers']['items'][
+ 'properties']['addresses']['patternProperties']['^[a-zA-Z0-9-_.]+$'][
+ 'items']['properties'].update({
+ 'OS-EXT-IPS:type': {'type': 'string'},
+ 'OS-EXT-IPS-MAC:mac_addr': parameter_types.mac_address})
+
rebuild_server = copy.deepcopy(update_server)
rebuild_server['status_code'] = [202]
diff --git a/tempest/common/accounts.py b/tempest/common/accounts.py
index 89de69b..8766e7d 100644
--- a/tempest/common/accounts.py
+++ b/tempest/common/accounts.py
@@ -236,10 +236,16 @@
def get_admin_creds(self):
return self.get_creds_by_roles([CONF.identity.admin_role])
- def admin_available(self):
- if not self.hash_dict['roles'].get(CONF.identity.admin_role):
+ def is_role_available(self, role):
+ if self.use_default_creds:
return False
- return True
+ else:
+ if self.hash_dict['roles'].get(role):
+ return True
+ return False
+
+ def admin_available(self):
+ return self.is_role_available(CONF.identity.admin_role)
class NotLockingAccounts(Accounts):
diff --git a/tempest/common/cred_provider.py b/tempest/common/cred_provider.py
index c22dc1f..ea628f6 100644
--- a/tempest/common/cred_provider.py
+++ b/tempest/common/cred_provider.py
@@ -117,3 +117,7 @@
@abc.abstractmethod
def get_creds_by_roles(self, roles, force_new=False):
return
+
+ @abc.abstractmethod
+ def is_role_available(self, role):
+ return
diff --git a/tempest/common/isolated_creds.py b/tempest/common/isolated_creds.py
index 2ccf031..ca2bd65 100644
--- a/tempest/common/isolated_creds.py
+++ b/tempest/common/isolated_creds.py
@@ -387,3 +387,6 @@
def is_multi_tenant(self):
return True
+
+ def is_role_available(self, role):
+ return True
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 61fb088..ef1037c 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -41,8 +41,8 @@
"""Base class for scenario tests. Uses tempest own clients. """
@classmethod
- def resource_setup(cls):
- super(ScenarioTest, cls).resource_setup()
+ def setup_credentials(cls):
+ super(ScenarioTest, cls).setup_credentials()
# TODO(andreaf) Some of the code from this resource_setup could be
# moved into `BaseTestCase`
cls.isolated_creds = credentials.get_isolated_credentials(
@@ -51,6 +51,10 @@
credentials=cls.credentials()
)
cls.admin_manager = clients.Manager(cls.admin_credentials())
+
+ @classmethod
+ def setup_clients(cls):
+ super(ScenarioTest, cls).setup_clients()
# Clients (in alphabetical order)
cls.flavors_client = cls.manager.flavors_client
cls.floating_ips_client = cls.manager.floating_ips_client
@@ -534,13 +538,13 @@
"""
@classmethod
- def check_preconditions(cls):
+ def skip_checks(cls):
+ super(NetworkScenarioTest, cls).skip_checks()
if not CONF.service_available.neutron:
raise cls.skipException('Neutron not available')
@classmethod
def resource_setup(cls):
- cls.check_preconditions()
super(NetworkScenarioTest, cls).resource_setup()
cls.tenant_id = cls.manager.identity_client.tenant_id
@@ -1141,12 +1145,16 @@
class BaremetalScenarioTest(ScenarioTest):
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(BaremetalScenarioTest, cls).skip_checks()
if (not CONF.service_available.ironic or
not CONF.baremetal.driver_enabled):
msg = 'Ironic not available or Ironic compute driver not enabled'
raise cls.skipException(msg)
- super(BaremetalScenarioTest, cls).resource_setup()
+
+ @classmethod
+ def setup_credentials(cls):
+ super(BaremetalScenarioTest, cls).setup_credentials()
# use an admin client manager for baremetal client
manager = clients.Manager(
@@ -1154,6 +1162,9 @@
)
cls.baremetal_client = manager.baremetal_client
+ @classmethod
+ def resource_setup(cls):
+ super(BaremetalScenarioTest, cls).resource_setup()
# allow any issues obtaining the node list to raise early
cls.baremetal_client.list_nodes()
@@ -1272,8 +1283,8 @@
"""
@classmethod
- def resource_setup(cls):
- super(EncryptionScenarioTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(EncryptionScenarioTest, cls).setup_clients()
cls.admin_volume_types_client = cls.admin_manager.volume_types_client
def _wait_for_volume_status(self, status):
@@ -1319,10 +1330,10 @@
"""
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(OrchestrationScenarioTest, cls).skip_checks()
if not CONF.service_available.heat:
raise cls.skipException("Heat support is required")
- super(OrchestrationScenarioTest, cls).resource_setup()
@classmethod
def credentials(cls):
@@ -1365,16 +1376,31 @@
"""
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(SwiftScenarioTest, cls).skip_checks()
if not CONF.service_available.swift:
skip_msg = ("%s skipped as swift is not available" %
cls.__name__)
raise cls.skipException(skip_msg)
+
+ @classmethod
+ def setup_credentials(cls):
cls.set_network_resources()
- super(SwiftScenarioTest, cls).resource_setup()
- cls.os_operator = clients.Manager(
- cls.isolated_creds.get_creds_by_roles(
- [CONF.object_storage.operator_role]))
+ super(SwiftScenarioTest, cls).setup_credentials()
+ operator_role = CONF.object_storage.operator_role
+ if not cls.isolated_creds.is_role_available(operator_role):
+ skip_msg = ("%s skipped because the configured credential provider"
+ " is not able to provide credentials with the %s role "
+ "assigned." % (cls.__name__, operator_role))
+ raise cls.skipException(skip_msg)
+ else:
+ cls.os_operator = clients.Manager(
+ cls.isolated_creds.get_creds_by_roles(
+ [operator_role]))
+
+ @classmethod
+ def setup_clients(cls):
+ super(SwiftScenarioTest, cls).setup_clients()
# Clients for Swift
cls.account_client = cls.os_operator.account_client
cls.container_client = cls.os_operator.container_client
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index 568ad43..4074e9b 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -34,8 +34,8 @@
Deletes aggregate
"""
@classmethod
- def resource_setup(cls):
- super(TestAggregatesBasicOps, cls).resource_setup()
+ def setup_clients(cls):
+ super(TestAggregatesBasicOps, cls).setup_clients()
cls.aggregates_client = cls.manager.aggregates_client
cls.hosts_client = cls.manager.hosts_client
diff --git a/tempest/scenario/test_dashboard_basic_ops.py b/tempest/scenario/test_dashboard_basic_ops.py
index 4c4dc94..dd7376a 100644
--- a/tempest/scenario/test_dashboard_basic_ops.py
+++ b/tempest/scenario/test_dashboard_basic_ops.py
@@ -57,11 +57,15 @@
"""
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(TestDashboardBasicOps, cls).skip_checks()
if not CONF.service_available.horizon:
raise cls.skipException("Horizon support is required")
+
+ @classmethod
+ def setup_credentials(cls):
cls.set_network_resources()
- super(TestDashboardBasicOps, cls).resource_setup()
+ super(TestDashboardBasicOps, cls).setup_credentials()
def check_login_page(self):
response = urllib2.urlopen(CONF.dashboard.dashboard_url)
diff --git a/tempest/scenario/test_large_ops.py b/tempest/scenario/test_large_ops.py
index d5e901e..2408109 100644
--- a/tempest/scenario/test_large_ops.py
+++ b/tempest/scenario/test_large_ops.py
@@ -40,11 +40,19 @@
"""
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(TestLargeOpsScenario, cls).skip_checks()
if CONF.scenario.large_ops_number < 1:
raise cls.skipException("large_ops_number not set to multiple "
"instances")
+
+ @classmethod
+ def setup_credentials(cls):
cls.set_network_resources()
+ super(TestLargeOpsScenario, cls).setup_credentials()
+
+ @classmethod
+ def resource_setup(cls):
super(TestLargeOpsScenario, cls).resource_setup()
# list of cleanup calls to be executed in reverse order
cls._cleanup_resources = []
diff --git a/tempest/scenario/test_load_balancer_basic.py b/tempest/scenario/test_load_balancer_basic.py
index 2dfabe3..0d17048 100644
--- a/tempest/scenario/test_load_balancer_basic.py
+++ b/tempest/scenario/test_load_balancer_basic.py
@@ -43,8 +43,8 @@
"""
@classmethod
- def check_preconditions(cls):
- super(TestLoadBalancerBasic, cls).check_preconditions()
+ 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'
@@ -57,7 +57,6 @@
@classmethod
def resource_setup(cls):
super(TestLoadBalancerBasic, cls).resource_setup()
- cls.check_preconditions()
cls.servers_keypairs = {}
cls.members = []
cls.floating_ips = {}
diff --git a/tempest/scenario/test_network_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py
index 5b0fa94..b4837a2 100644
--- a/tempest/scenario/test_network_advanced_server_ops.py
+++ b/tempest/scenario/test_network_advanced_server_ops.py
@@ -41,8 +41,8 @@
"""
@classmethod
- def check_preconditions(cls):
- super(TestNetworkAdvancedServerOps, cls).check_preconditions()
+ def skip_checks(cls):
+ super(TestNetworkAdvancedServerOps, cls).skip_checks()
if not (CONF.network.tenant_networks_reachable
or CONF.network.public_network_id):
msg = ('Either tenant_networks_reachable must be "true", or '
@@ -50,10 +50,10 @@
raise cls.skipException(msg)
@classmethod
- def resource_setup(cls):
+ def setup_credentials(cls):
# Create no network resources for these tests.
cls.set_network_resources()
- super(TestNetworkAdvancedServerOps, cls).resource_setup()
+ super(TestNetworkAdvancedServerOps, cls).setup_credentials()
def _setup_network_and_servers(self):
self.keypair = self.create_keypair()
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 23f6529..c9aa1ab 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -77,23 +77,23 @@
"""
@classmethod
- def check_preconditions(cls):
- super(TestNetworkBasicOps, cls).check_preconditions()
+ def skip_checks(cls):
+ super(TestNetworkBasicOps, cls).skip_checks()
if not (CONF.network.tenant_networks_reachable
or CONF.network.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):
for ext in ['router', 'security-group']:
if not test.is_extension_enabled(ext, 'network'):
msg = "%s extension not enabled." % ext
raise cls.skipException(msg)
+
+ @classmethod
+ def setup_credentials(cls):
# Create no network resources for these tests.
cls.set_network_resources()
- super(TestNetworkBasicOps, cls).resource_setup()
+ super(TestNetworkBasicOps, cls).setup_credentials()
def setUp(self):
super(TestNetworkBasicOps, self).setUp()
diff --git a/tempest/scenario/test_network_v6.py b/tempest/scenario/test_network_v6.py
index d5d2d77..7b2bdd5 100644
--- a/tempest/scenario/test_network_v6.py
+++ b/tempest/scenario/test_network_v6.py
@@ -34,13 +34,8 @@
"""
@classmethod
- def resource_setup(cls):
- # Create no network resources for these tests.
- cls.set_network_resources()
- super(TestGettingAddress, cls).resource_setup()
-
- @classmethod
- def check_preconditions(cls):
+ def skip_checks(cls):
+ super(TestGettingAddress, cls).skip_checks()
if not (CONF.network_feature_enabled.ipv6
and CONF.network_feature_enabled.ipv6_subnet_attributes):
raise cls.skipException('IPv6 or its attributes not supported')
@@ -53,7 +48,11 @@
msg = ('Baremetal does not currently support network isolation')
raise cls.skipException(msg)
- super(TestGettingAddress, cls).check_preconditions()
+ @classmethod
+ def setup_credentials(cls):
+ # Create no network resources for these tests.
+ cls.set_network_resources()
+ super(TestGettingAddress, cls).setup_credentials()
def setUp(self):
super(TestGettingAddress, self).setUp()
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index 5798c79..bb6c9b1 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -120,11 +120,11 @@
self.router = router
@classmethod
- def check_preconditions(cls):
+ def skip_checks(cls):
+ super(TestSecurityGroupsBasicOps, cls).skip_checks()
if CONF.baremetal.driver_enabled:
msg = ('Not currently supported by baremetal.')
raise cls.skipException(msg)
- super(TestSecurityGroupsBasicOps, cls).check_preconditions()
if not (CONF.network.tenant_networks_reachable or
CONF.network.public_network_id):
msg = ('Either tenant_networks_reachable must be "true", or '
@@ -132,10 +132,10 @@
raise cls.skipException(msg)
@classmethod
- def resource_setup(cls):
+ def setup_credentials(cls):
# Create no network resources for these tests.
cls.set_network_resources()
- super(TestSecurityGroupsBasicOps, cls).resource_setup()
+ super(TestSecurityGroupsBasicOps, cls).setup_credentials()
# TODO(mnewby) Consider looking up entities as needed instead
# of storing them as collections on the class.
@@ -145,6 +145,9 @@
# Credentials from the manager are filled with both IDs and Names
cls.alt_creds = cls.alt_manager.credentials
+ @classmethod
+ def resource_setup(cls):
+ super(TestSecurityGroupsBasicOps, cls).resource_setup()
cls.floating_ips = {}
cls.tenants = {}
creds = cls.credentials()
@@ -152,6 +155,7 @@
cls.alt_tenant = cls.TenantProperties(cls.alt_creds)
for tenant in [cls.primary_tenant, cls.alt_tenant]:
cls.tenants[tenant.creds.tenant_id] = tenant
+
cls.floating_ip_access = not CONF.network.public_router_id
def cleanup_wrapper(self, resource):
diff --git a/tempest/scenario/test_server_advanced_ops.py b/tempest/scenario/test_server_advanced_ops.py
index d0b595a..8cbc388 100644
--- a/tempest/scenario/test_server_advanced_ops.py
+++ b/tempest/scenario/test_server_advanced_ops.py
@@ -35,12 +35,16 @@
"""
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(TestServerAdvancedOps, cls).skip_checks()
if CONF.compute.flavor_ref_alt == CONF.compute.flavor_ref:
msg = "Skipping test - flavor_ref and flavor_ref_alt are identical"
raise cls.skipException(msg)
+
+ @classmethod
+ def setup_credentials(cls):
cls.set_network_resources()
- super(TestServerAdvancedOps, cls).resource_setup()
+ super(TestServerAdvancedOps, cls).setup_credentials()
@test.idempotent_id('e6c28180-7454-4b59-b188-0257af08a63b')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 0e5240a..eaa6141 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -54,10 +54,10 @@
"""
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(TestStampPattern, cls).skip_checks()
if not CONF.volume_feature_enabled.snapshot:
raise cls.skipException("Cinder volume snapshots are disabled")
- super(TestStampPattern, cls).resource_setup()
def _wait_for_volume_snapshot_status(self, volume_snapshot, status):
self.snapshots_client.wait_for_snapshot_status(volume_snapshot['id'],
diff --git a/tempest/scenario/test_swift_telemetry_middleware.py b/tempest/scenario/test_swift_telemetry_middleware.py
index 16c3976..a10168c 100644
--- a/tempest/scenario/test_swift_telemetry_middleware.py
+++ b/tempest/scenario/test_swift_telemetry_middleware.py
@@ -44,7 +44,8 @@
"""
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(TestSwiftTelemetry, cls).skip_checks()
if not CONF.service_available.ceilometer:
skip_msg = ("%s skipped as ceilometer is not available" %
cls.__name__)
@@ -52,7 +53,10 @@
elif CONF.telemetry.too_slow_to_test:
skip_msg = "Ceilometer feature for fast work mysql is disabled"
raise cls.skipException(skip_msg)
- super(TestSwiftTelemetry, cls).resource_setup()
+
+ @classmethod
+ def setup_clients(cls):
+ super(TestSwiftTelemetry, cls).setup_clients()
cls.telemetry_client = cls.os_operator.telemetry_client
def _confirm_notifications(self, container_name, obj_name):
@@ -79,15 +83,15 @@
meta = sample['resource_metadata']
if meta.get('container') and meta['container'] != 'None':
containers.append(meta['container'])
- elif (meta.get('target') and
- meta['target']['metadata']['container'] != 'None'):
- containers.append(meta['target']['metadata']['container'])
+ elif (meta.get('target.metadata:container') and
+ meta['target.metadata:container'] != 'None'):
+ containers.append(meta['target.metadata:container'])
if meta.get('object') and meta['object'] != 'None':
objects.append(meta['object'])
- elif (meta.get('target') and
- meta['target']['metadata']['object'] != 'None'):
- objects.append(meta['target']['metadata']['object'])
+ elif (meta.get('target.metadata:object') and
+ meta['target.metadata:object'] != 'None'):
+ objects.append(meta['target.metadata:object'])
return (container_name in containers and obj_name in objects)
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index ac28532..3c5e88c 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -38,10 +38,10 @@
* Check written content in the instance booted from snapshot
"""
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(TestVolumeBootPattern, cls).skip_checks()
if not CONF.volume_feature_enabled.snapshot:
raise cls.skipException("Cinder volume snapshots are disabled")
- super(TestVolumeBootPattern, cls).resource_setup()
def _create_volume_from_image(self):
img_uuid = CONF.compute.image_ref