From 2335afa915b1c546c69a2d70659639854a143d7d Mon Sep 17 00:00:00 2001 From: Valeriy Ponomaryov Date: Thu, 7 May 2015 17:09:42 +0300 Subject: [PATCH] Sync tempest plugin with latest tempest Sync our Tempest plugin to latest state of tempest repo because it has incompatibilities. Change-Id: I0d62f8a6f11f4bdba25807123e4cc4396a75799d --- contrib/ci/pre_test_hook.sh | 2 +- .../tempest/api/share/admin/test_quotas.py | 119 ++++++++---------- .../api/share/admin/test_quotas_negative.py | 49 ++++---- contrib/tempest/tempest/api/share/base.py | 14 +-- .../tempest/tempest/api/share/test_quotas.py | 15 +-- .../tempest/api/share/test_quotas_negative.py | 13 -- .../tempest/tempest/scenario/manager_share.py | 5 +- .../services/share/json/shares_client.py | 1 - 8 files changed, 80 insertions(+), 138 deletions(-) diff --git a/contrib/ci/pre_test_hook.sh b/contrib/ci/pre_test_hook.sh index 35eb6a548e..58f4dfa4d1 100755 --- a/contrib/ci/pre_test_hook.sh +++ b/contrib/ci/pre_test_hook.sh @@ -47,7 +47,7 @@ fi # Go to Tempest dir and checkout stable commit to avoid possible # incompatibilities for plugin stored in Manila repo. -TEMPEST_COMMIT="628c965d" # 23 Apr, 2015 +TEMPEST_COMMIT="7af67608" # 6 May, 2015 cd $BASE/new/tempest git checkout $TEMPEST_COMMIT diff --git a/contrib/tempest/tempest/api/share/admin/test_quotas.py b/contrib/tempest/tempest/api/share/admin/test_quotas.py index ef79e67873..70c397993d 100644 --- a/contrib/tempest/tempest/api/share/admin/test_quotas.py +++ b/contrib/tempest/tempest/api/share/admin/test_quotas.py @@ -27,17 +27,12 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest): def resource_setup(cls): cls.os = clients.AdminManager() super(SharesAdminQuotasTest, cls).resource_setup() - - # Get tenant and user - cls.identity_client = cls._get_identity_admin_client() - cls.tenant = cls.identity_client.get_tenant_by_name( - cls.shares_client.auth_params["tenant"]) - cls.user = cls.identity_client.get_user_by_username( - cls.tenant["id"], cls.shares_client.auth_params["user"]) + cls.user_id = cls.shares_client.user_id + cls.tenant_id = cls.shares_client.tenant_id @test.attr(type=["gate", "smoke", ]) def test_default_quotas(self): - quotas = self.shares_client.default_quotas(self.tenant["id"]) + quotas = self.shares_client.default_quotas(self.tenant_id) self.assertGreater(int(quotas["gigabytes"]), -2) self.assertGreater(int(quotas["snapshot_gigabytes"]), -2) self.assertGreater(int(quotas["shares"]), -2) @@ -46,7 +41,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest): @test.attr(type=["gate", "smoke", ]) def test_show_quotas(self): - quotas = self.shares_client.show_quotas(self.tenant["id"]) + quotas = self.shares_client.show_quotas(self.tenant_id) self.assertGreater(int(quotas["gigabytes"]), -2) self.assertGreater(int(quotas["snapshot_gigabytes"]), -2) self.assertGreater(int(quotas["shares"]), -2) @@ -55,8 +50,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest): @test.attr(type=["gate", "smoke", ]) def test_show_quotas_for_user(self): - quotas = self.shares_client.show_quotas( - self.tenant["id"], self.user["id"]) + quotas = self.shares_client.show_quotas(self.tenant_id, self.user_id) self.assertGreater(int(quotas["gigabytes"]), -2) self.assertGreater(int(quotas["snapshot_gigabytes"]), -2) self.assertGreater(int(quotas["shares"]), -2) @@ -73,12 +67,11 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas - quotas = client.show_quotas(client.creds["tenant"]["id"]) + quotas = client.show_quotas(client.tenant_id) new_quota = int(quotas["shares"]) + 2 # set new quota for shares - updated = client.update_quotas( - client.creds["tenant"]["id"], shares=new_quota) + updated = client.update_quotas(client.tenant_id, shares=new_quota) self.assertEqual(int(updated["shares"]), new_quota) @test.attr(type=["gate", "smoke", ]) @@ -86,14 +79,12 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas - quotas = client.show_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"]) + quotas = client.show_quotas(client.tenant_id, client.user_id) new_quota = int(quotas["shares"]) - 1 # set new quota for shares updated = client.update_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"], - shares=new_quota) + client.tenant_id, client.user_id, shares=new_quota) self.assertEqual(int(updated["shares"]), new_quota) @test.attr(type=["gate", "smoke", ]) @@ -101,12 +92,11 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas - quotas = client.show_quotas(client.creds["tenant"]["id"]) + quotas = client.show_quotas(client.tenant_id) new_quota = int(quotas["snapshots"]) + 2 # set new quota for snapshots - updated = client.update_quotas( - client.creds["tenant"]["id"], snapshots=new_quota) + updated = client.update_quotas(client.tenant_id, snapshots=new_quota) self.assertEqual(int(updated["snapshots"]), new_quota) @test.attr(type=["gate", "smoke", ]) @@ -114,14 +104,12 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas - quotas = client.show_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"]) + quotas = client.show_quotas(client.tenant_id, client.user_id) new_quota = int(quotas["snapshots"]) - 1 # set new quota for snapshots updated = client.update_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"], - snapshots=new_quota) + client.tenant_id, client.user_id, snapshots=new_quota) self.assertEqual(int(updated["snapshots"]), new_quota) @test.attr(type=["gate", "smoke", ]) @@ -129,14 +117,14 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas - custom = client.show_quotas(client.creds["tenant"]["id"]) + custom = client.show_quotas(client.tenant_id) # make quotas for update gigabytes = int(custom["gigabytes"]) + 2 # set new quota for shares updated = client.update_quotas( - client.creds["tenant"]["id"], gigabytes=gigabytes) + client.tenant_id, gigabytes=gigabytes) self.assertEqual(int(updated["gigabytes"]), gigabytes) @test.attr(type=["gate", "smoke", ]) @@ -144,14 +132,14 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas - custom = client.show_quotas(client.creds["tenant"]["id"]) + custom = client.show_quotas(client.tenant_id) # make quotas for update snapshot_gigabytes = int(custom["snapshot_gigabytes"]) + 2 # set new quota for shares updated = client.update_quotas( - client.creds["tenant"]["id"], + client.tenant_id, snapshot_gigabytes=snapshot_gigabytes) self.assertEqual( int(updated["snapshot_gigabytes"]), snapshot_gigabytes) @@ -161,15 +149,14 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas - custom = client.show_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"]) + custom = client.show_quotas(client.tenant_id, client.user_id) # make quotas for update gigabytes = int(custom["gigabytes"]) - 1 # set new quota for shares updated = client.update_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"], + client.tenant_id, client.user_id, gigabytes=gigabytes) self.assertEqual(int(updated["gigabytes"]), gigabytes) @@ -178,15 +165,14 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas - custom = client.show_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"]) + custom = client.show_quotas(client.tenant_id, client.user_id) # make quotas for update snapshot_gigabytes = int(custom["snapshot_gigabytes"]) - 1 # set new quota for shares updated = client.update_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"], + client.tenant_id, client.user_id, snapshot_gigabytes=snapshot_gigabytes) self.assertEqual( int(updated["snapshot_gigabytes"]), snapshot_gigabytes) @@ -196,12 +182,12 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas - quotas = client.show_quotas(client.creds["tenant"]["id"]) + quotas = client.show_quotas(client.tenant_id) new_quota = int(quotas["share_networks"]) + 2 # set new quota for share-networks updated = client.update_quotas( - client.creds["tenant"]["id"], share_networks=new_quota) + client.tenant_id, share_networks=new_quota) self.assertEqual(int(updated["share_networks"]), new_quota) @test.attr(type=["gate", "smoke", ]) @@ -210,12 +196,12 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): # get current quotas quotas = client.show_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"]) + client.tenant_id, client.user_id) new_quota = int(quotas["share_networks"]) - 1 # set new quota for share-networks updated = client.update_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"], + client.tenant_id, client.user_id, share_networks=new_quota) self.assertEqual(int(updated["share_networks"]), new_quota) @@ -224,10 +210,10 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get default_quotas - default = client.default_quotas(client.creds["tenant"]["id"]) + default = client.default_quotas(client.tenant_id) # get current quotas - custom = client.show_quotas(client.creds["tenant"]["id"]) + custom = client.show_quotas(client.tenant_id) # make quotas for update shares = int(custom["shares"]) + 2 @@ -238,7 +224,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): # set new quota updated = client.update_quotas( - client.creds["tenant"]["id"], + client.tenant_id, shares=shares, snapshots=snapshots, gigabytes=gigabytes, @@ -252,10 +238,10 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): self.assertEqual(int(updated["share_networks"]), share_networks) # reset customized quotas - client.reset_quotas(client.creds["tenant"]["id"]) + client.reset_quotas(client.tenant_id) # verify quotas - reseted = client.show_quotas(client.creds["tenant"]["id"]) + reseted = client.show_quotas(client.tenant_id) self.assertEqual(int(reseted["shares"]), int(default["shares"])) self.assertEqual(int(reseted["snapshots"]), int(default["snapshots"])) self.assertEqual(int(reseted["gigabytes"]), int(default["gigabytes"])) @@ -265,9 +251,9 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): @test.attr(type=["gate", "smoke", ]) def test_unlimited_quota_for_shares(self): client = self.get_client_with_isolated_creds() - client.update_quotas(client.creds["tenant"]["id"], shares=-1) + client.update_quotas(client.tenant_id, shares=-1) - quotas = client.show_quotas(client.creds["tenant"]["id"]) + quotas = client.show_quotas(client.tenant_id) self.assertEqual(-1, quotas.get('shares')) @@ -275,20 +261,19 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): def test_unlimited_user_quota_for_shares(self): client = self.get_client_with_isolated_creds() client.update_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"], + client.tenant_id, client.user_id, shares=-1) - quotas = client.show_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"]) + quotas = client.show_quotas(client.tenant_id, client.user_id) self.assertEqual(-1, quotas.get('shares')) @test.attr(type=["gate", "smoke", ]) def test_unlimited_quota_for_snapshots(self): client = self.get_client_with_isolated_creds() - client.update_quotas(client.creds["tenant"]["id"], snapshots=-1) + client.update_quotas(client.tenant_id, snapshots=-1) - quotas = client.show_quotas(client.creds["tenant"]["id"]) + quotas = client.show_quotas(client.tenant_id) self.assertEqual(-1, quotas.get('snapshots')) @@ -296,20 +281,19 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): def test_unlimited_user_quota_for_snapshots(self): client = self.get_client_with_isolated_creds() client.update_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"], + client.tenant_id, client.user_id, snapshots=-1) - quotas = client.show_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"]) + quotas = client.show_quotas(client.tenant_id, client.user_id) self.assertEqual(-1, quotas.get('snapshots')) @test.attr(type=["gate", "smoke", ]) def test_unlimited_quota_for_gigabytes(self): client = self.get_client_with_isolated_creds() - client.update_quotas(client.creds["tenant"]["id"], gigabytes=-1) + client.update_quotas(client.tenant_id, gigabytes=-1) - quotas = client.show_quotas(client.creds["tenant"]["id"]) + quotas = client.show_quotas(client.tenant_id) self.assertEqual(-1, quotas.get('gigabytes')) @@ -317,9 +301,9 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): def test_unlimited_quota_for_snapshot_gigabytes(self): client = self.get_client_with_isolated_creds() client.update_quotas( - client.creds["tenant"]["id"], snapshot_gigabytes=-1) + client.tenant_id, snapshot_gigabytes=-1) - quotas = client.show_quotas(client.creds["tenant"]["id"]) + quotas = client.show_quotas(client.tenant_id) self.assertEqual(-1, quotas.get('snapshot_gigabytes')) @@ -327,11 +311,10 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): def test_unlimited_user_quota_for_gigabytes(self): client = self.get_client_with_isolated_creds() client.update_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"], + client.tenant_id, client.user_id, gigabytes=-1) - quotas = client.show_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"]) + quotas = client.show_quotas(client.tenant_id, client.user_id) self.assertEqual(-1, quotas.get('gigabytes')) @@ -339,20 +322,19 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): def test_unlimited_user_quota_for_snapshot_gigabytes(self): client = self.get_client_with_isolated_creds() client.update_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"], + client.tenant_id, client.user_id, snapshot_gigabytes=-1) - quotas = client.show_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"]) + quotas = client.show_quotas(client.tenant_id, client.user_id) self.assertEqual(-1, quotas.get('snapshot_gigabytes')) @test.attr(type=["gate", "smoke", ]) def test_unlimited_quota_for_share_networks(self): client = self.get_client_with_isolated_creds() - client.update_quotas(client.creds["tenant"]["id"], share_networks=-1) + client.update_quotas(client.tenant_id, share_networks=-1) - quotas = client.show_quotas(client.creds["tenant"]["id"]) + quotas = client.show_quotas(client.tenant_id) self.assertEqual(-1, quotas.get('share_networks')) @@ -360,10 +342,9 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest): def test_unlimited_user_quota_for_share_networks(self): client = self.get_client_with_isolated_creds() client.update_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"], + client.tenant_id, client.user_id, share_networks=-1) - quotas = client.show_quotas( - client.creds["tenant"]["id"], client.creds["user"]["id"]) + quotas = client.show_quotas(client.tenant_id, client.user_id) self.assertEqual(-1, quotas.get('share_networks')) diff --git a/contrib/tempest/tempest/api/share/admin/test_quotas_negative.py b/contrib/tempest/tempest/api/share/admin/test_quotas_negative.py index 3baf1a7f0c..84a9b0f106 100644 --- a/contrib/tempest/tempest/api/share/admin/test_quotas_negative.py +++ b/contrib/tempest/tempest/api/share/admin/test_quotas_negative.py @@ -32,13 +32,8 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): def resource_setup(cls): cls.os = clients.AdminManager() super(SharesAdminQuotasNegativeTest, cls).resource_setup() - - # Get tenant and user - cls.identity_client = cls._get_identity_admin_client() - cls.tenant = cls.identity_client.get_tenant_by_name( - cls.shares_client.auth_params["tenant"]) - cls.user = cls.identity_client.get_user_by_username( - cls.tenant["id"], cls.shares_client.auth_params["user"]) + cls.user_id = cls.shares_client.user_id + cls.tenant_id = cls.shares_client.tenant_id @test.attr(type=["gate", "smoke", "negative"]) def test_get_quotas_with_empty_tenant_id(self): @@ -57,7 +52,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() self.assertRaises(lib_exc.BadRequest, client.update_quotas, - client.creds["tenant"]["id"], + client.tenant_id, shares=-2) @test.attr(type=["gate", "smoke", "negative"]) @@ -66,7 +61,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() self.assertRaises(lib_exc.BadRequest, client.update_quotas, - client.creds["tenant"]["id"], + client.tenant_id, snapshots=-2) @test.attr(type=["gate", "smoke", "negative"]) @@ -75,7 +70,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() self.assertRaises(lib_exc.BadRequest, client.update_quotas, - client.creds["tenant"]["id"], + client.tenant_id, gigabytes=-2) @test.attr(type=["gate", "smoke", "negative"]) @@ -84,7 +79,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() self.assertRaises(lib_exc.BadRequest, client.update_quotas, - client.creds["tenant"]["id"], + client.tenant_id, snapshot_gigabytes=-2) @test.attr(type=["gate", "smoke", "negative"]) @@ -93,7 +88,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() self.assertRaises(lib_exc.BadRequest, client.update_quotas, - client.creds["tenant"]["id"], + client.tenant_id, share_networks=-2) @test.attr(type=["gate", "smoke", "negative"]) @@ -112,14 +107,14 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas for tenant - tenant_quotas = client.show_quotas(client.creds["tenant"]["id"]) + tenant_quotas = client.show_quotas(client.tenant_id) # try set user quota for shares bigger than tenant quota bigger_value = int(tenant_quotas["shares"]) + 2 self.assertRaises(lib_exc.BadRequest, client.update_quotas, - client.creds["tenant"]["id"], - client.creds["user"]["id"], + client.tenant_id, + client.user_id, shares=bigger_value) @test.attr(type=["gate", "smoke", "negative"]) @@ -127,14 +122,14 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas for tenant - tenant_quotas = client.show_quotas(client.creds["tenant"]["id"]) + tenant_quotas = client.show_quotas(client.tenant_id) # try set user quota for snapshots bigger than tenant quota bigger_value = int(tenant_quotas["snapshots"]) + 2 self.assertRaises(lib_exc.BadRequest, client.update_quotas, - client.creds["tenant"]["id"], - client.creds["user"]["id"], + client.tenant_id, + client.user_id, snapshots=bigger_value) @test.attr(type=["gate", "smoke", "negative"]) @@ -142,14 +137,14 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas for tenant - tenant_quotas = client.show_quotas(client.creds["tenant"]["id"]) + tenant_quotas = client.show_quotas(client.tenant_id) # try set user quota for gigabytes bigger than tenant quota bigger_value = int(tenant_quotas["gigabytes"]) + 2 self.assertRaises(lib_exc.BadRequest, client.update_quotas, - client.creds["tenant"]["id"], - client.creds["user"]["id"], + client.tenant_id, + client.user_id, gigabytes=bigger_value) @test.attr(type=["gate", "smoke", "negative"]) @@ -157,14 +152,14 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas for tenant - tenant_quotas = client.show_quotas(client.creds["tenant"]["id"]) + tenant_quotas = client.show_quotas(client.tenant_id) # try set user quota for snapshot gigabytes bigger than tenant quota bigger_value = int(tenant_quotas["snapshot_gigabytes"]) + 2 self.assertRaises(lib_exc.BadRequest, client.update_quotas, - client.creds["tenant"]["id"], - client.creds["user"]["id"], + client.tenant_id, + client.user_id, snapshot_gigabytes=bigger_value) @test.attr(type=["gate", "smoke", "negative"]) @@ -172,12 +167,12 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): client = self.get_client_with_isolated_creds() # get current quotas for tenant - tenant_quotas = client.show_quotas(client.creds["tenant"]["id"]) + tenant_quotas = client.show_quotas(client.tenant_id) # try set user quota for share_networks bigger than tenant quota bigger_value = int(tenant_quotas["share_networks"]) + 2 self.assertRaises(lib_exc.BadRequest, client.update_quotas, - client.creds["tenant"]["id"], - client.creds["user"]["id"], + client.tenant_id, + client.user_id, share_networks=bigger_value) diff --git a/contrib/tempest/tempest/api/share/base.py b/contrib/tempest/tempest/api/share/base.py index 3555837158..fe8b9bd953 100644 --- a/contrib/tempest/tempest/api/share/base.py +++ b/contrib/tempest/tempest/api/share/base.py @@ -129,15 +129,6 @@ class BaseSharesTest(test.BaseTestCase): os = clients.Manager(credentials=creds) client = os.shares_client - # Get tenant and user - identity_client = cls._get_identity_admin_client() - client.creds = {} - client.creds["tenant"] = identity_client.get_tenant_by_name( - client.auth_params["tenant"]) - client.creds["user"] = identity_client.get_user_by_username( - client.creds["tenant"]["id"], - client.auth_params["user"]) - # Set place where will be deleted isolated creds ic_res = { "method": ic.clear_isolated_creds, @@ -254,10 +245,7 @@ class BaseSharesTest(test.BaseTestCase): # Create suitable network if (net_id is None or subnet_id is None): ic = isolated_creds.IsolatedCreds(name=service_net_name) - identity_client = cls._get_identity_admin_client() - tenant = identity_client.\ - get_tenant_by_name(sc.auth_params["tenant"]) - net_data = ic._create_network_resources(tenant["id"]) + net_data = ic._create_network_resources(sc.tenant_id) network, subnet, router = net_data net_id = network["id"] subnet_id = subnet["id"] diff --git a/contrib/tempest/tempest/api/share/test_quotas.py b/contrib/tempest/tempest/api/share/test_quotas.py index 57d2ba4d8f..afeb82e33d 100644 --- a/contrib/tempest/tempest/api/share/test_quotas.py +++ b/contrib/tempest/tempest/api/share/test_quotas.py @@ -22,17 +22,12 @@ class SharesQuotasTest(base.BaseSharesTest): @classmethod def resource_setup(cls): super(SharesQuotasTest, cls).resource_setup() - - # Get tenant and user - cls.identity_client = cls._get_identity_admin_client() - cls.tenant = cls.identity_client.get_tenant_by_name( - cls.shares_client.auth_params["tenant"]) - cls.user = cls.identity_client.get_user_by_username( - cls.tenant["id"], cls.shares_client.auth_params["user"]) + cls.user_id = cls.shares_client.user_id + cls.tenant_id = cls.shares_client.tenant_id @test.attr(type=["gate", "smoke", ]) def test_default_quotas(self): - quotas = self.shares_client.default_quotas(self.tenant["id"]) + quotas = self.shares_client.default_quotas(self.tenant_id) self.assertGreater(int(quotas["gigabytes"]), -2) self.assertGreater(int(quotas["snapshot_gigabytes"]), -2) self.assertGreater(int(quotas["shares"]), -2) @@ -41,7 +36,7 @@ class SharesQuotasTest(base.BaseSharesTest): @test.attr(type=["gate", "smoke", ]) def test_show_quotas(self): - quotas = self.shares_client.show_quotas(self.tenant["id"]) + quotas = self.shares_client.show_quotas(self.tenant_id) self.assertGreater(int(quotas["gigabytes"]), -2) self.assertGreater(int(quotas["snapshot_gigabytes"]), -2) self.assertGreater(int(quotas["shares"]), -2) @@ -51,7 +46,7 @@ class SharesQuotasTest(base.BaseSharesTest): @test.attr(type=["gate", "smoke", ]) def test_show_quotas_for_user(self): quotas = self.shares_client.show_quotas( - self.tenant["id"], self.user["id"]) + self.tenant_id, self.user_id) self.assertGreater(int(quotas["gigabytes"]), -2) self.assertGreater(int(quotas["snapshot_gigabytes"]), -2) self.assertGreater(int(quotas["shares"]), -2) diff --git a/contrib/tempest/tempest/api/share/test_quotas_negative.py b/contrib/tempest/tempest/api/share/test_quotas_negative.py index c26b00878c..e82beeeb1e 100644 --- a/contrib/tempest/tempest/api/share/test_quotas_negative.py +++ b/contrib/tempest/tempest/api/share/test_quotas_negative.py @@ -22,19 +22,6 @@ from tempest import test class SharesQuotasNegativeTest(base.BaseSharesTest): - force_tenant_isolation = True - - @classmethod - def resource_setup(cls): - super(SharesQuotasNegativeTest, cls).resource_setup() - - # Get tenant and user - cls.identity_client = cls._get_identity_admin_client() - cls.tenant = cls.identity_client.get_tenant_by_name( - cls.shares_client.auth_params["tenant"]) - cls.user = cls.identity_client.get_user_by_username( - cls.tenant["id"], cls.shares_client.auth_params["user"]) - @test.attr(type=["gate", "smoke", "negative"]) def test_get_quotas_with_empty_tenant_id(self): self.assertRaises(lib_exc.NotFound, diff --git a/contrib/tempest/tempest/scenario/manager_share.py b/contrib/tempest/tempest/scenario/manager_share.py index 64d2f863d5..67e2419f28 100644 --- a/contrib/tempest/tempest/scenario/manager_share.py +++ b/contrib/tempest/tempest/scenario/manager_share.py @@ -36,11 +36,8 @@ class ShareScenarioTest(manager.NetworkScenarioTest): cls.set_network_resources() super(ShareScenarioTest, cls).resource_setup() - os = clients_share.Manager( - credentials=cls.credentials() - ) # Manila clients - cls.shares_client = os.shares_client + cls.shares_client = clients_share.Manager().shares_client cls.shares_admin_client = clients_share.AdminManager().shares_client def _create_share(self, share_protocol=None, size=1, name=None, diff --git a/contrib/tempest/tempest/services/share/json/shares_client.py b/contrib/tempest/tempest/services/share/json/shares_client.py index 479ca005ac..cd416868cb 100644 --- a/contrib/tempest/tempest/services/share/json/shares_client.py +++ b/contrib/tempest/tempest/services/share/json/shares_client.py @@ -47,7 +47,6 @@ class SharesClient(service_client.ServiceClient): self.share_network_id = CONF.share.share_network_id self.build_interval = CONF.share.build_interval self.build_timeout = CONF.share.build_timeout - self.auth_params = auth_provider._auth_params() def create_share(self, share_protocol=None, size=1, name=None, snapshot_id=None, description=None,