diff mbox series

[net,v2,06/17] selftests: forwarding: Add a helper to skip test when using veth pairs

Message ID 20230808141503.4060661-7-idosch@nvidia.com (mailing list archive)
State Accepted
Commit 66e131861ab7bf754b50813216f5c6885cd32d63
Delegated to: Netdev Maintainers
Headers show
Series selftests: forwarding: Various fixes | expand

Checks

Context Check Description
netdev/series_format fail Series longer than 15 patches (and no cover letter)
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers fail 1 blamed authors not CCed: amitc@mellanox.com; 3 maintainers not CCed: amitc@mellanox.com shuah@kernel.org linux-kselftest@vger.kernel.org
netdev/build_clang success Errors and warnings before: 9 this patch: 9
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 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 Aug. 8, 2023, 2:14 p.m. UTC
A handful of tests require physical loopbacks to be used instead of veth
pairs. Add a helper that these tests will invoke in order to be skipped
when executed with veth pairs.

Fixes: 64916b57c0b1 ("selftests: forwarding: Add speed and auto-negotiation test")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
---
 tools/testing/selftests/net/forwarding/lib.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Hangbin Liu Aug. 9, 2023, 1:55 a.m. UTC | #1
On Tue, Aug 08, 2023 at 05:14:52PM +0300, Ido Schimmel wrote:
> A handful of tests require physical loopbacks to be used instead of veth
> pairs. Add a helper that these tests will invoke in order to be skipped
> when executed with veth pairs.

Hi Ido,

How to create physical loopbacks?

Thanks
Hangbin
Ido Schimmel Aug. 9, 2023, 5:47 a.m. UTC | #2
On Wed, Aug 09, 2023 at 09:55:25AM +0800, Hangbin Liu wrote:
> On Tue, Aug 08, 2023 at 05:14:52PM +0300, Ido Schimmel wrote:
> > A handful of tests require physical loopbacks to be used instead of veth
> > pairs. Add a helper that these tests will invoke in order to be skipped
> > when executed with veth pairs.
> 
> Hi Ido,
> 
> How to create physical loopbacks?

It's the same concept as veth. Take two physical ports and connect them
with a cable.
Hangbin Liu Aug. 9, 2023, 6:46 a.m. UTC | #3
On Wed, Aug 09, 2023 at 08:47:45AM +0300, Ido Schimmel wrote:
> On Wed, Aug 09, 2023 at 09:55:25AM +0800, Hangbin Liu wrote:
> > On Tue, Aug 08, 2023 at 05:14:52PM +0300, Ido Schimmel wrote:
> > > A handful of tests require physical loopbacks to be used instead of veth
> > > pairs. Add a helper that these tests will invoke in order to be skipped
> > > when executed with veth pairs.
> > 
> > Hi Ido,
> > 
> > How to create physical loopbacks?
> 
> It's the same concept as veth. Take two physical ports and connect them
> with a cable.

With a cable.. Thanks, haha!

Hangbin
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index 40a8c1541b7f..f69015bf2dea 100755
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -164,6 +164,17 @@  check_port_mab_support()
 	fi
 }
 
+skip_on_veth()
+{
+	local kind=$(ip -j -d link show dev ${NETIFS[p1]} |
+		jq -r '.[].linkinfo.info_kind')
+
+	if [[ $kind == veth ]]; then
+		echo "SKIP: Test cannot be run with veth pairs"
+		exit $ksft_skip
+	fi
+}
+
 if [[ "$(id -u)" -ne 0 ]]; then
 	echo "SKIP: need root privileges"
 	exit $ksft_skip