From a49f8be8b3d1b2f6987e0cf179b2160f1602f461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gytis=20Sto=C5=A1kevi=C4=8Dius?= Date: Mon, 9 Dec 2024 12:14:34 +0200 Subject: [PATCH] fix natlab parity when setting ephemeral ports --- .unreleased/fix_port_parity | 0 nat-lab/tests/conftest.py | 5 +++++ 2 files changed, 5 insertions(+) create mode 100644 .unreleased/fix_port_parity diff --git a/.unreleased/fix_port_parity b/.unreleased/fix_port_parity new file mode 100644 index 000000000..e69de29bb diff --git a/nat-lab/tests/conftest.py b/nat-lab/tests/conftest.py index 2d7028875..6732ceef7 100644 --- a/nat-lab/tests/conftest.py +++ b/nat-lab/tests/conftest.py @@ -73,7 +73,12 @@ async def on_output(output: str) -> None: print(datetime.now(), f"os_ephemeral_ports_{vm_tag}: {output}") start_port = random.randint(5000, 55000) + if start_port % 2: + start_port += 1 num_ports = random.randint(2000, 5000) + if num_ports % 2: + num_ports += 1 + print( datetime.now(), f"Setting up ports for {vm_tag}: start={start_port}, num={num_ports}",