Skip to content

Commit b50d3b4

Browse files
idoschkuba-moo
authored andcommitted
selftests: test_vxlan_under_vrf: Fix broken test case
The purpose of the last test case is to test VXLAN encapsulation and decapsulation when the underlay lookup takes place in a non-default VRF. This is achieved by enslaving the physical device of the tunnel to a VRF. The binding of the VXLAN UDP socket to the VRF happens when the VXLAN device itself is opened, not when its physical device is opened. This was also mentioned in the cited commit ("tests that moving the underlay from a VRF to another works when down/up the VXLAN interface"), but the test did something else. Fix it by reopening the VXLAN device instead of its physical device. Before: # ./test_vxlan_under_vrf.sh Checking HV connectivity [ OK ] Check VM connectivity through VXLAN (underlay in the default VRF) [ OK ] Check VM connectivity through VXLAN (underlay in a VRF) [FAIL] After: # ./test_vxlan_under_vrf.sh Checking HV connectivity [ OK ] Check VM connectivity through VXLAN (underlay in the default VRF) [ OK ] Check VM connectivity through VXLAN (underlay in a VRF) [ OK ] Fixes: 03f1c26 ("test/net: Add script for VXLAN underlay in a VRF") Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: David Ahern <dsahern@kernel.org> Link: https://lore.kernel.org/r/20220324200514.1638326-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent bf8bfc4 commit b50d3b4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tools/testing/selftests/net/test_vxlan_under_vrf.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ echo "[ OK ]"
120120

121121
# Move the underlay to a non-default VRF
122122
ip -netns hv-1 link set veth0 vrf vrf-underlay
123-
ip -netns hv-1 link set veth0 down
124-
ip -netns hv-1 link set veth0 up
123+
ip -netns hv-1 link set vxlan0 down
124+
ip -netns hv-1 link set vxlan0 up
125125
ip -netns hv-2 link set veth0 vrf vrf-underlay
126-
ip -netns hv-2 link set veth0 down
127-
ip -netns hv-2 link set veth0 up
126+
ip -netns hv-2 link set vxlan0 down
127+
ip -netns hv-2 link set vxlan0 up
128128

129129
echo -n "Check VM connectivity through VXLAN (underlay in a VRF) "
130130
ip netns exec vm-1 ping -c 1 -W 1 10.0.0.2 &> /dev/null || (echo "[FAIL]"; false)

0 commit comments

Comments
 (0)