Commit b795db18 authored by Hangbin Liu's avatar Hangbin Liu Committed by Jakub Kicinski

selftests/net: convert fdb_flush.sh to run it in unique namespace

Here is the test result after conversion.
 # ./fdb_flush.sh
 TEST: vx10: Expected 5 FDB entries, got 5                           [ OK ]
 TEST: vx20: Expected 5 FDB entries, got 5                           [ OK ]
 ...
 TEST: vx10: Expected 5 FDB entries, got 5                           [ OK ]
 TEST: Test entries with dst 192.0.2.1                               [ OK ]
Acked-by: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
Tested-by: default avatarIdo Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/20231213060856.4030084-14-liuhangbin@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f6fc5b94
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
# Check that flush works as expected with all the supported arguments and verify # Check that flush works as expected with all the supported arguments and verify
# some combinations of arguments. # some combinations of arguments.
source lib.sh
FLUSH_BY_STATE_TESTS=" FLUSH_BY_STATE_TESTS="
vxlan_test_flush_by_permanent vxlan_test_flush_by_permanent
vxlan_test_flush_by_nopermanent vxlan_test_flush_by_nopermanent
...@@ -739,10 +741,9 @@ bridge_vxlan_test_flush() ...@@ -739,10 +741,9 @@ bridge_vxlan_test_flush()
setup() setup()
{ {
IP="ip -netns ns1" setup_ns NS
BRIDGE="bridge -netns ns1" IP="ip -netns ${NS}"
BRIDGE="bridge -netns ${NS}"
ip netns add ns1
$IP link add name vx10 type vxlan id 1000 dstport "$VXPORT" $IP link add name vx10 type vxlan id 1000 dstport "$VXPORT"
$IP link add name vx20 type vxlan id 2000 dstport "$VXPORT" $IP link add name vx20 type vxlan id 2000 dstport "$VXPORT"
...@@ -759,7 +760,7 @@ cleanup() ...@@ -759,7 +760,7 @@ cleanup()
$IP link del dev vx20 $IP link del dev vx20
$IP link del dev vx10 $IP link del dev vx10
ip netns del ns1 cleanup_ns ${NS}
} }
################################################################################ ################################################################################
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment