summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorNataliia Solomko <natalirs1985@gmail.com>2026-07-06 18:07:00 +0300
committerNataliia Solomko <natalirs1985@gmail.com>2026-07-07 11:35:18 +0300
commit5c5716a84abac766ad72334e3f159fffb9644c8f (patch)
tree874dccdc9380762fd2f82c4dcc0d7d4b072dcfc9 /smoketest/scripts/cli
parentb90c21db2edefb02e22ea9233cf76ed6435f91f6 (diff)
downloadvyos-1x-5c5716a84abac766ad72334e3f159fffb9644c8f.tar.gz
vyos-1x-5c5716a84abac766ad72334e3f159fffb9644c8f.zip
vpp: T9018: Auto-enable promiscuous mode for interfaces with VLANs
VPP drops VLAN-tagged frames unless the parent interface has promiscuous mode enabled, causing VLAN sub-interfaces to lose connectivity. Automatically enable promiscuous mode on VPP interfaces that have VLAN sub-interfaces (vif/vif-s) configured.
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_vpp.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_vpp.py b/smoketest/scripts/cli/test_vpp.py
index 7813dfdf5..e937aaa3b 100755
--- a/smoketest/scripts/cli/test_vpp.py
+++ b/smoketest/scripts/cli/test_vpp.py
@@ -1474,6 +1474,9 @@ class TestVPP(VyOSUnitTestSHIM.TestCase):
# Ensure that VPP process is active
self.assertTrue(process_named_running(PROCESS_NAME))
+ # Cleanup
+ self.cli_delete(['interfaces', 'ethernet', interface, 'vif', vlan])
+
def test_23_1_vpp_acl_subinterface(self):
base_acl = base_path + ['acl', 'ip']
vlan = '200'
@@ -1514,6 +1517,9 @@ class TestVPP(VyOSUnitTestSHIM.TestCase):
list(acl_interfaces[0].acls)[: acl_interfaces[0].count], [acl_index]
)
+ # Cleanup
+ self.cli_delete(['interfaces', 'ethernet', interface, 'vif', vlan])
+
def test_23_2_vpp_acl_bond_with_vif(self):
base_acl = base_path + ['acl', 'ip']
base_bond = interfaces_path + ['bonding']
@@ -1665,6 +1671,36 @@ class TestVPP(VyOSUnitTestSHIM.TestCase):
self.cli_delete(['vrf', 'name', mgmt_vrf])
self.cli_commit()
+ def test_25_vpp_promisc_vlan(self):
+ # T9018: promiscuous mode must be enabled automatically when VLANs
+ # are configured on a VPP interface and disabled when removed.
+ vlan = '100'
+ address = '192.168.10.1/24'
+
+ self.cli_commit()
+
+ # Verify promisc is off initially
+ _, out = rc_cmd(f'sudo vppctl show hardware-interfaces {interface}')
+ self.assertNotRegex(out, r'flags:.*\bpromisc\b')
+
+ # Add VLAN sub-interface
+ self.cli_set(
+ ['interfaces', 'ethernet', interface, 'vif', vlan, 'address', address]
+ )
+ self.cli_commit()
+
+ # Verify promisc is enabled
+ _, out = rc_cmd(f'sudo vppctl show hardware-interfaces {interface}')
+ self.assertRegex(out, r'flags:.*\bpromisc\b')
+
+ # Remove VLAN sub-interface
+ self.cli_delete(['interfaces', 'ethernet', interface, 'vif'])
+ self.cli_commit()
+
+ # Verify promisc is disabled
+ _, out = rc_cmd(f'sudo vppctl show hardware-interfaces {interface}')
+ self.assertNotRegex(out, r'flags:.*\bpromisc\b')
+
if __name__ == '__main__':
unittest.main(verbosity=2, failfast=VyOSUnitTestSHIM.TestCase.debug_on())