From 74db3670607d952e597011eb07676aedff521b41 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Wed, 7 Aug 2019 16:16:57 -0700 Subject: [PATCH] py3: Finish porting func tests We were (indirectly) importing swiftclient (and therefore requests and urllib3) before doing our eventlet monkey-patching. This would lead boto3 (which digs an SSLContext out of urllib3) to trip RecursionErrors on py3 similar to >>> from ssl import SSLContext, PROTOCOL_SSLv23 >>> import eventlet >>> eventlet.monkey_patch(socket=True) >>> SSLContext(PROTOCOL_SSLv23).options |= 0 Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/ssl.py", line 465, in options super(SSLContext, SSLContext).options.__set__(self, value) File "/usr/lib/python3.6/ssl.py", line 465, in options super(SSLContext, SSLContext).options.__set__(self, value) File "/usr/lib/python3.6/ssl.py", line 465, in options super(SSLContext, SSLContext).options.__set__(self, value) [Previous line repeated 330 more times] RecursionError: maximum recursion depth exceeded while calling a Python object Change-Id: I4bb59edd87336597791416c4f2a096efe0e72fe3 --- test/functional/__init__.py | 6 ++++-- tox.ini | 29 +++++------------------------ 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/test/functional/__init__.py b/test/functional/__init__.py index 0aa3a2f10a..9225e10fe2 100644 --- a/test/functional/__init__.py +++ b/test/functional/__init__.py @@ -43,8 +43,6 @@ from swift.common.storage_policy import parse_storage_policies, PolicyError from swift.common.utils import set_swift_dir from test import get_config, listen_zero -from test.functional.swift_test_client import Account, Connection, Container, \ - ResponseError from test.unit import debug_logger, FakeMemcache # importing skip_if_no_xattrs so that functional tests can grab it from the @@ -75,6 +73,10 @@ eventlet.hubs.use_hub(utils.get_hub()) eventlet.patcher.monkey_patch(all=False, socket=True) eventlet.debug.hub_exceptions(False) +# swift_test_client import from swiftclient, so move after the monkey-patching +from test.functional.swift_test_client import Account, Connection, Container, \ + ResponseError + from swiftclient import get_auth, http_connection has_insecure = False diff --git a/tox.ini b/tox.ini index ade68e2770..7d25a6acde 100644 --- a/tox.ini +++ b/tox.ini @@ -46,48 +46,29 @@ commands = ./.functests {posargs} [testenv:func-py3] basepython = python3 -commands = - nosetests {posargs: \ - test/functional/s3api/test_acl.py \ - test/functional/s3api/test_multi_delete.py \ - test/functional/s3api/test_multi_upload.py \ - test/functional/s3api/test_object.py \ - test/functional/s3api/test_presigned.py \ - test/functional/s3api/test_service.py \ - test/functional/test_access_control.py \ - test/functional/test_account.py \ - test/functional/test_container.py \ - test/functional/test_dlo.py \ - test/functional/test_domain_remap.py \ - test/functional/test_object.py \ - test/functional/test_slo.py \ - test/functional/test_staticweb.py \ - test/functional/test_symlink.py \ - test/functional/test_tempurl.py \ - test/functional/test_versioned_writes.py \ - test/functional/tests.py} +commands = ./.functests {posargs} [testenv:func-ec-py3] basepython = python3 -commands = {[testenv:func-py3]commands} +commands = ./.functests {posargs} setenv = SWIFT_TEST_IN_PROCESS=1 SWIFT_TEST_IN_PROCESS_CONF_LOADER=ec [testenv:func-s3api-py3] basepython = python3 -commands = {[testenv:func-py3]commands} +commands = ./.functests {posargs} setenv = SWIFT_TEST_IN_PROCESS=1 SWIFT_TEST_IN_PROCESS_CONF_LOADER=s3api [testenv:func-encryption-py3] basepython = python3 -commands = {[testenv:func-py3]commands} +commands = ./.functests {posargs} setenv = SWIFT_TEST_IN_PROCESS=1 SWIFT_TEST_IN_PROCESS_CONF_LOADER=encryption [testenv:func-domain-remap-staticweb-py3] basepython = python3 -commands = {[testenv:func-py3]commands} +commands = ./.functests {posargs} setenv = SWIFT_TEST_IN_PROCESS=1 SWIFT_TEST_IN_PROCESS_CONF_LOADER=domain_remap_staticweb