File: fix-FTBFS-test_getaddrinfo.patch

package info (click to toggle)
python-eventlet 0.19.0-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,120 kB
  • ctags: 3,551
  • sloc: python: 18,723; sh: 196; makefile: 102
file content (60 lines) | stat: -rw-r--r-- 3,322 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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

Index: deb-python-eventlet/tests/greendns_test.py
===================================================================
--- deb-python-eventlet.orig/tests/greendns_test.py
+++ deb-python-eventlet/tests/greendns_test.py
@@ -509,11 +509,11 @@ class TestGetaddrinfo(tests.LimitedTestC
         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]
@@ -527,8 +527,8 @@ class TestGetaddrinfo(tests.LimitedTestC
         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]
@@ -539,8 +539,8 @@ class TestGetaddrinfo(tests.LimitedTestC
     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]
@@ -550,8 +550,8 @@ class TestGetaddrinfo(tests.LimitedTestC
     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]