From c98a3254c84c00f05db63a74f26010ab80e699c6 Mon Sep 17 00:00:00 2001 From: nicolas Date: Mon, 17 Dec 2018 13:06:02 -0800 Subject: [PATCH] Immutable user source: Non-admin V2 and V3 tests If the keystone user source is immutable, such as an LDAP active directory implementation, tempest tests that try to create or delete a user will fail. Instead of failing, we would like them to skip. This change uses a testtools decorator to avoid unnecessary modifications and allow those tests to skip. In [1], I introduced the config setting that allows this to happen. [1] https://review.openstack.org/#/c/585536/ Change-Id: I786499204acdb929ee341e014bcb0459d2f27483 Partial-Bug: 1777047 --- tempest/api/identity/v2/test_users.py | 6 ++++++ tempest/api/identity/v3/test_users.py | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/tempest/api/identity/v2/test_users.py b/tempest/api/identity/v2/test_users.py index 158dfb3bc7..2eea86093c 100644 --- a/tempest/api/identity/v2/test_users.py +++ b/tempest/api/identity/v2/test_users.py @@ -15,6 +15,8 @@ import time +import testtools + from tempest.api.identity import base from tempest import config from tempest.lib.common.utils import data_utils @@ -78,6 +80,10 @@ class IdentityUsersTest(base.BaseIdentityV2Test): self.non_admin_users_client.auth_provider.set_auth() @decorators.idempotent_id('165859c9-277f-4124-9479-a7d1627b0ca7') + @testtools.skipIf(CONF.identity_feature_enabled.immutable_user_source, + 'Skipped because environment has an ' + 'immutable user source and solely ' + 'provides read-only access to users.') def test_user_update_own_password(self): old_pass = self.creds.password old_token = self.non_admin_users_client.token diff --git a/tempest/api/identity/v3/test_users.py b/tempest/api/identity/v3/test_users.py index 13b5161a9d..d4e7612dfb 100644 --- a/tempest/api/identity/v3/test_users.py +++ b/tempest/api/identity/v3/test_users.py @@ -77,6 +77,10 @@ class IdentityV3UsersTest(base.BaseIdentityV3Test): self.non_admin_users_client.auth_provider.set_auth() @decorators.idempotent_id('ad71bd23-12ad-426b-bb8b-195d2b635f27') + @testtools.skipIf(CONF.identity_feature_enabled.immutable_user_source, + 'Skipped because environment has an ' + 'immutable user source and solely ' + 'provides read-only access to users.') def test_user_update_own_password(self): old_pass = self.creds.password old_token = self.non_admin_client.token @@ -102,6 +106,10 @@ class IdentityV3UsersTest(base.BaseIdentityV3Test): @testtools.skipUnless(CONF.identity_feature_enabled.security_compliance, 'Security compliance not available.') @decorators.idempotent_id('941784ee-5342-4571-959b-b80dd2cea516') + @testtools.skipIf(CONF.identity_feature_enabled.immutable_user_source, + 'Skipped because environment has an ' + 'immutable user source and solely ' + 'provides read-only access to users.') def test_password_history_check_self_service_api(self): old_pass = self.creds.password new_pass1 = data_utils.rand_password()