diff options
author | Tim Burke <tim.burke@gmail.com> | 2019-08-06 10:00:41 -0700 |
---|---|---|
committer | Tim Burke <tim.burke@gmail.com> | 2019-08-06 13:56:47 -0700 |
commit | 2c727f65ffae3d925fb825e20616615ab319d1d2 (patch) | |
tree | 1baf8dada3aa369d808c402c174296940b62d25b | |
parent | ab192415347223cfb49af7a62e124ef6f35779a6 (diff) | |
download | swift-2c727f65ffae3d925fb825e20616615ab319d1d2.tar.gz |
py3: Add swift-tox-func-encryption-py37 gate job
Change-Id: Ia9ae0fc226dfc9b40157faebac100c10a9180c62
-rw-r--r-- | .zuul.yaml | 18 | ||||
-rw-r--r-- | test/functional/__init__.py | 6 | ||||
-rw-r--r-- | tox.ini | 6 |
3 files changed, 29 insertions, 1 deletions
diff --git a/.zuul.yaml b/.zuul.yaml index 42c404992..d206891d9 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -97,6 +97,18 @@ python_version: 3.7 - job: + name: swift-tox-func-encryption-py37 + parent: swift-tox-func-py37 + description: | + Run functional tests for swift under cPython version 3.7. + + Uses tox with the ``func-encryption-py3`` environment. + It sets TMPDIR to an XFS mount point created via + tools/test-setup.sh. + vars: + tox_envlist: func-encryption-py3 + +- job: name: swift-tox-func-ec-py37 parent: swift-tox-func-py37 description: | @@ -454,6 +466,11 @@ - ^(api-ref|doc|releasenotes)/.*$ - ^test/probe/.*$ - ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$ + - swift-tox-func-encryption-py37: + irrelevant-files: + - ^(api-ref|doc|releasenotes)/.*$ + - ^test/probe/.*$ + - ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$ - swift-tox-func-domain-remap-staticweb-py37: irrelevant-files: - ^(api-ref|doc|releasenotes)/.*$ @@ -536,6 +553,7 @@ - swift-tox-func-ec - swift-tox-func-s3api - swift-tox-func-py37 + - swift-tox-func-encryption - swift-tox-func-domain-remap-staticweb-py37 - swift-tox-func-ec-py37 - swift-probetests-centos-7: diff --git a/test/functional/__init__.py b/test/functional/__init__.py index b2f66aa78..0aa3a2f10 100644 --- a/test/functional/__init__.py +++ b/test/functional/__init__.py @@ -16,6 +16,7 @@ from __future__ import print_function import mock import os +import six from six.moves.urllib.parse import urlparse, urlsplit, urlunsplit import sys import pickle @@ -25,6 +26,7 @@ import eventlet import eventlet.debug import functools import random +import base64 from time import time, sleep from contextlib import closing @@ -319,7 +321,9 @@ def _load_encryption(proxy_conf_file, swift_conf_file, **kwargs): "proxy-logging proxy-server", "keymaster encryption proxy-logging proxy-server") conf.set(section, 'pipeline', pipeline) - root_secret = os.urandom(32).encode("base64") + root_secret = base64.b64encode(os.urandom(32)) + if not six.PY2: + root_secret = root_secret.decode('ascii') conf.set('filter:keymaster', 'encryption_root_secret', root_secret) except NoSectionError as err: msg = 'Error problem with proxy conf file %s: %s' % \ @@ -61,6 +61,12 @@ commands = {[testenv:func-py3]commands} setenv = SWIFT_TEST_IN_PROCESS=1 SWIFT_TEST_IN_PROCESS_CONF_LOADER=ec +[testenv:func-encryption-py3] +basepython = python3 +commands = {[testenv:func-py3]commands} +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} |