File: 0007-Patched-test_getaddrinfo-due-netbase-update.patch

package info (click to toggle)
python-eventlet 0.20.0-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,376 kB
  • sloc: python: 31,120; sh: 208; makefile: 90
file content (66 lines) | stat: -rw-r--r-- 3,500 bytes parent folder | download
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
61
62
63
64
65
66
From d344d2b3587c669e087dc9169822c6c34e488886 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Kobli=C5=BEek?= <koblizeko@gmail.com>
Date: Fri, 4 Aug 2017 21:47:22 +0200
Subject: 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.
Forwarded: https://github.com/eventlet/eventlet/pull/375
---
 tests/greendns_test.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/greendns_test.py b/tests/greendns_test.py
index cf17999..6ffc28f 100644
--- a/tests/greendns_test.py
+++ b/tests/greendns_test.py
@@ -458,11 +458,11 @@ class TestGetaddrinfo(tests.LimitedTestCase):
         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]
@@ -475,8 +475,8 @@ class TestGetaddrinfo(tests.LimitedTestCase):
         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]
@@ -486,8 +486,8 @@ class TestGetaddrinfo(tests.LimitedTestCase):
     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]
@@ -496,8 +496,8 @@ class TestGetaddrinfo(tests.LimitedTestCase):
     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]