From 2c727f65ffae3d925fb825e20616615ab319d1d2 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Tue, 6 Aug 2019 10:00:41 -0700 Subject: py3: Add swift-tox-func-encryption-py37 gate job Change-Id: Ia9ae0fc226dfc9b40157faebac100c10a9180c62 --- .zuul.yaml | 18 ++++++++++++++++++ test/functional/__init__.py | 6 +++++- tox.ini | 6 ++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.zuul.yaml b/.zuul.yaml index 42c404992..d206891d9 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -96,6 +96,18 @@ bindep_profile: test py37 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 @@ -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' % \ diff --git a/tox.ini b/tox.ini index ec08549c2..4acb5781d 100644 --- a/tox.ini +++ b/tox.ini @@ -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} -- cgit v1.2.1