From 2b87dc1c3d64b5fdcf1bd82234ab57619f82f015 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 2 Nov 2026 02:57:31 +0100 Subject: Remove version string from what is reported over http --- tests/integration/test_stats.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'tests/integration') diff --git a/tests/integration/test_stats.py b/tests/integration/test_stats.py index 7b778d3..74f6d47 100644 --- a/tests/integration/test_stats.py +++ b/tests/integration/test_stats.py @@ -18,7 +18,7 @@ from harness import TrackerTestCase # and belong to test_fullscrape; "woodpeckers" sits behind a # feature flag this build does not set. MRTG_MODES = ["peer", "conn", "scrp", "udp4", "tcp4", "torr", "fscr", "completed", "syncs"] -TEXT_MODES = ["herr", "s24s", "top10", "top100", "renew", "version"] +TEXT_MODES = ["herr", "s24s", "top10", "top100", "renew"] class StatsShape(TrackerTestCase): @@ -55,10 +55,16 @@ class StatsShape(TrackerTestCase): self.assertIsNotNone(root.find("torrents/count_mutex")) self.assertIsNotNone(root.find("connections/tcp/announce")) - def test_version_names_the_release(self): - # A build from a checkout appends what git describe said, a build from - # a tarball has nothing to append, so the commit is optional here. - self.assertRegex(self.tracker.stats("version"), rb"^opentracker \d+\.\d+\.\d+( \(\S+\))?\n$") + def test_the_version_mode_is_gone(self): + """Which build a tracker is and what went into it is of use to whoever + attacks it and to nobody else on the far end of a socket. It is + reported by -v, to whoever already has the binary.""" + with self.assertRaises(urllib.error.HTTPError) as caught: + self.tracker.stats("version") + self.assertEqual(caught.exception.code, 400, "an unknown mode, like any other") + + def test_everything_does_not_name_the_build(self): + self.assertNotIn(b"opentracker 1", self.tracker.stats("everything")) class StatsCount(TrackerTestCase): -- cgit v1.3