diff --git a/test/functional/test_access_control.py b/test/functional/test_access_control.py index 76b3400c46..7bc3e479a2 100644 --- a/test/functional/test_access_control.py +++ b/test/functional/test_access_control.py @@ -19,7 +19,10 @@ from six.moves.urllib.parse import urlparse, urlunparse import uuid from random import shuffle -from keystoneclient.v3 import client +try: + from keystoneclient.v3 import ksc +except ImportError: + ksc = None from swiftclient import get_auth, http_connection import test.functional as tf @@ -3034,7 +3037,7 @@ class KeystoneClient(BaseClient): def _get_id(self, user_name): info = self.users.get(user_name) - keystone_client = client.Client( + keystone_client = ksc.Client( auth_url=self.auth_url, version=(self.auth_version,), username=user_name, @@ -3092,6 +3095,8 @@ class SwiftClient(BaseClient): class BaseTestAC(unittest.TestCase): def setUp(self): + if ksc is None: + raise unittest.SkipTest('keystoneclient is not available') self.reseller_admin = tf.swift_test_user[5] self.client = SwiftClient() diff --git a/test/functional/test_tempurl.py b/test/functional/test_tempurl.py index 321a3727a9..54659bc319 100644 --- a/test/functional/test_tempurl.py +++ b/test/functional/test_tempurl.py @@ -802,6 +802,16 @@ def requires_digest(digest): class TestTempurlAlgorithms(Base): env = TestTempurlEnv + def setUp(self): + super(TestTempurlAlgorithms, self).setUp() + if self.env.tempurl_enabled is False: + raise SkipTest("TempURL not enabled") + elif self.env.tempurl_enabled is not True: + # just some sanity checking + raise Exception( + "Expected tempurl_enabled to be True/False, got %r" % + (self.env.tempurl_enabled,)) + def get_sig(self, expires, digest, encoding): path = urllib.parse.unquote(self.env.conn.make_path(self.env.obj.path)) if six.PY2: diff --git a/test/functional/test_versioned_writes.py b/test/functional/test_versioned_writes.py index 7521825f2c..1dd381af90 100644 --- a/test/functional/test_versioned_writes.py +++ b/test/functional/test_versioned_writes.py @@ -1136,6 +1136,11 @@ class TestSloWithVersioningUTF8(Base2, TestSloWithVersioning): class TestObjectVersioningChangingMode(Base): env = TestObjectVersioningHistoryModeEnv + def setUp(self): + super(TestObjectVersioningChangingMode, self).setUp() + if 'versioned_writes' not in cluster_info: + raise SkipTest("versioned_writes not enabled") + def test_delete_while_changing_mode(self): container = self.env.container versions_container = self.env.versions_container