From 837937f8d2d305bc9b2ecfbfbed79374a7f6c555 Mon Sep 17 00:00:00 2001 From: Brian Rosmaita Date: Tue, 29 May 2018 19:10:36 -0400 Subject: [PATCH] Add glance-eventlet-ssl-handshake-broken-py35 job Blacklist the two currently skipped functional-py35 tests and include them in a new non-voting job so that their failure is obvious instead of hidden. Change-Id: Ice8e114c6590b25f3ec79fbe4c06efaa245706c0 Partial-bug: #1769006 --- .zuul.yaml | 10 ++++++++++ broken-functional-py35-ssl-tests.txt | 2 ++ glance/tests/functional/test_reload.py | 3 --- glance/tests/functional/test_ssl.py | 3 --- tools/generate-blacklist.sh | 9 +++++++++ tox.ini | 18 +++++++++++++++++- 6 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 broken-functional-py35-ssl-tests.txt create mode 100755 tools/generate-blacklist.sh diff --git a/.zuul.yaml b/.zuul.yaml index db2dad3054..7c0d99588f 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -10,6 +10,14 @@ - openstack/glance nodeset: legacy-ubuntu-xenial-2-node +- job: + name: glance-eventlet-ssl-handshake-broken-py35 + parent: tox + description: | + See https://bugs.launchpad.net/glance/+bug/1482633 + vars: + tox_envlist: broken-py35-ssl-tests + - job: name: glance-tox-oslo-tips-base parent: tox @@ -176,6 +184,8 @@ - openstack-tox-functional - openstack-tox-functional-py35 - openstack-tox-lower-constraints + - glance-eventlet-ssl-handshake-broken-py35: + voting: false gate: jobs: - openstack-tox-functional diff --git a/broken-functional-py35-ssl-tests.txt b/broken-functional-py35-ssl-tests.txt new file mode 100644 index 0000000000..58c55b3901 --- /dev/null +++ b/broken-functional-py35-ssl-tests.txt @@ -0,0 +1,2 @@ +^glance\.tests\.functional\.test_reload\.TestReload\.test_reload$ +^glance\.tests\.functional\.test_ssl\.TestSSL\.test_ssl_ok$ diff --git a/glance/tests/functional/test_reload.py b/glance/tests/functional/test_reload.py index 006e020a4b..62d51a2df5 100644 --- a/glance/tests/functional/test_reload.py +++ b/glance/tests/functional/test_reload.py @@ -16,11 +16,9 @@ import os import re import time -import unittest import psutil import requests -import six from six.moves import http_client as http from glance.tests import functional @@ -103,7 +101,6 @@ class TestReload(functional.FunctionalTest): def _url(self, protocol, path): return '%s://127.0.0.1:%d%s' % (protocol, self.api_port, path) - @unittest.skipIf(six.PY3, 'SSL handshakes are broken in PY3') def test_reload(self): """Test SIGHUP picks up new config values""" def check_pids(pre, post=None, workers=2): diff --git a/glance/tests/functional/test_ssl.py b/glance/tests/functional/test_ssl.py index 750fdef35c..7b584c2def 100644 --- a/glance/tests/functional/test_ssl.py +++ b/glance/tests/functional/test_ssl.py @@ -14,10 +14,8 @@ # under the License. import os -import unittest import httplib2 -import six from six.moves import http_client as http from glance.tests import functional @@ -74,7 +72,6 @@ class TestSSL(functional.FunctionalTest): if getattr(self, 'inited', False): return - @unittest.skipIf(six.PY3, 'SSL handshakes are broken in PY3') def test_ssl_ok(self): """Make sure the public API works with HTTPS.""" self.cleanup() diff --git a/tools/generate-blacklist.sh b/tools/generate-blacklist.sh new file mode 100755 index 0000000000..a42f628a4b --- /dev/null +++ b/tools/generate-blacklist.sh @@ -0,0 +1,9 @@ +#!/bin/bash -xe + +TOX_INI_DIR="$1" +TOX_TMP_DIR="$2" + +cat "${TOX_INI_DIR}/serial-functests.txt" \ + "${TOX_INI_DIR}/broken-functional-py35-ssl-tests.txt" > \ + "${TOX_TMP_DIR}/func-py35-blacklist.txt" + diff --git a/tox.ini b/tox.ini index 4b58dd205b..ccf5aaec8a 100644 --- a/tox.ini +++ b/tox.ini @@ -48,10 +48,26 @@ basepython = python3.5 setenv = TEST_PATH = ./glance/tests/functional ignore_errors = True +whitelist_externals = + bash commands = - stestr run --blacklist-file ./serial-functests.txt {posargs} + # NOTE(rosmaita): calling this script is a complete hack, everything + # is hard-coded. + bash tools/generate-blacklist.sh {toxinidir} {envtmpdir} + stestr run --blacklist-file {envtmpdir}/func-py35-blacklist.txt {posargs} stestr run --serial --combine --whitelist-file ./serial-functests.txt {posargs} +[testenv:broken-py35-ssl-tests] +# NOTE(rosmaita): these tests were being skipped due to bug #1482633, but we +# want it to be obvious that Glance is affected by the eventlet ssl-handshake +# problem under py35. (When this testenv is removed, don't forget to adjust +# the blacklist generation in the functional-py35 testenv.) +basepython = python3.5 +setenv = + TEST_PATH = ./glance/tests/functional +commands = + stestr run --whitelist-file ./broken-functional-py35-ssl-tests.txt {posargs} + [testenv:pep8] commands = flake8 {posargs}