[RFC,v6,3/7] network.sh: Migrate to new shell API
diff mbox series

Message ID 20180406123118.21309-4-pvorel@suse.cz
State Accepted
Delegated to: Alexey Kodanev
Headers show
Series
  • Rewriting network tests into new shell API
Related show

Commit Message

Petr Vorel April 6, 2018, 12:31 p.m. UTC
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testscripts/network.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Petr Vorel April 8, 2018, 8:47 p.m. UTC | #1
Hi,

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testscripts/network.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/testscripts/network.sh b/testscripts/network.sh
> index cc2b2de72..b18f202d5 100755
> --- a/testscripts/network.sh
> +++ b/testscripts/network.sh
> @@ -89,7 +89,7 @@ shift $(($OPTIND - 1))
>  TST_TOTAL=1
>  TCID="network_settings"

> -TST_USE_LEGACY_API=1
> +TST_NO_DEFAULT_RUN=1
>  . tst_net.sh

>  # Reset variables.

Here I need to reset TST_NO_DEFAULT_RUN:
-unset TCID TST_LIB_LOADED TST_USE_LEGACY_API
+unset TCID TST_LIB_LOADED TST_NO_DEFAULT_RUN


Kind regards,
Petr
Alexey Kodanev April 10, 2018, 12:37 p.m. UTC | #2
On 04/06/2018 03:31 PM, Petr Vorel wrote:
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testscripts/network.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testscripts/network.sh b/testscripts/network.sh
> index cc2b2de72..b18f202d5 100755
> --- a/testscripts/network.sh
> +++ b/testscripts/network.sh
> @@ -89,7 +89,7 @@ shift $(($OPTIND - 1))
>  TST_TOTAL=1
>  TCID="network_settings"

Do we need these variables in the new API?


For TCID, I guess we would also need this change in tst_test.sh:

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 6c2ee6a..b7aa4a7 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -102,7 +102,7 @@ tst_res()

        tst_inc_res "$res"

-       printf "$TCID $TST_COUNT "
+       printf "$TST_ID $TST_COUNT "
        tst_print_colored $res "$res: "
        echo "$@"
 }


Thanks,
Alexey

>  
> -TST_USE_LEGACY_API=1
> +TST_NO_DEFAULT_RUN=1
>  . tst_net.sh
>  
>  # Reset variables.
>
Petr Vorel April 10, 2018, 5 p.m. UTC | #3
Hi Alexey,

> > --- a/testscripts/network.sh
> > +++ b/testscripts/network.sh
> > @@ -89,7 +89,7 @@ shift $(($OPTIND - 1))
> >  TST_TOTAL=1
> >  TCID="network_settings"
> Do we need these variables in the new API?

Yes, good catch, both are redundant.

TCID is invalid, it was required, but with the fix you pointed out (see below) TCID is
redundant.

TST_ID:
 TST_ID="network_settings" would keep previous name:
network_settings 1 TINFO: initialize 'lhost' 'ltp_ns_veth2' interface

without TST_ID is the name of the script (set by tst_test.sh: filename=$(basename $0) ):
network 1 TINFO: initialize 'lhost' 'ltp_ns_veth2' interface

Unless you have any preference I'd user the later (removing TST_ID)
+ removing TST_TOTAL.

> For TCID, I guess we would also need this change in tst_test.sh:

> diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> index 6c2ee6a..b7aa4a7 100644
> --- a/testcases/lib/tst_test.sh
> +++ b/testcases/lib/tst_test.sh
> @@ -102,7 +102,7 @@ tst_res()

>         tst_inc_res "$res"

> -       printf "$TCID $TST_COUNT "
> +       printf "$TST_ID $TST_COUNT "
>         tst_print_colored $res "$res: "
>         echo "$@"
>  }

Thanks a lot for pointing out my old copy-paste error!
Pushed as:
958969f4d tst_test.sh: Fix using correct test ID variable
with you as Reported-by.


Kind regards,
Petr
Alexey Kodanev April 11, 2018, 9:29 a.m. UTC | #4
On 10.04.2018 20:00, Petr Vorel wrote:
> Hi Alexey,
> 
>>> --- a/testscripts/network.sh
>>> +++ b/testscripts/network.sh
>>> @@ -89,7 +89,7 @@ shift $(($OPTIND - 1))
>>>  TST_TOTAL=1
>>>  TCID="network_settings"
>> Do we need these variables in the new API?
> 
> Yes, good catch, both are redundant.
> 
> TCID is invalid, it was required, but with the fix you pointed out (see below) TCID is
> redundant.
> 
> TST_ID:
>  TST_ID="network_settings" would keep previous name:
> network_settings 1 TINFO: initialize 'lhost' 'ltp_ns_veth2' interface
> 
> without TST_ID is the name of the script (set by tst_test.sh: filename=$(basename $0) ):
> network 1 TINFO: initialize 'lhost' 'ltp_ns_veth2' interface
> 
> Unless you have any preference I'd user the later (removing TST_ID)
> + removing TST_TOTAL.


There is one more occurrence of TCID in tst_net_stress.sh, is it needed?


Thanks,
Alexey
Petr Vorel April 11, 2018, 11:02 a.m. UTC | #5
Hi Alexey,

> There is one more occurrence of TCID in tst_net_stress.sh, is it needed?
Thanks a lot, removed.

Kind regards,
Petr

Patch
diff mbox series

diff --git a/testscripts/network.sh b/testscripts/network.sh
index cc2b2de72..b18f202d5 100755
--- a/testscripts/network.sh
+++ b/testscripts/network.sh
@@ -89,7 +89,7 @@  shift $(($OPTIND - 1))
 TST_TOTAL=1
 TCID="network_settings"
 
-TST_USE_LEGACY_API=1
+TST_NO_DEFAULT_RUN=1
 . tst_net.sh
 
 # Reset variables.