* [LTP] [PATCH] tst_net.sh: Avoid using tst_require_drivers in legacy API
@ 2025-05-07 11:33 Petr Vorel
2025-05-07 11:40 ` Ricardo B. Marlière via ltp
0 siblings, 1 reply; 2+ messages in thread
From: Petr Vorel @ 2025-05-07 11:33 UTC (permalink / raw)
To: ltp; +Cc: Ricardo B. Marlière
tst_require_drivers is only in new shell API. Avoid using it in the old API.
Reported-by: Ricardo B. Marlière <rbm@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
NOTE: there are still 9 remaining tests in the old API, e.g.
ftp-upload-stress.sh. But instead of converting them it'd be better to
spend time to reimplement the testcase:
https://github.com/linux-test-project/ltp/issues/1207
I'm not sure about usability of multicast tests (but converting them to
new shell API should be easy).
$ git grep -l TST_USE_LEGACY_API testcases/network/
testcases/network/multicast/mc_cmds/mc_cmds.sh
testcases/network/multicast/mc_commo/mc_commo.sh
testcases/network/multicast/mc_member/mc_member.sh
testcases/network/multicast/mc_opts/mc_opts.sh
testcases/network/stress/dns/dns-stress.sh
testcases/network/stress/ftp/ftp-download-stress.sh
testcases/network/stress/ftp/ftp-upload-stress.sh
testcases/network/stress/http/http-stress.sh
testcases/network/tcp_cmds/tcpdump/tcpdump01.sh
testcases/lib/tst_net.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index 9a8b8d7214..6c2278313c 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -175,7 +175,9 @@ init_ltp_netspace()
tst_require_cmds ip tst_ns_create tst_ns_exec tst_ns_ifmove
tst_require_root
- tst_require_drivers veth
+ if [ -z "$TST_USE_LEGACY_API" ]; then
+ tst_require_drivers veth
+ fi
ROD ip link add name ltp_ns_veth1 type veth peer name ltp_ns_veth2
pid="$(ROD tst_ns_create net,mnt)"
mkdir -p /var/run/netns
--
2.49.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] tst_net.sh: Avoid using tst_require_drivers in legacy API
2025-05-07 11:33 [LTP] [PATCH] tst_net.sh: Avoid using tst_require_drivers in legacy API Petr Vorel
@ 2025-05-07 11:40 ` Ricardo B. Marlière via ltp
0 siblings, 0 replies; 2+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-05-07 11:40 UTC (permalink / raw)
To: Petr Vorel, ltp
On Wed May 7, 2025 at 8:33 AM -03, Petr Vorel wrote:
> tst_require_drivers is only in new shell API. Avoid using it in the old API.
>
> Reported-by: Ricardo B. Marlière <rbm@suse.com>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> NOTE: there are still 9 remaining tests in the old API, e.g.
> ftp-upload-stress.sh. But instead of converting them it'd be better to
> spend time to reimplement the testcase:
> https://github.com/linux-test-project/ltp/issues/1207
>
> I'm not sure about usability of multicast tests (but converting them to
> new shell API should be easy).
>
> $ git grep -l TST_USE_LEGACY_API testcases/network/
> testcases/network/multicast/mc_cmds/mc_cmds.sh
> testcases/network/multicast/mc_commo/mc_commo.sh
> testcases/network/multicast/mc_member/mc_member.sh
> testcases/network/multicast/mc_opts/mc_opts.sh
> testcases/network/stress/dns/dns-stress.sh
> testcases/network/stress/ftp/ftp-download-stress.sh
> testcases/network/stress/ftp/ftp-upload-stress.sh
> testcases/network/stress/http/http-stress.sh
> testcases/network/tcp_cmds/tcpdump/tcpdump01.sh
>
> testcases/lib/tst_net.sh | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> index 9a8b8d7214..6c2278313c 100644
> --- a/testcases/lib/tst_net.sh
> +++ b/testcases/lib/tst_net.sh
> @@ -175,7 +175,9 @@ init_ltp_netspace()
> tst_require_cmds ip tst_ns_create tst_ns_exec tst_ns_ifmove
> tst_require_root
>
> - tst_require_drivers veth
> + if [ -z "$TST_USE_LEGACY_API" ]; then
> + tst_require_drivers veth
> + fi
Thanks for the quick fix!
Reviewed-by: Ricardo B. Marlière <rbm@suse.com>
> ROD ip link add name ltp_ns_veth1 type veth peer name ltp_ns_veth2
> pid="$(ROD tst_ns_create net,mnt)"
> mkdir -p /var/run/netns
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-07 11:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07 11:33 [LTP] [PATCH] tst_net.sh: Avoid using tst_require_drivers in legacy API Petr Vorel
2025-05-07 11:40 ` Ricardo B. Marlière via ltp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox