]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix base_port calculation in pytest runner
authorTom Krizek <tkrizek@isc.org>
Tue, 30 May 2023 12:11:14 +0000 (14:11 +0200)
committerTom Krizek <tkrizek@isc.org>
Tue, 30 May 2023 12:11:14 +0000 (14:11 +0200)
The selected base port should be in the range <port_min, port_max), the
formula was incorrect.

Credit for discovering this fault goes to Ondrej Sury.

bin/tests/system/conftest.py

index efcc2f51ff3bab4f7d09ecf0b351e0996d05a8e8..9294198ba19dbee3515b7eebc8476937b08a8536 100644 (file)
@@ -312,7 +312,7 @@ else:
         # worker threads, multiple tests may have same port values assigned. If
         # these tests are then executed simultaneously, the test results will
         # be misleading.
-        base_port = int(time.time() // 3600) % (port_max - port_min)
+        base_port = int(time.time() // 3600) % (port_max - port_min) + port_min
 
         return {mod: base_port + i * PORTS_PER_TEST for i, mod in enumerate(modules)}