diff options
author | Hui Xiang <hui.xiang@canonical.com> | 2014-12-06 15:12:45 +0800 |
---|---|---|
committer | Adam Gandelman <adamg@ubuntu.com> | 2015-01-07 14:26:06 -0800 |
commit | 0400de4b15627a02a4d32efa5a506a9f72fb6ac0 (patch) | |
tree | d1c4f5de05bbd43f521b8e251bdd30631f5c9955 | |
parent | 07a99e1eaace09bdfb77dae2edb40d76de2c545a (diff) | |
download | glance-0400de4b15627a02a4d32efa5a506a9f72fb6ac0.tar.gz |
Fix and add a test case for IPv6
Fixing and adding a test case in relation to the eventlet ipv6 fix
in patch set 23 (https://review.openstack.org/#/c/101079/).
* pre-import eventlet for test case test_evnetlet_no_dnspython,
which wasn't actually importing eventlet like it described.
* add case test_no_evnetlet_no_dnspython
Change-Id: I55c40ed735781862f8352afb917058bf475d16fe
(cherry picked from commit 9447d37d653d87c89a1daf8f5affe41269beffbd)
-rw-r--r-- | glance/tests/unit/common/test_wsgi_ipv6.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/glance/tests/unit/common/test_wsgi_ipv6.py b/glance/tests/unit/common/test_wsgi_ipv6.py index 166917021..6d9e3f8ff 100644 --- a/glance/tests/unit/common/test_wsgi_ipv6.py +++ b/glance/tests/unit/common/test_wsgi_ipv6.py @@ -35,7 +35,9 @@ else: sys.exit(%d) """ -eventlet_no_dns = script % ('fake', '', 'yes', '', 1, 0) +eventlet_no_dns = script % ('fake', 'import eventlet', 'foo', 'not', 1, 0) + +no_eventlet_no_dns = script % ('fake', '', 'foo', '', 1, 0) no_eventlet_no_greendns = script % ('dns', '', 'yes', '', 1, 0) @@ -48,8 +50,13 @@ eventlet_greendns = script % ('dns', 'import eventlet', 'no', 'not', 0, 1) class IPv6ServerTest(test_utils.BaseTestCase): + def test_no_evnetlet_no_dnspython(self): + """Test eventlet not imported and dnspython not installed""" + rc = subprocess.call(['python', '-c', no_eventlet_no_dns]) + self.assertEqual(0, rc) + def test_evnetlet_no_dnspython(self): - """Test eventlet imported but dnspython not installed""" + """Test eventlet pre-imported but dnspython not installed""" rc = subprocess.call(['python', '-c', eventlet_no_dns]) self.assertEqual(0, rc) |