All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] tst_net.sh: Allow to skip initialization
@ 2021-06-03 15:10 Petr Vorel
  2021-06-03 15:10 ` [LTP] [PATCH 2/2] tst_ipaddr_un.sh: Properly disable netns initialization Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2021-06-03 15:10 UTC (permalink / raw)
  To: ltp

with TST_NET_SKIP_VARIABLE_INIT=1.
Useful for testing the library itself.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_net.sh  | 2 ++
 testcases/lib/tst_test.sh | 1 +
 2 files changed, 3 insertions(+)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index fc5719057..db1db4790 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -933,6 +933,8 @@ tst_default_max_pkt()
 	echo "$((mtu + mtu / 10))"
 }
 
+[ -n "$TST_NET_SKIP_VARIABLE_INIT" ] && return 0
+
 # Management Link
 [ -z "$RHOST" ] && TST_USE_NETNS="yes"
 export RHOST="$RHOST"
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 66ffde4eb..8b4e9cb60 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -559,6 +559,7 @@ tst_run()
 			IPV6|IPV6_FLAG|IPVER|TEST_DATA|TEST_DATA_IFS);;
 			RETRY_FUNC|RETRY_FN_EXP_BACKOFF|TIMEOUT);;
 			NET_DATAROOT|NET_MAX_PKT|NET_RHOST_RUN_DEBUG|NETLOAD_CLN_NUMBER);;
+			NET_SKIP_VARIABLE_INIT);;
 			*) tst_res TWARN "Reserved variable TST_$_tst_i used!";;
 			esac
 		done
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH 2/2] tst_ipaddr_un.sh: Properly disable netns initialization
  2021-06-03 15:10 [LTP] [PATCH 1/2] tst_net.sh: Allow to skip initialization Petr Vorel
@ 2021-06-03 15:10 ` Petr Vorel
  2021-06-04 12:07   ` Alexey Kodanev
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2021-06-03 15:10 UTC (permalink / raw)
  To: ltp

It stopped working due 40110018e, but even before there were issues:

tst_ipaddr_un 1 TINFO: 10.0.0.2/24 -- 10.0.0.1/24
tst_ipaddr_un 1 TINFO: fd00:1:1:1::2/64 -- fd00:1:1:1::1/64
cat: /sys/class/net/eth0/mtu: No such file or directory
cat: /sys/class/net/eth0/address: No such file or directory

Fixes: 807d60628 ("net: Add tst_ipaddr_un.sh test")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/newlib_tests/shell/net/tst_ipaddr_un.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/newlib_tests/shell/net/tst_ipaddr_un.sh b/lib/newlib_tests/shell/net/tst_ipaddr_un.sh
index 512d6d880..e7730b8d0 100755
--- a/lib/newlib_tests/shell/net/tst_ipaddr_un.sh
+++ b/lib/newlib_tests/shell/net/tst_ipaddr_un.sh
@@ -7,8 +7,11 @@ TST_CNT=2
 
 PATH="$(dirname $0)/../../../../testcases/lib/:$PATH"
 
-# workaround to disable netns initialization
-RHOST="foo"
+TST_NET_SKIP_VARIABLE_INIT=1
+
+# from tst_net_vars.c
+IPV4_NET16_UNUSED="10.23"
+IPV6_NET32_UNUSED="fd00:23"
 
 . tst_net.sh
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH 2/2] tst_ipaddr_un.sh: Properly disable netns initialization
  2021-06-03 15:10 ` [LTP] [PATCH 2/2] tst_ipaddr_un.sh: Properly disable netns initialization Petr Vorel
@ 2021-06-04 12:07   ` Alexey Kodanev
  2021-06-07  9:32     ` Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Kodanev @ 2021-06-04 12:07 UTC (permalink / raw)
  To: ltp

Hi Petr,
On 03.06.2021 18:10, Petr Vorel wrote:
> It stopped working due 40110018e, but even before there were issues:
> 
> tst_ipaddr_un 1 TINFO: 10.0.0.2/24 -- 10.0.0.1/24
> tst_ipaddr_un 1 TINFO: fd00:1:1:1::2/64 -- fd00:1:1:1::1/64
> cat: /sys/class/net/eth0/mtu: No such file or directory
> cat: /sys/class/net/eth0/address: No such file or directory
> 
> Fixes: 807d60628 ("net: Add tst_ipaddr_un.sh test")
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  lib/newlib_tests/shell/net/tst_ipaddr_un.sh | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/newlib_tests/shell/net/tst_ipaddr_un.sh b/lib/newlib_tests/shell/net/tst_ipaddr_un.sh
> index 512d6d880..e7730b8d0 100755
> --- a/lib/newlib_tests/shell/net/tst_ipaddr_un.sh
> +++ b/lib/newlib_tests/shell/net/tst_ipaddr_un.sh
> @@ -7,8 +7,11 @@ TST_CNT=2
>  
>  PATH="$(dirname $0)/../../../../testcases/lib/:$PATH"
>  
> -# workaround to disable netns initialization
> -RHOST="foo"

Could be TST_INIT_NETNS="no"

> +TST_NET_SKIP_VARIABLE_INIT=1
> +

OK, I think it's better than setting TST_INIT_NETNS and other vars
(e.g. private _tst_net_parse_variables) here to actually skip init.


> +# from tst_net_vars.c
> +IPV4_NET16_UNUSED="10.23"
> +IPV6_NET32_UNUSED="fd00:23"
>  
>  . tst_net.sh
>  
> 

Reviewed-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH 2/2] tst_ipaddr_un.sh: Properly disable netns initialization
  2021-06-04 12:07   ` Alexey Kodanev
@ 2021-06-07  9:32     ` Petr Vorel
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2021-06-07  9:32 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> > -# workaround to disable netns initialization
> > -RHOST="foo"

> Could be TST_INIT_NETNS="no"
Good point.

> > +TST_NET_SKIP_VARIABLE_INIT=1
> > +

> OK, I think it's better than setting TST_INIT_NETNS and other vars
> (e.g. private _tst_net_parse_variables) here to actually skip init.

+1. Patchset merged with your Reviewed-by: tag. Thanks!

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-07  9:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 15:10 [LTP] [PATCH 1/2] tst_net.sh: Allow to skip initialization Petr Vorel
2021-06-03 15:10 ` [LTP] [PATCH 2/2] tst_ipaddr_un.sh: Properly disable netns initialization Petr Vorel
2021-06-04 12:07   ` Alexey Kodanev
2021-06-07  9:32     ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.