diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-29 00:34:40 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-29 00:34:40 +0100 |
| commit | 952da5949f677e932f2a48a5474210df571472fb (patch) | |
| tree | d33525d29ee18b65b9e5df39d2e2fb1f5a868ca2 /tests/integration | |
| parent | f08e7473ac51a024f49e5101fbc5e150fecef2d4 (diff) | |
Diffstat (limited to 'tests/integration')
| -rw-r--r-- | tests/integration/test_udp.py | 19 |
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 | |||
| 9 | import struct | 9 | import struct |
| 10 | import unittest | 10 | import unittest |
| 11 | 11 | ||
| 12 | from harness import TrackerTestCase | 12 | from harness import Tracker, TrackerTestCase |
| 13 | 13 | ||
| 14 | MAGIC = 0x41727101980 | 14 | MAGIC = 0x41727101980 |
| 15 | 15 | ||
| @@ -199,3 +199,20 @@ class UdpWorkersConfiguredAfterTheListener(TrackerTestCase): | |||
| 199 | 199 | ||
| 200 | if __name__ == "__main__": | 200 | if __name__ == "__main__": |
| 201 | unittest.main() | 201 | unittest.main() |
| 202 | |||
| 203 | |||
| 204 | class 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()) | ||
