diff mbox series

[1/4] tst_net.sh: Simplify ipver settings code

Message ID 20180526111545.20521-1-pvorel@suse.cz
State Changes Requested
Delegated to: Alexey Kodanev
Headers show
Series [1/4] tst_net.sh: Simplify ipver settings code | expand

Commit Message

Petr Vorel May 26, 2018, 11:15 a.m. UTC
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_net.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Alexey Kodanev May 28, 2018, 1:31 p.m. UTC | #1
On 05/26/2018 02:15 PM, Petr Vorel wrote:
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testcases/lib/tst_net.sh | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> index dc612a794..fd2eacf2f 100644
> --- a/testcases/lib/tst_net.sh
> +++ b/testcases/lib/tst_net.sh
> @@ -29,11 +29,12 @@ TST_SETUP="tst_net_setup"
>  
>  # Blank for an IPV4 test; 6 for an IPV6 test.
>  TST_IPV6=${TST_IPV6:-}
> +ipver=${TST_IPV6:-4}

Hi Petr,

Perhaps, we need a prefix TST_.

Shouldn't the same patch remove the setting of 'ipver' in the tests?

Thanks,
Alexey
Petr Vorel May 29, 2018, 7:59 a.m. UTC | #2
Hi Alexey,

> On 05/26/2018 02:15 PM, Petr Vorel wrote:
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> >  testcases/lib/tst_net.sh | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)

> > diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> > index dc612a794..fd2eacf2f 100644
> > --- a/testcases/lib/tst_net.sh
> > +++ b/testcases/lib/tst_net.sh
> > @@ -29,11 +29,12 @@ TST_SETUP="tst_net_setup"

> >  # Blank for an IPV4 test; 6 for an IPV6 test.
> >  TST_IPV6=${TST_IPV6:-}
> > +ipver=${TST_IPV6:-4}

> Hi Petr,

> Perhaps, we need a prefix TST_.

> Shouldn't the same patch remove the setting of 'ipver' in the tests?
Thanks for comments, both makes sense. I wanted to do it after migrating everything to new
API, but probably better to do it before.

> Thanks,
> Alexey


Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index dc612a794..fd2eacf2f 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -29,11 +29,12 @@  TST_SETUP="tst_net_setup"
 
 # Blank for an IPV4 test; 6 for an IPV6 test.
 TST_IPV6=${TST_IPV6:-}
+ipver=${TST_IPV6:-4}
 
 tst_net_parse_args()
 {
 	case $1 in
-	6) TST_IPV6=6;;
+	6) TST_IPV6=6 ipver=6;;
 	*) $TST_PARSE_ARGS_CALLER "$1" "$2";;
 	esac
 }
@@ -68,7 +69,6 @@  tst_net_remote_tmpdir()
 
 tst_net_setup()
 {
-	ipver=${TST_IPV6:-4}
 	tst_net_remote_tmpdir
 	[ -n "$TST_SETUP_CALLER" ] && $TST_SETUP_CALLER
 }
@@ -79,7 +79,6 @@  fi
 
 if [ -n "$TST_USE_LEGACY_API" ]; then
 	tst_net_read_opts "$@"
-	ipver=${TST_IPV6:-4}
 fi
 
 # old vs. new API compatibility layer