diff options
| author | Ruslan Volodin <ntwman93@gmail.com> | 2026-04-14 16:17:14 +0300 |
|---|---|---|
| committer | Ruslan Volodin <ntwman93@gmail.com> | 2026-04-20 13:23:49 +0300 |
| commit | 382b13c9153fe09f7545ac789e692ec4173d228f (patch) | |
| tree | 68ff86c45669457668f8c7904ab0080f241310ee /smoketest/scripts/cli | |
| parent | 67b68bd9893ad3a39af53ceee856ce5c61ed0638 (diff) | |
| download | vyos-1x-382b13c9153fe09f7545ac789e692ec4173d228f.tar.gz vyos-1x-382b13c9153fe09f7545ac789e692ec4173d228f.zip | |
VPP: T8495: fix issue with assigning acl on sub interfaces
Diffstat (limited to 'smoketest/scripts/cli')
| -rwxr-xr-x | smoketest/scripts/cli/test_vpp.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_vpp.py b/smoketest/scripts/cli/test_vpp.py index 8fcd541f0..8e2b42d58 100755 --- a/smoketest/scripts/cli/test_vpp.py +++ b/smoketest/scripts/cli/test_vpp.py @@ -1392,6 +1392,44 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): _, out = rc_cmd('sudo vppctl show flowprobe feature') self.assertIn(required_str, out) + def test_20_3_vpp_acl_subinterface(self): + base_acl = base_path + ['acl', 'ip'] + vlan = '200' + subif = f'{interface}.{vlan}' + acl_name = 'STATEFUL' + acl_tag = '10' + rule = '10' + + self.cli_set(['interfaces', 'ethernet', interface, 'vif', vlan]) + self.cli_set(base_acl + ['tag-name', acl_name, 'rule', rule, 'action', 'permit']) + self.cli_set( + base_acl + + ['interface', subif, 'input', 'acl-tag', acl_tag, 'tag-name', acl_name] + ) + self.cli_commit() + + vpp = VPPControl() + subif_index = vpp.get_sw_if_index(subif) + self.assertIsNotNone(subif_index) + + acl_index = None + for acl in vpp.api.acl_dump(acl_index=0xFFFFFFFF): + if acl.tag == acl_name: + acl_index = acl.acl_index + break + self.assertIsNotNone(acl_index) + + acl_interfaces = [ + entry + for entry in vpp.api.acl_interface_list_dump() + if entry.sw_if_index == subif_index and entry.count != 0 + ] + self.assertEqual(len(acl_interfaces), 1) + self.assertEqual(acl_interfaces[0].n_input, 1) + self.assertEqual( + list(acl_interfaces[0].acls)[: acl_interfaces[0].count], [acl_index] + ) + def test_21_double_enabling_vpp(self): # Verify double enabling of VPP |
