Patched test_getaddrinfo due netbase update (Closes: #850508)

Change-Id: I485f31c93d8d08a095e75d346c7a5c804139b01d
This commit is contained in:
Ondřej Kobližek 2017-01-12 16:33:54 +01:00 committed by Ondřej Nový
parent a4356e284c
commit d40caf5c84
4 changed files with 64 additions and 53 deletions

8
debian/changelog vendored
View File

@ -1,12 +1,14 @@
python-eventlet (0.19.0-5) unstable; urgency=medium
* Team upload.
[ Ondřej Nový ]
* Bumped debhelper version to 10
[ Thomas Goirand ]
* Add remove-udp-tests-in-greendns-tests.patch to fix FTBFS (Closes: #850508)
[ Ondřej Kobližek ]
* Patched test_getaddrinfo due netbase update (Closes: #850508)
-- Thomas Goirand <zigo@debian.org> Tue, 10 Jan 2017 15:00:08 +0100
-- Ondřej Kobližek <koblizeko@gmail.com> Thu, 12 Jan 2017 16:27:04 +0100
python-eventlet (0.19.0-4) unstable; urgency=medium

View File

@ -0,0 +1,58 @@
Description: Patched test_getaddrinfo due netbase update
Asserting udp for ssh introduce test failures with netbase 5.4
because removed ssh (22/udp).
This fix changes ssh -> domain, which better suit for test name and
allows tcp and udp simultaneously.
Author: Ondřej Kobližek <koblizeko@gmail.com>
Forwarded: https://github.com/eventlet/eventlet/pull/375
--- a/tests/greendns_test.py
+++ b/tests/greendns_test.py
@@ -514,11 +514,11 @@
greendns.resolve = _make_mock_resolve()
greendns.resolve.add('example.com', '127.0.0.2')
greendns.resolve.add('example.com', '::1')
- res = greendns.getaddrinfo('example.com', 'ssh')
- addr = ('127.0.0.2', 22)
+ res = greendns.getaddrinfo('example.com', 'domain')
+ addr = ('127.0.0.2', 53)
tcp = (socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP, addr)
udp = (socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP, addr)
- addr = ('::1', 22, 0, 0)
+ addr = ('::1', 53, 0, 0)
tcp6 = (socket.AF_INET6, socket.SOCK_STREAM, socket.IPPROTO_TCP, addr)
udp6 = (socket.AF_INET6, socket.SOCK_DGRAM, socket.IPPROTO_UDP, addr)
filt_res = [ai[:3] + (ai[4],) for ai in res]
@@ -532,8 +532,8 @@
greendns.resolve = _make_mock_resolve()
idn_name = u'евентлет.com'
greendns.resolve.add(idn_name.encode('idna').decode('ascii'), '127.0.0.2')
- res = greendns.getaddrinfo(idn_name, 'ssh')
- addr = ('127.0.0.2', 22)
+ res = greendns.getaddrinfo(idn_name, 'domain')
+ addr = ('127.0.0.2', 53)
tcp = (socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP, addr)
udp = (socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP, addr)
filt_res = [ai[:3] + (ai[4],) for ai in res]
@@ -544,8 +544,8 @@
def test_getaddrinfo_inet(self):
greendns.resolve = _make_mock_resolve()
greendns.resolve.add('example.com', '127.0.0.2')
- res = greendns.getaddrinfo('example.com', 'ssh', socket.AF_INET)
- addr = ('127.0.0.2', 22)
+ res = greendns.getaddrinfo('example.com', 'domain', socket.AF_INET)
+ addr = ('127.0.0.2', 53)
tcp = (socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP, addr)
udp = (socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP, addr)
assert tcp in [ai[:3] + (ai[4],) for ai in res]
@@ -555,8 +555,8 @@
def test_getaddrinfo_inet6(self):
greendns.resolve = _make_mock_resolve()
greendns.resolve.add('example.com', '::1')
- res = greendns.getaddrinfo('example.com', 'ssh', socket.AF_INET6)
- addr = ('::1', 22, 0, 0)
+ res = greendns.getaddrinfo('example.com', 'domain', socket.AF_INET6)
+ addr = ('::1', 53, 0, 0)
tcp = (socket.AF_INET6, socket.SOCK_STREAM, socket.IPPROTO_TCP, addr)
udp = (socket.AF_INET6, socket.SOCK_DGRAM, socket.IPPROTO_UDP, addr)
assert tcp in [ai[:3] + (ai[4],) for ai in res]

View File

@ -1,49 +0,0 @@
Description: Remove udp asserts in greendns tests
These tests are failing, and they aren't relevant for how we use Eventlet
in Debian (as much as I know, no OpenStack service are using udp anyway).
Author: Thomas Goirand <zigo@debian.org>
Bug-Debian: https://bugs.debian.org/850508
Forwarded: not-needed
Last-Update: 2017-01-10
--- python-eventlet-0.19.0.orig/tests/greendns_test.py
+++ python-eventlet-0.19.0/tests/greendns_test.py
@@ -518,9 +518,9 @@ class TestGetaddrinfo(tests.LimitedTestC
udp6 = (socket.AF_INET6, socket.SOCK_DGRAM, socket.IPPROTO_UDP, addr)
filt_res = [ai[:3] + (ai[4],) for ai in res]
assert tcp in filt_res
- assert udp in filt_res
+# assert udp in filt_res
assert tcp6 in filt_res
- assert udp6 in filt_res
+# assert udp6 in filt_res
@tests.skip_unless(greendns_requirement)
def test_getaddrinfo_idn(self):
@@ -533,7 +533,7 @@ class TestGetaddrinfo(tests.LimitedTestC
udp = (socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP, addr)
filt_res = [ai[:3] + (ai[4],) for ai in res]
assert tcp in filt_res
- assert udp in filt_res
+# assert udp in filt_res
@tests.skip_unless(greendns_requirement)
def test_getaddrinfo_inet(self):
@@ -544,7 +544,7 @@ class TestGetaddrinfo(tests.LimitedTestC
tcp = (socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP, addr)
udp = (socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP, addr)
assert tcp in [ai[:3] + (ai[4],) for ai in res]
- assert udp in [ai[:3] + (ai[4],) for ai in res]
+# assert udp in [ai[:3] + (ai[4],) for ai in res]
@tests.skip_unless(greendns_requirement)
def test_getaddrinfo_inet6(self):
@@ -555,7 +555,7 @@ class TestGetaddrinfo(tests.LimitedTestC
tcp = (socket.AF_INET6, socket.SOCK_STREAM, socket.IPPROTO_TCP, addr)
udp = (socket.AF_INET6, socket.SOCK_DGRAM, socket.IPPROTO_UDP, addr)
assert tcp in [ai[:3] + (ai[4],) for ai in res]
- assert udp in [ai[:3] + (ai[4],) for ai in res]
+# assert udp in [ai[:3] + (ai[4],) for ai in res]
@tests.skip_unless(greendns_requirement)
def test_getaddrinfo_only_a_ans(self):

View File

@ -6,4 +6,4 @@ remove-networking-tests.patch
greendns_tests_fix.patch
remove-test_import_patched_defaults.patch
patch-out-intersphinx.patch
remove-udp-tests-in-greendns-tests.patch
fix-FTBFS-test_getaddrinfo.patch