[LTP] [PATCH] tst_net.sh: Avoid using tst_require_drivers in legacy API
Ricardo B. Marlière
rbm@suse.com
Wed May 7 13:40:50 CEST 2025
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
More information about the ltp
mailing list