diff mbox series

[net] selftests: test_vxlan_under_vrf: Fix broken test case

Message ID 20220324200514.1638326-1-idosch@nvidia.com (mailing list archive)
State Accepted
Commit b50d3b46f84282d795ae3076111acb75ae1031f3
Delegated to: Netdev Maintainers
Headers show
Series [net] selftests: test_vxlan_under_vrf: Fix broken test case | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 2 maintainers not CCed: linux-kselftest@vger.kernel.org shuah@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Ido Schimmel March 24, 2022, 8:05 p.m. UTC
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: 03f1c26b1c56 ("test/net: Add script for VXLAN underlay in a VRF")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 tools/testing/selftests/net/test_vxlan_under_vrf.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

David Ahern March 25, 2022, 2:08 p.m. UTC | #1
On 3/24/22 2:05 PM, Ido Schimmel wrote:
> 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: 03f1c26b1c56 ("test/net: Add script for VXLAN underlay in a VRF")
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
>  tools/testing/selftests/net/test_vxlan_under_vrf.sh | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 



Reviewed-by: David Ahern <dsahern@kernel.org>
patchwork-bot+netdevbpf@kernel.org March 26, 2022, 12:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 24 Mar 2022 22:05:14 +0200 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net] selftests: test_vxlan_under_vrf: Fix broken test case
    https://git.kernel.org/netdev/net/c/b50d3b46f842

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/test_vxlan_under_vrf.sh b/tools/testing/selftests/net/test_vxlan_under_vrf.sh
index ea5a7a808f12..1fd1250ebc66 100755
--- a/tools/testing/selftests/net/test_vxlan_under_vrf.sh
+++ b/tools/testing/selftests/net/test_vxlan_under_vrf.sh
@@ -120,11 +120,11 @@  echo "[ OK ]"
 
 # Move the underlay to a non-default VRF
 ip -netns hv-1 link set veth0 vrf vrf-underlay
-ip -netns hv-1 link set veth0 down
-ip -netns hv-1 link set veth0 up
+ip -netns hv-1 link set vxlan0 down
+ip -netns hv-1 link set vxlan0 up
 ip -netns hv-2 link set veth0 vrf vrf-underlay
-ip -netns hv-2 link set veth0 down
-ip -netns hv-2 link set veth0 up
+ip -netns hv-2 link set vxlan0 down
+ip -netns hv-2 link set vxlan0 up
 
 echo -n "Check VM connectivity through VXLAN (underlay in a VRF)            "
 ip netns exec vm-1 ping -c 1 -W 1 10.0.0.2 &> /dev/null || (echo "[FAIL]"; false)