Clean up py35 env in tox.ini.
This patch enables the py35 job in tox.ini to run using ostestr. It also fixes a bytes encoding issue in the 'test_wsgi' functional test to make progress towards the community goal of enabling python3.5. Two other functional tests remain disabled and will need to be addressed in a later patch in order to fully complete the community goal - 'test_ssl' and 'test_reload'. These tests fail due to SSL handshake not working in python3.5 when using self-signed certificate and authority. Change-Id: Ie9071f1a93d8201f754ae3042d6e51b5de6d2e63
This commit is contained in:
parent
0a98c2733c
commit
9a55baa2c8
@ -16,9 +16,11 @@
|
||||
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
|
||||
@ -101,6 +103,7 @@ 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):
|
||||
|
@ -14,8 +14,10 @@
|
||||
# under the License.
|
||||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import httplib2
|
||||
import six
|
||||
from six.moves import http_client as http
|
||||
|
||||
from glance.tests import functional
|
||||
@ -72,6 +74,7 @@ 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()
|
||||
|
@ -32,7 +32,7 @@ class TestWSGIServer(testtools.TestCase):
|
||||
CONF.set_default("workers", 0)
|
||||
CONF.set_default("client_socket_timeout", 1)
|
||||
"""Verify connections are timed out as per 'client_socket_timeout'"""
|
||||
greetings = 'Hello, World!!!'
|
||||
greetings = b'Hello, World!!!'
|
||||
|
||||
def hello_world(env, start_response):
|
||||
start_response('200 OK', [('Content-Type', 'text/plain')])
|
||||
@ -46,7 +46,7 @@ class TestWSGIServer(testtools.TestCase):
|
||||
sock = socket.socket()
|
||||
sock.connect(('127.0.0.1', port))
|
||||
time.sleep(delay)
|
||||
sock.send('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n')
|
||||
sock.send(b'GET / HTTP/1.1\r\nHost: localhost\r\n\r\n')
|
||||
return sock.recv(1024)
|
||||
|
||||
# Should succeed - no timeout
|
||||
|
36
tox.ini
36
tox.ini
@ -39,39 +39,9 @@ passenv = *_proxy *_PROXY
|
||||
commands = ostestr --slowest {posargs}
|
||||
|
||||
[testenv:py35]
|
||||
commands =
|
||||
lockutils-wrapper python setup.py testr --slowest --testr-args='glance.tests.unit'
|
||||
python -m testtools.run \
|
||||
glance.tests.functional.test_cache_middleware \
|
||||
glance.tests.functional.test_api \
|
||||
glance.tests.functional.test_client_redirects \
|
||||
glance.tests.functional.test_glance_manage \
|
||||
glance.tests.functional.test_gzip_middleware \
|
||||
glance.tests.functional.test_healthcheck_middleware \
|
||||
glance.tests.functional.test_client_exceptions \
|
||||
glance.tests.functional.test_sqlite \
|
||||
glance.tests.functional.test_cors_middleware \
|
||||
glance.tests.functional.test_glance_replicator \
|
||||
glance.tests.functional.test_scrubber \
|
||||
glance.tests.functional.test_logging \
|
||||
glance.tests.functional.test_bin_glance_cache_manage \
|
||||
glance.tests.functional.db.test_simple \
|
||||
glance.tests.functional.db.test_sqlalchemy \
|
||||
glance.tests.functional.db.test_rpc_endpoint \
|
||||
glance.tests.functional.v1.test_api \
|
||||
glance.tests.functional.v1.test_copy_to_file \
|
||||
glance.tests.functional.v1.test_misc \
|
||||
glance.tests.functional.v1.test_multiprocessing \
|
||||
glance.tests.functional.v2.test_metadef_objects \
|
||||
glance.tests.functional.v2.test_schemas \
|
||||
glance.tests.functional.v2.test_metadef_properties \
|
||||
glance.tests.functional.v2.test_metadef_resourcetypes \
|
||||
glance.tests.functional.v2.test_metadef_tags \
|
||||
glance.tests.functional.v2.test_images \
|
||||
glance.tests.functional.v2.test_metadef_namespaces \
|
||||
glance.tests.integration.v2.test_tasks_api \
|
||||
glance.tests.integration.v2.test_property_quota_violations \
|
||||
glance.tests.integration.legacy_functional.test_v1_api
|
||||
# The periodic oslo-with-master test does not work with the
|
||||
# conditionals in [testenv], use separate environment.
|
||||
commands = ostestr --slowest {posargs}
|
||||
|
||||
[testenv:pep8]
|
||||
commands =
|
||||
|
Loading…
x
Reference in New Issue
Block a user