[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231222135836.992841-7-bpoirier@nvidia.com>
Date: Fri, 22 Dec 2023 08:58:32 -0500
From: Benjamin Poirier <bpoirier@...dia.com>
To: netdev@...r.kernel.org
Cc: Shuah Khan <shuah@...nel.org>,
Petr Machata <petrm@...dia.com>,
Hangbin Liu <liuhangbin@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>
Subject: [RFC PATCH net-next 06/10] selftests: forwarding: Add net/lib.sh to TEST_INCLUDES
Since commit 25ae948b4478 ("selftests/net: add lib.sh"), when exporting the
forwarding tests and running them, the tests that import
net/forwarding/lib.sh fail to import net/lib.sh. This is especially a
problem for the tests that use functions from net/lib.sh, like pedit_ip.sh:
$ make install TARGETS="drivers/net/forwarding"
$ cd kselftest_install/net/forwarding
$ ./pedit_ip.sh veth{0..3}
lib.sh: line 38: /src/linux/tools/testing/selftests/kselftest_install/net/forwarding/../lib.sh: No such file or directory
TEST: ping [ OK ]
TEST: ping6 [ OK ]
./pedit_ip.sh: line 135: busywait: command not found
TEST: dev veth1 ingress pedit ip src set 198.51.100.1 [FAIL]
Expected to get 10 packets, but got .
./pedit_ip.sh: line 135: busywait: command not found
TEST: dev veth2 egress pedit ip src set 198.51.100.1 [FAIL]
Expected to get 10 packets, but got .
./pedit_ip.sh: line 135: busywait: command not found
TEST: dev veth1 ingress pedit ip dst set 198.51.100.1 [FAIL]
Expected to get 10 packets, but got .
./pedit_ip.sh: line 135: busywait: command not found
TEST: dev veth2 egress pedit ip dst set 198.51.100.1 [FAIL]
Expected to get 10 packets, but got .
./pedit_ip.sh: line 135: busywait: command not found
TEST: dev veth1 ingress pedit ip6 src set 2001:db8:2::1 [FAIL]
Expected to get 10 packets, but got .
./pedit_ip.sh: line 135: busywait: command not found
TEST: dev veth2 egress pedit ip6 src set 2001:db8:2::1 [FAIL]
Expected to get 10 packets, but got .
./pedit_ip.sh: line 135: busywait: command not found
TEST: dev veth1 ingress pedit ip6 dst set 2001:db8:2::1 [FAIL]
Expected to get 10 packets, but got .
./pedit_ip.sh: line 135: busywait: command not found
TEST: dev veth2 egress pedit ip6 dst set 2001:db8:2::1 [FAIL]
Expected to get 10 packets, but got .
In order for net/lib.sh to be exported along with forwarding tests, add
net/lib.sh to TEST_INCLUDES. This is the result after this commit:
$ ./pedit_ip.sh veth{0..3}
TEST: ping [ OK ]
TEST: ping6 [ OK ]
TEST: dev veth1 ingress pedit ip src set 198.51.100.1 [ OK ]
TEST: dev veth2 egress pedit ip src set 198.51.100.1 [ OK ]
TEST: dev veth1 ingress pedit ip dst set 198.51.100.1 [ OK ]
TEST: dev veth2 egress pedit ip dst set 198.51.100.1 [ OK ]
TEST: dev veth1 ingress pedit ip6 src set 2001:db8:2::1 [ OK ]
TEST: dev veth2 egress pedit ip6 src set 2001:db8:2::1 [ OK ]
TEST: dev veth1 ingress pedit ip6 dst set 2001:db8:2::1 [ OK ]
TEST: dev veth2 egress pedit ip6 dst set 2001:db8:2::1 [ OK ]
Fixes: 25ae948b4478 ("selftests/net: add lib.sh")
Signed-off-by: Benjamin Poirier <bpoirier@...dia.com>
---
tools/testing/selftests/net/forwarding/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/net/forwarding/Makefile b/tools/testing/selftests/net/forwarding/Makefile
index 452693514be4..5b55c0467eed 100644
--- a/tools/testing/selftests/net/forwarding/Makefile
+++ b/tools/testing/selftests/net/forwarding/Makefile
@@ -129,4 +129,7 @@ TEST_PROGS_EXTENDED := devlink_lib.sh \
sch_tbf_etsprio.sh \
tc_common.sh
+TEST_INCLUDES := \
+ net/lib.sh
+
include ../../lib.mk
--
2.43.0
Powered by blists - more mailing lists