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. --- smoketest/scripts/cli/test_service_https.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'smoketest/scripts/cli') diff --git a/smoketest/scripts/cli/test_service_https.py b/smoketest/scripts/cli/test_service_https.py index f432b4d57..f4176107a 100755 --- a/smoketest/scripts/cli/test_service_https.py +++ b/smoketest/scripts/cli/test_service_https.py @@ -252,6 +252,20 @@ class TestHTTPSService(VyOSUnitTestSHIM.TestCase): self.cli_delete(['interfaces', 'dummy', interface]) self.cli_delete(['vrf', 'name', vrf]) + def test_vrf_default(self): + # "vrf default" has no VRF master device and must behave like no VRF + # at all - the port check used to report a bogus port conflict + self.cli_set( + base_path + ['api', 'keys', 'id', 'key-01', 'key', 'MySuperSecretVyOS'] + ) + self.cli_set(base_path + ['vrf', 'default']) + self.cli_commit() + + self.assertTrue(process_named_running(PROCESS_NAME)) + ports = {c.laddr.port for c in psutil.net_connections(kind='tcp') + if c.status == psutil.CONN_LISTEN} + self.assertIn(443, ports) + def test_certificate(self): cert_name = 'test_https' dh_name = 'dh-test' -- cgit v1.2.3