public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] rpc: Warn when tests aren't compiled
@ 2020-05-12 15:27 Petr Vorel
  2020-05-12 17:07 ` Alexey Kodanev
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2020-05-12 15:27 UTC (permalink / raw)
  To: ltp

Without this test failure was wrongly reported:
rpc_test 1 TFAIL: tirpc_rpcb_getaddr 10.0.0.2 536875000 failed unexpectedly

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/network/rpc/rpc-tirpc/rpc_test.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/testcases/network/rpc/rpc-tirpc/rpc_test.sh b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
index 30cfd2564..fd72e6be4 100755
--- a/testcases/network/rpc/rpc-tirpc/rpc_test.sh
+++ b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
@@ -35,10 +35,12 @@ EOF
 
 rpc_parse_args()
 {
+	local err="LTP compiled without TI-RPC support"
+
 	case "$1" in
-		c) CLIENT="$OPTARG" ;;
-		e) CLIENT_EXTRA_OPTS="$OPTARG" ;;
-		s) SERVER="$OPTARG" ;;
+	c) CLIENT="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;;
+	e) CLIENT_EXTRA_OPTS="$OPTARG";;
+	s) SERVER="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;;
 	esac
 }
 
-- 
2.26.2


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

* [LTP] [PATCH 1/1] rpc: Warn when tests aren't compiled
  2020-05-12 15:27 [LTP] [PATCH 1/1] rpc: Warn when tests aren't compiled Petr Vorel
@ 2020-05-12 17:07 ` Alexey Kodanev
  2020-05-12 19:50   ` Petr Vorel
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Kodanev @ 2020-05-12 17:07 UTC (permalink / raw)
  To: ltp

On 12.05.2020 18:27, Petr Vorel wrote:
> Without this test failure was wrongly reported:
> rpc_test 1 TFAIL: tirpc_rpcb_getaddr 10.0.0.2 536875000 failed unexpectedly
> 

Hi Petr,

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testcases/network/rpc/rpc-tirpc/rpc_test.sh | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/testcases/network/rpc/rpc-tirpc/rpc_test.sh b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
> index 30cfd2564..fd72e6be4 100755
> --- a/testcases/network/rpc/rpc-tirpc/rpc_test.sh
> +++ b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
> @@ -35,10 +35,12 @@ EOF
>  
>  rpc_parse_args()
>  {
> +	local err="LTP compiled without TI-RPC support"
> +
>  	case "$1" in
> -		c) CLIENT="$OPTARG" ;;
> -		e) CLIENT_EXTRA_OPTS="$OPTARG" ;;
> -		s) SERVER="$OPTARG" ;;
> +	c) CLIENT="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;;
> +	e) CLIENT_EXTRA_OPTS="$OPTARG";;
> +	s) SERVER="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;;
>  	esac

Perhaps this one, to write about the missing command:
tst_require_cmds $CLIENT $SERVER

or just $CLIENT because it's always used, and if the hint is needed:
tst_check_cmds $CLIENT $SERVER || tst_brk TCONF "LTP compiled without TI-RPC support?"

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

* [LTP] [PATCH 1/1] rpc: Warn when tests aren't compiled
  2020-05-12 17:07 ` Alexey Kodanev
@ 2020-05-12 19:50   ` Petr Vorel
  0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2020-05-12 19:50 UTC (permalink / raw)
  To: ltp

Hi Alexey,

...
> >  rpc_parse_args()
> >  {
> > +	local err="LTP compiled without TI-RPC support"
> > +
> >  	case "$1" in
> > -		c) CLIENT="$OPTARG" ;;
> > -		e) CLIENT_EXTRA_OPTS="$OPTARG" ;;
> > -		s) SERVER="$OPTARG" ;;
> > +	c) CLIENT="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;;
> > +	e) CLIENT_EXTRA_OPTS="$OPTARG";;
> > +	s) SERVER="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;;
> >  	esac

> Perhaps this one, to write about the missing command:
> tst_require_cmds $CLIENT $SERVER

> or just $CLIENT because it's always used, and if the hint is needed:
> tst_check_cmds $CLIENT $SERVER || tst_brk TCONF "LTP compiled without TI-RPC support?"
I prefer to have the hint, so I'll merge this variant.

Thanks for your review!

Kind regards,
Petr

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

end of thread, other threads:[~2020-05-12 19:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-12 15:27 [LTP] [PATCH 1/1] rpc: Warn when tests aren't compiled Petr Vorel
2020-05-12 17:07 ` Alexey Kodanev
2020-05-12 19:50   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox