diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-02 02:57:31 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-02 02:57:31 +0100 |
| commit | 2b87dc1c3d64b5fdcf1bd82234ab57619f82f015 (patch) | |
| tree | 9e5911f38fb7d3f4a149064cd289a7ffcd65f76d /tests | |
| parent | 8201a711afc5336242dacb21d880f36f7845f011 (diff) | |
Remove version string from what is reported over http
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/integration/test_stats.py | 16 |
1 files changed, 11 insertions, 5 deletions
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 | |||
| 18 | # and belong to test_fullscrape; "woodpeckers" sits behind a | 18 | # and belong to test_fullscrape; "woodpeckers" sits behind a |
| 19 | # feature flag this build does not set. | 19 | # feature flag this build does not set. |
| 20 | MRTG_MODES = ["peer", "conn", "scrp", "udp4", "tcp4", "torr", "fscr", "completed", "syncs"] | 20 | MRTG_MODES = ["peer", "conn", "scrp", "udp4", "tcp4", "torr", "fscr", "completed", "syncs"] |
| 21 | TEXT_MODES = ["herr", "s24s", "top10", "top100", "renew", "version"] | 21 | TEXT_MODES = ["herr", "s24s", "top10", "top100", "renew"] |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | class StatsShape(TrackerTestCase): | 24 | class StatsShape(TrackerTestCase): |
| @@ -55,10 +55,16 @@ class StatsShape(TrackerTestCase): | |||
| 55 | self.assertIsNotNone(root.find("torrents/count_mutex")) | 55 | self.assertIsNotNone(root.find("torrents/count_mutex")) |
| 56 | self.assertIsNotNone(root.find("connections/tcp/announce")) | 56 | self.assertIsNotNone(root.find("connections/tcp/announce")) |
| 57 | 57 | ||
| 58 | def test_version_names_the_release(self): | 58 | def test_the_version_mode_is_gone(self): |
| 59 | # A build from a checkout appends what git describe said, a build from | 59 | """Which build a tracker is and what went into it is of use to whoever |
| 60 | # a tarball has nothing to append, so the commit is optional here. | 60 | attacks it and to nobody else on the far end of a socket. It is |
| 61 | self.assertRegex(self.tracker.stats("version"), rb"^opentracker \d+\.\d+\.\d+( \(\S+\))?\n$") | 61 | reported by -v, to whoever already has the binary.""" |
| 62 | with self.assertRaises(urllib.error.HTTPError) as caught: | ||
| 63 | self.tracker.stats("version") | ||
| 64 | self.assertEqual(caught.exception.code, 400, "an unknown mode, like any other") | ||
| 65 | |||
| 66 | def test_everything_does_not_name_the_build(self): | ||
| 67 | self.assertNotIn(b"opentracker 1", self.tracker.stats("everything")) | ||
| 62 | 68 | ||
| 63 | 69 | ||
| 64 | class StatsCount(TrackerTestCase): | 70 | class StatsCount(TrackerTestCase): |
