[LTP] [PATCH 1/2] tst_net.sh: Fix for disabled IPv6
Petr Vorel
pvorel@suse.cz
Tue Jan 25 10:08:09 CET 2022
Hi Alexey, all,
...
> > @@ -971,8 +1003,16 @@ IPV6_RHOST="${IPV6_RHOST:-fd00:1:1:1::1/64}"
> > if [ -z "$_tst_net_parse_variables" ]; then
> > eval $(tst_net_ip_prefix $IPV4_LHOST || echo "exit $?")
> > eval $(tst_net_ip_prefix -r $IPV4_RHOST || echo "exit $?")
> > - eval $(tst_net_ip_prefix $IPV6_LHOST || echo "exit $?")
> > - eval $(tst_net_ip_prefix -r $IPV6_RHOST || echo "exit $?")
> > +
> > + tst_net_detect_ipv6 && TST_NET_LHOST_IPV6=1
> > + tst_net_detect_ipv6 rhost && TST_NET_RHOST_IPV6=1
> > +
> > + if [ "$TST_NET_LHOST_IPV6" = 1 ]; then
> > + eval $(tst_net_ip_prefix $IPV6_LHOST || echo "exit $?")
> > + fi
> > + if [ "$TST_NET_RHOST_IPV6" = 1 ]; then
> > + eval $(tst_net_ip_prefix -r $IPV6_RHOST || echo "exit $?")
> > + fi
> Do we really need to keep around and check two variables? If at least
> one machine doesn't have IPv6, it's not longer necessary to setup the
> other.
OK, just one variable is enough, e.g. TST_NET_REQUIRE_IPV6.
@all: But netns_helper.sh, which does not use tst_net.sh also requires IPv6
(and there are probably more), thus how about adding flag TST_REQUIRE_IPV6
into tst_test.sh (would help also for documentation - docparse).
And tst_net.sh would just on check also IPv6 on rhost.
Kind regards,
Petr
More information about the ltp
mailing list