From 1b5bdef24632bbc497768847719eba8c33d93ef5 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 5 Nov 2026 22:17:15 +0100 Subject: https: T9559: fix bogus port conflict with "vrf default" Committing "set service https vrf default" failed with "TCP port 443 in vrf default is already used by another service" although nothing listened on the port. The port check bound its test socket to a VRF device named "default", which does not exist, and reported that failure as a port conflict. The default VRF is now treated like no VRF at all. A VRF device that does not exist no longer counts as a busy port, as nothing can listen in it; any other error is raised instead of being reported as a conflict. The same check is used by the Prometheus VPP exporter. --- src/tests/test_utils_network.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tests/test_utils_network.py') diff --git a/src/tests/test_utils_network.py b/src/tests/test_utils_network.py index 708b6e064..83cf57ffc 100644 --- a/src/tests/test_utils_network.py +++ b/src/tests/test_utils_network.py @@ -61,6 +61,8 @@ class TestVyOSUtilsNetwork(TestCase): self.assertFalse(vyos.utils.network.check_port_availability('192.0.2.1', 443)) # We do not have 2001:db8::1 configured on this system self.assertFalse(vyos.utils.network.check_port_availability('2001:db8::1', 80, protocol='udp')) + # the default VRF is not a device and must behave like no VRF at all + self.assertTrue(vyos.utils.network.check_port_availability('127.0.0.1', 8080, vrf='default')) def test_normalize_prefix(self): normalize_prefix = vyos.utils.network.normalize_prefix -- cgit v1.2.3