From e973e15cfabac880fbf3f250c776e44a261c1af8 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Sun, 24 May 2020 22:51:04 -0700 Subject: [PATCH] Get func tests passing with a minimal proxy pipeline I've now got 54 pass, 676 skipped with pipeline = proxy-logging memcache tempauth proxy-logging proxy-server Could probably even ditch logging, but that'd get a bit painful to debug. Change-Id: I86bcd7a2373cf1e7213cb716888307306b7bb50d --- test/functional/test_access_control.py | 9 +++++++-- test/functional/test_tempurl.py | 10 ++++++++++ test/functional/test_versioned_writes.py | 5 +++++ 3 files changed, 22 insertions(+), 2 deletions(-) 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 d58da88e62..d8889df75f 100644 --- a/test/functional/test_versioned_writes.py +++ b/test/functional/test_versioned_writes.py @@ -1129,6 +1129,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