summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/forwarding/bridge_locked_port.sh
AgeCommit message (Collapse)AuthorFilesLines
2023-08-14selftests: forwarding: Add test case for traffic redirection from a locked portIdo Schimmel1-0/+36
Check that traffic can be redirected from a locked bridge port and that it does not create locked FDB entries. Cc: Hans J. Schultz <netdev@kapio-technology.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Petr Machata <petrm@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-11-04selftests: forwarding: Add MAC Authentication Bypass (MAB) test casesHans J. Schultz1-1/+154
Add four test cases to verify MAB functionality: * Verify that a locked FDB entry can be generated by the bridge, preventing a host from communicating via the bridge. Test that user space can clear the "locked" flag by replacing the entry, thereby authenticating the host and allowing it to communicate via the bridge. * Test that an entry cannot roam to a locked port, but that it can roam to an unlocked port. * Test that MAB can only be enabled on a port that is both locked and has learning enabled. * Test that locked FDB entries are flushed from a port when MAB is disabled. Signed-off-by: Hans J. Schultz <netdev@kapio-technology.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Acked-by: Nikolay Aleksandrov <razor@blackwall.org> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-03-22selftests: forwarding: Use same VRF for port and VLAN upperIdo Schimmel1-6/+2
The test creates a separate VRF for the VLAN upper, but does not destroy it during cleanup, resulting in "RTNETLINK answers: File exists" errors. Fix by using the same VRF for the port and its VLAN upper. This is OK since their IP addresses do not overlap. Before: # ./bridge_locked_port.sh TEST: Locked port ipv4 [ OK ] TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] # ./bridge_locked_port.sh RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exists TEST: Locked port ipv4 [ OK ] TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] After: # ./bridge_locked_port.sh TEST: Locked port ipv4 [ OK ] TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] # ./bridge_locked_port.sh TEST: Locked port ipv4 [ OK ] TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] Fixes: b2b681a41251 ("selftests: forwarding: tests of locked port feature") Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2022-03-22selftests: forwarding: Disable learning before link upIdo Schimmel1-2/+2
Disable learning before bringing the bridge port up in order to avoid the FDB being populated and the test failing. Before: # ./bridge_locked_port.sh RTNETLINK answers: File exists TEST: Locked port ipv4 [FAIL] Ping worked after locking port, but before adding FDB entry TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] After: # ./bridge_locked_port.sh TEST: Locked port ipv4 [ OK ] TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] Fixes: b2b681a41251 ("selftests: forwarding: tests of locked port feature") Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2022-02-23selftests: forwarding: tests of locked port featureHans Schultz1-0/+180
These tests check that the basic locked port feature works, so that no 'host' can communicate (ping) through a locked port unless the MAC address of the 'host' interface is in the forwarding database of the bridge. Signed-off-by: Hans Schultz <schultz.hans+netdev@gmail.com> Acked-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>