From ad45eb32a6be5b47b89508d3dfba409434a049e1 Mon Sep 17 00:00:00 2001 From: John Griffith Date: Thu, 17 Jan 2013 16:30:32 -0700 Subject: [PATCH] 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 --- cinder/tests/test_wsgi.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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", -- 2.45.2