From 3f235e74d17bced2bdca03b3f3b33979ac5d8a25 Mon Sep 17 00:00:00 2001 From: Felipe Monteiro Date: Wed, 26 Apr 2017 22:56:41 +0100 Subject: [PATCH] Stop using aliases for creds manager Now that Tempest has stopped using aliases like cls.os and cls.os_adm [0], Murano should do the same. This patch normalizes the usage around os_admin, os_primary and os_alt. [0] https://review.openstack.org/#/c/457555/ Change-Id: I40e6cb8eec8e67f4dbe4f92d7216a3b0ebcd4a59 Related-Change-Id: I5f7164f7a7ec5d4380ca22885000caa0183a0bf7 --- .../tests/api/application_catalog/artifacts/base.py | 9 +++++---- .../tests/api/application_catalog/base.py | 13 +++++++------ .../tests/api/service_broker/base.py | 11 ++++++----- .../tests/scenario/application_catalog/base.py | 11 ++++++----- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/murano_tempest_tests/tests/api/application_catalog/artifacts/base.py b/murano_tempest_tests/tests/api/application_catalog/artifacts/base.py index 42816a8..c443bb4 100644 --- a/murano_tempest_tests/tests/api/application_catalog/artifacts/base.py +++ b/murano_tempest_tests/tests/api/application_catalog/artifacts/base.py @@ -80,11 +80,12 @@ class BaseArtifactsTest(base.BaseTestCase): if not CONF.service_available.murano: skip_msg = "Murano is disabled" raise cls.skipException(skip_msg) - if not hasattr(cls, "os"): + if not hasattr(cls, "os_primary"): creds = cls.get_configured_isolated_creds(type_of_creds='primary') - cls.os = clients.Manager(credentials=creds) - cls.artifacts_client = cls.os.artifacts_client - cls.application_catalog_client = cls.os.application_catalog_client + cls.os_primary = clients.Manager(credentials=creds) + cls.artifacts_client = cls.os_primary.artifacts_client + cls.application_catalog_client = \ + cls.os_primary.application_catalog_client @classmethod def resource_cleanup(cls): diff --git a/murano_tempest_tests/tests/api/application_catalog/base.py b/murano_tempest_tests/tests/api/application_catalog/base.py index 7dbb7ad..0f13088 100644 --- a/murano_tempest_tests/tests/api/application_catalog/base.py +++ b/murano_tempest_tests/tests/api/application_catalog/base.py @@ -81,11 +81,12 @@ class BaseApplicationCatalogTest(base.BaseTestCase): if not CONF.service_available.murano: skip_msg = "Murano is disabled" raise cls.skipException(skip_msg) - if not hasattr(cls, "os"): + if not hasattr(cls, "os_primary"): creds = cls.get_configured_isolated_creds(type_of_creds='primary') - cls.os = clients.Manager(credentials=creds) - cls.application_catalog_client = cls.os.application_catalog_client - cls.artifacts_client = cls.os.artifacts_client + cls.os_primary = clients.Manager(credentials=creds) + cls.application_catalog_client = \ + cls.os_primary.application_catalog_client + cls.artifacts_client = cls.os_primary.artifacts_client @classmethod def resource_cleanup(cls): @@ -122,7 +123,7 @@ class BaseApplicationCatalogAdminTest(BaseApplicationCatalogTest): @classmethod def resource_setup(cls): - cls.os = clients.Manager() + cls.os_primary = clients.Manager() super(BaseApplicationCatalogAdminTest, cls).resource_setup() @@ -131,5 +132,5 @@ class BaseApplicationCatalogIsolatedAdminTest(BaseApplicationCatalogTest): @classmethod def resource_setup(cls): creds = cls.get_configured_isolated_creds(type_of_creds='admin') - cls.os = clients.Manager(credentials=creds) + cls.os_primary = clients.Manager(credentials=creds) super(BaseApplicationCatalogIsolatedAdminTest, cls).resource_setup() diff --git a/murano_tempest_tests/tests/api/service_broker/base.py b/murano_tempest_tests/tests/api/service_broker/base.py index 23fde69..b754ece 100644 --- a/murano_tempest_tests/tests/api/service_broker/base.py +++ b/murano_tempest_tests/tests/api/service_broker/base.py @@ -76,14 +76,15 @@ class BaseServiceBrokerTest(base.BaseTestCase): if not CONF.service_available.murano: skip_msg = "Murano is disabled" raise cls.skipException(skip_msg) - if not hasattr(cls, "os"): + if not hasattr(cls, "os_primary"): cls.username = CONF.identity.username cls.password = CONF.identity.password cls.tenant_name = CONF.identity.tenant_name cls.verify_nonempty(cls.username, cls.password, cls.tenant_name) - cls.os = clients.Manager() - cls.service_broker_client = cls.os.service_broker_client - cls.application_catalog_client = cls.os.application_catalog_client + cls.os_primary = clients.Manager() + cls.service_broker_client = cls.os_primary.service_broker_client + cls.application_catalog_client = \ + cls.os_primary.application_catalog_client def setUp(self): super(BaseServiceBrokerTest, self).setUp() @@ -129,5 +130,5 @@ class BaseServiceBrokerAdminTest(BaseServiceBrokerTest): @classmethod def resource_setup(cls): - cls.os = clients.Manager() + cls.os_primary = clients.Manager() super(BaseServiceBrokerAdminTest, cls).resource_setup() diff --git a/murano_tempest_tests/tests/scenario/application_catalog/base.py b/murano_tempest_tests/tests/scenario/application_catalog/base.py index 26f2d00..a1b96a9 100644 --- a/murano_tempest_tests/tests/scenario/application_catalog/base.py +++ b/murano_tempest_tests/tests/scenario/application_catalog/base.py @@ -88,14 +88,15 @@ class BaseApplicationCatalogScenarioTest(base.BaseTestCase): if not CONF.service_available.murano: skip_msg = "Murano is disabled" raise cls.skipException(skip_msg) - if not hasattr(cls, "os"): + if not hasattr(cls, "os_primary"): creds = cls.get_configured_isolated_creds(type_of_creds='primary') - cls.os = clients.Manager(credentials=creds) + cls.os_primary = clients.Manager(credentials=creds) cls.services_manager = services_manager(creds) cls.linux_image = CONF.application_catalog.linux_image - cls.application_catalog_client = cls.os.application_catalog_client - cls.artifacts_client = cls.os.artifacts_client + cls.application_catalog_client = \ + cls.os_primary.application_catalog_client + cls.artifacts_client = cls.os_primary.artifacts_client cls.servers_client = cls.services_manager.servers_client cls.orchestration_client = cls.services_manager.orchestration_client cls.snapshots_client = cls.services_manager.snapshots_v2_client @@ -374,7 +375,7 @@ class BaseApplicationCatalogScenarioIsolatedAdminTest( @classmethod def resource_setup(cls): creds = cls.get_configured_isolated_creds(type_of_creds='admin') - cls.os = clients.Manager(credentials=creds) + cls.os_primary = clients.Manager(credentials=creds) cls.services_manager = services_manager(creds) super(BaseApplicationCatalogScenarioIsolatedAdminTest, cls).\ resource_setup()