From: John Griffith Date: Thu, 17 Jan 2013 23:30:32 +0000 (-0700) Subject: Check for configured IPV6 before running tests X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ad45eb32a6be5b47b89508d3dfba409434a049e1;p=openstack-build%2Fcinder-build.git Check for configured IPV6 before running tests Some folks don't/can't have IPV6 configured on their systems, the new IPV6 tests in test_wsgi require that you do, so let's add a check and skip if there are no IPV6 configured interfaces. Change-Id: I7cbdcbc3ad4cc4690634f6464d6e28d9f4dfd791 --- diff --git a/cinder/tests/test_wsgi.py b/cinder/tests/test_wsgi.py index 288f60d57..f69c7e0a4 100644 --- a/cinder/tests/test_wsgi.py +++ b/cinder/tests/test_wsgi.py @@ -30,6 +30,7 @@ from cinder.api.middleware import fault from cinder import exception from cinder.openstack.common import cfg from cinder import test +from cinder import utils import cinder.wsgi CONF = cfg.CONF @@ -102,6 +103,11 @@ class TestWSGIServer(unittest.TestCase): server.wait() def test_start_random_port_with_ipv6(self): + #check to see if we have IPV6 configured on this system + out, err = utils.execute('cat', '/proc/net/if_inet6') + if not out: + self.skipTest("No IPV6 interface configured") + server = cinder.wsgi.Server("test_random_port", None, host="::1") @@ -151,6 +157,11 @@ class TestWSGIServer(unittest.TestCase): server.stop() def test_app_using_ipv6_and_ssl(self): + #check to see if we have IPV6 configured on this system + out, err = utils.execute('cat', '/proc/net/if_inet6') + if not out: + self.skipTest("No IPV6 interface configured") + CONF.set_default("ssl_cert_file", os.path.join(TEST_VAR_DIR, 'certificate.crt')) CONF.set_default("ssl_key_file",