summaryrefslogtreecommitdiff
path: root/tests/integration/test_udp.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/test_udp.py')
-rw-r--r--tests/integration/test_udp.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/integration/test_udp.py b/tests/integration/test_udp.py
index b60bd56..8a255ec 100644
--- a/tests/integration/test_udp.py
+++ b/tests/integration/test_udp.py
@@ -9,7 +9,7 @@ import socket
9import struct 9import struct
10import unittest 10import unittest
11 11
12from harness import TrackerTestCase 12from harness import Tracker, TrackerTestCase
13 13
14MAGIC = 0x41727101980 14MAGIC = 0x41727101980
15 15
@@ -199,3 +199,20 @@ class UdpWorkersConfiguredAfterTheListener(TrackerTestCase):
199 199
200if __name__ == "__main__": 200if __name__ == "__main__":
201 unittest.main() 201 unittest.main()
202
203
204class UdpAddressAlreadyTaken(TrackerTestCase):
205 def test_a_second_tracker_on_the_same_udp_address_says_so(self):
206 """Linux lets it start all the same, and from then on the two take
207 each other's packets. FreeBSD refuses the bind that follows, and the
208 warning is then what explains the refusal."""
209 try:
210 second = Tracker("listen.udp 127.0.0.1:%d\n" % self.tracker.port)
211 except AssertionError as refused:
212 said = str(refused)
213 else:
214 said = second.output()
215 second.stop()
216 second._cleanup()
217 self.assertIn("is already in use", said)
218 self.assertNotIn("is already in use", self.tracker.output())