From bd7ce0fc81f9371fd4d09ea7fa1f05f32b39c15b Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 27 Oct 2026 03:22:16 +0100 Subject: Add test for the error packet when a hash is blacklisted --- tests/integration/test_accesslist.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/integration/test_accesslist.py b/tests/integration/test_accesslist.py index b4e134e..e963bcc 100644 --- a/tests/integration/test_accesslist.py +++ b/tests/integration/test_accesslist.py @@ -37,12 +37,10 @@ class Blacklist(TrackerTestCase): self.assertNotIn(b"failure reason", answer) self.assertEqual(answer[b"complete"], 1) - def test_the_block_holds_over_udp_but_the_answer_is_malformed(self): - """The UDP path has no spelling for "not authorized": the announce - writes no body, so the tracker sends the eight byte header alone - where BEP 15 calls for at least twenty. Pinned rather than blessed — - an error packet or silence would both be defensible, a short announce - is neither.""" + def test_the_block_is_an_error_packet_over_udp(self): + """BEP 15 has an error action, which is what a refusal should use. + It used to answer the announce header with no body behind it, a + packet too short for any client to read.""" sock, connection_id = self.tracker.udp_connect() sock.close() request = struct.pack( -- cgit v1.3