All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] tst_net.sh: Print output on unexpected PASS/FAIL
@ 2020-05-18 21:15 Petr Vorel
  2020-05-18 21:15 ` [LTP] [PATCH 2/2] rpc_test.sh: Print used TI-RPC implementation Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Petr Vorel @ 2020-05-18 21:15 UTC (permalink / raw)
  To: ltp

This helps debugging.

Use $TMPDIR and PID to guarantee writable directory and unique file
without the need to require TST_NEEDS_TMPDIR=1.

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

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index 011b62267..bfed4a44d 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -250,22 +250,32 @@ tst_net_run()
 
 EXPECT_RHOST_PASS()
 {
-	tst_rhost_run -c "$*" > /dev/null
+	local log="$TMPDIR/log.$$"
+
+	tst_rhost_run -c "$*" > $log
 	if [ $? -eq 0 ]; then
 		tst_res_ TPASS "$* passed as expected"
 	else
 		tst_res_ TFAIL "$* failed unexpectedly"
+		cat $log
 	fi
+
+	rm -f $log
 }
 
 EXPECT_RHOST_FAIL()
 {
-	tst_rhost_run -c "$* 2> /dev/null"
+	local log="$TMPDIR/log.$$"
+
+	tst_rhost_run -c "$*" > $log
 	if [ $? -ne 0 ]; then
 		tst_res_ TPASS "$* failed as expected"
 	else
 		tst_res_ TFAIL "$* passed unexpectedly"
+		cat $log
 	fi
+
+	rm -f $log
 }
 
 # Get test interface names for local/remote host.
-- 
2.26.2


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

* [LTP] [PATCH 2/2] rpc_test.sh: Print used TI-RPC implementation
  2020-05-18 21:15 [LTP] [PATCH 1/2] tst_net.sh: Print output on unexpected PASS/FAIL Petr Vorel
@ 2020-05-18 21:15 ` Petr Vorel
  2020-05-20 13:39   ` Alexey Kodanev
  2020-05-20 13:39 ` [LTP] [PATCH 1/2] tst_net.sh: Print output on unexpected PASS/FAIL Alexey Kodanev
  2020-05-20 14:25 ` Xiao Yang
  2 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2020-05-18 21:15 UTC (permalink / raw)
  To: ltp

This helps to debug glibc tests. Some of them are failing:
Cannot register service: RPC: Unable to receive; errno = Connection refused

+ unify case on message in check_portmap_rpcbind.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/network/rpc/basic_tests/rpc_lib.sh | 2 +-
 testcases/network/rpc/rpc-tirpc/rpc_test.sh  | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/testcases/network/rpc/basic_tests/rpc_lib.sh b/testcases/network/rpc/basic_tests/rpc_lib.sh
index 96dae8dd3..c7c868709 100644
--- a/testcases/network/rpc/basic_tests/rpc_lib.sh
+++ b/testcases/network/rpc/basic_tests/rpc_lib.sh
@@ -11,5 +11,5 @@ check_portmap_rpcbind()
 		pgrep rpcbind > /dev/null && PORTMAPPER="rpcbind" || \
 			tst_brk TCONF "portmap or rpcbind is not running"
 	fi
-	tst_res TINFO "Using $PORTMAPPER"
+	tst_res TINFO "using $PORTMAPPER"
 }
diff --git a/testcases/network/rpc/rpc-tirpc/rpc_test.sh b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
index dc97213d0..410482c14 100755
--- a/testcases/network/rpc/rpc-tirpc/rpc_test.sh
+++ b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
@@ -55,6 +55,13 @@ setup()
 
 	[ -n "$CLIENT" ] || tst_brk TBROK "client program not set"
 	tst_check_cmds $CLIENT $SERVER || tst_brk TCONF "LTP compiled without TI-RPC support?"
+
+	tst_cmd_available ldd which || return
+	if ldd $(which $CLIENT) |grep -q /libtirpc\.so; then
+		tst_res TINFO "using libtirpc: yes"
+	else
+		tst_res TINFO "using libtirpc: no (probably using glibc)"
+	fi
 }
 
 cleanup()
-- 
2.26.2


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

* [LTP] [PATCH 1/2] tst_net.sh: Print output on unexpected PASS/FAIL
  2020-05-18 21:15 [LTP] [PATCH 1/2] tst_net.sh: Print output on unexpected PASS/FAIL Petr Vorel
  2020-05-18 21:15 ` [LTP] [PATCH 2/2] rpc_test.sh: Print used TI-RPC implementation Petr Vorel
@ 2020-05-20 13:39 ` Alexey Kodanev
  2020-05-20 14:25 ` Xiao Yang
  2 siblings, 0 replies; 6+ messages in thread
From: Alexey Kodanev @ 2020-05-20 13:39 UTC (permalink / raw)
  To: ltp

On 19.05.2020 00:15, Petr Vorel wrote:
> This helps debugging.
> 
> Use $TMPDIR and PID to guarantee writable directory and unique file
> without the need to require TST_NEEDS_TMPDIR=1.
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testcases/lib/tst_net.sh | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> index 011b62267..bfed4a44d 100644
> --- a/testcases/lib/tst_net.sh
> +++ b/testcases/lib/tst_net.sh
> @@ -250,22 +250,32 @@ tst_net_run()
>  
>  EXPECT_RHOST_PASS()
>  {
> -	tst_rhost_run -c "$*" > /dev/null
> +	local log="$TMPDIR/log.$$"
> +
> +	tst_rhost_run -c "$*" > $log
>  	if [ $? -eq 0 ]; then
>  		tst_res_ TPASS "$* passed as expected"
>  	else
>  		tst_res_ TFAIL "$* failed unexpectedly"
> +		cat $log
>  	fi
> +
> +	rm -f $log
>  }
>  
>  EXPECT_RHOST_FAIL()
>  {
> -	tst_rhost_run -c "$* 2> /dev/null"
> +	local log="$TMPDIR/log.$$"
> +
> +	tst_rhost_run -c "$*" > $log
>  	if [ $? -ne 0 ]; then
>  		tst_res_ TPASS "$* failed as expected"
>  	else
>  		tst_res_ TFAIL "$* passed unexpectedly"
> +		cat $log
>  	fi
> +
> +	rm -f $log
>  }
>  
>  # Get test interface names for local/remote host.
> 

Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>

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

* [LTP] [PATCH 2/2] rpc_test.sh: Print used TI-RPC implementation
  2020-05-18 21:15 ` [LTP] [PATCH 2/2] rpc_test.sh: Print used TI-RPC implementation Petr Vorel
@ 2020-05-20 13:39   ` Alexey Kodanev
  0 siblings, 0 replies; 6+ messages in thread
From: Alexey Kodanev @ 2020-05-20 13:39 UTC (permalink / raw)
  To: ltp

On 19.05.2020 00:15, Petr Vorel wrote:
> This helps to debug glibc tests. Some of them are failing:
> Cannot register service: RPC: Unable to receive; errno = Connection refused
> 
> + unify case on message in check_portmap_rpcbind.
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testcases/network/rpc/basic_tests/rpc_lib.sh | 2 +-
>  testcases/network/rpc/rpc-tirpc/rpc_test.sh  | 7 +++++++
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/testcases/network/rpc/basic_tests/rpc_lib.sh b/testcases/network/rpc/basic_tests/rpc_lib.sh
> index 96dae8dd3..c7c868709 100644
> --- a/testcases/network/rpc/basic_tests/rpc_lib.sh
> +++ b/testcases/network/rpc/basic_tests/rpc_lib.sh
> @@ -11,5 +11,5 @@ check_portmap_rpcbind()
>  		pgrep rpcbind > /dev/null && PORTMAPPER="rpcbind" || \
>  			tst_brk TCONF "portmap or rpcbind is not running"
>  	fi
> -	tst_res TINFO "Using $PORTMAPPER"
> +	tst_res TINFO "using $PORTMAPPER"
>  }
> diff --git a/testcases/network/rpc/rpc-tirpc/rpc_test.sh b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
> index dc97213d0..410482c14 100755
> --- a/testcases/network/rpc/rpc-tirpc/rpc_test.sh
> +++ b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
> @@ -55,6 +55,13 @@ setup()
>  
>  	[ -n "$CLIENT" ] || tst_brk TBROK "client program not set"
>  	tst_check_cmds $CLIENT $SERVER || tst_brk TCONF "LTP compiled without TI-RPC support?"
> +
> +	tst_cmd_available ldd which || return
> +	if ldd $(which $CLIENT) |grep -q /libtirpc\.so; then
> +		tst_res TINFO "using libtirpc: yes"
> +	else
> +		tst_res TINFO "using libtirpc: no (probably using glibc)"
> +	fi
>  }
>  
>  cleanup()
> 

Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>

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

* [LTP] [PATCH 1/2] tst_net.sh: Print output on unexpected PASS/FAIL
  2020-05-18 21:15 [LTP] [PATCH 1/2] tst_net.sh: Print output on unexpected PASS/FAIL Petr Vorel
  2020-05-18 21:15 ` [LTP] [PATCH 2/2] rpc_test.sh: Print used TI-RPC implementation Petr Vorel
  2020-05-20 13:39 ` [LTP] [PATCH 1/2] tst_net.sh: Print output on unexpected PASS/FAIL Alexey Kodanev
@ 2020-05-20 14:25 ` Xiao Yang
  2020-05-20 14:44   ` Petr Vorel
  2 siblings, 1 reply; 6+ messages in thread
From: Xiao Yang @ 2020-05-20 14:25 UTC (permalink / raw)
  To: ltp

Hi Petr,

I tested the patchset and it also looks good to me.
BTW: These outputs are useful to locate the issue.

Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

Best Regards,
Xiao Yang
On 2020/5/19 5:15, Petr Vorel wrote:
> This helps debugging.
>
> Use $TMPDIR and PID to guarantee writable directory and unique file
> without the need to require TST_NEEDS_TMPDIR=1.
>
> Signed-off-by: Petr Vorel<pvorel@suse.cz>
> ---
>   testcases/lib/tst_net.sh | 14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> index 011b62267..bfed4a44d 100644
> --- a/testcases/lib/tst_net.sh
> +++ b/testcases/lib/tst_net.sh
> @@ -250,22 +250,32 @@ tst_net_run()
>
>   EXPECT_RHOST_PASS()
>   {
> -	tst_rhost_run -c "$*">  /dev/null
> +	local log="$TMPDIR/log.$$"
> +
> +	tst_rhost_run -c "$*">  $log
>   	if [ $? -eq 0 ]; then
>   		tst_res_ TPASS "$* passed as expected"
>   	else
>   		tst_res_ TFAIL "$* failed unexpectedly"
> +		cat $log
>   	fi
> +
> +	rm -f $log
>   }
>
>   EXPECT_RHOST_FAIL()
>   {
> -	tst_rhost_run -c "$* 2>  /dev/null"
> +	local log="$TMPDIR/log.$$"
> +
> +	tst_rhost_run -c "$*">  $log
>   	if [ $? -ne 0 ]; then
>   		tst_res_ TPASS "$* failed as expected"
>   	else
>   		tst_res_ TFAIL "$* passed unexpectedly"
> +		cat $log
>   	fi
> +
> +	rm -f $log
>   }
>
>   # Get test interface names for local/remote host.




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

* [LTP] [PATCH 1/2] tst_net.sh: Print output on unexpected PASS/FAIL
  2020-05-20 14:25 ` Xiao Yang
@ 2020-05-20 14:44   ` Petr Vorel
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2020-05-20 14:44 UTC (permalink / raw)
  To: ltp

Hi Alexey, Yang,

> I tested the patchset and it also looks good to me.
> BTW: These outputs are useful to locate the issue.

thank you both for your review, merged.

Kind regards,
Petr

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

end of thread, other threads:[~2020-05-20 14:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18 21:15 [LTP] [PATCH 1/2] tst_net.sh: Print output on unexpected PASS/FAIL Petr Vorel
2020-05-18 21:15 ` [LTP] [PATCH 2/2] rpc_test.sh: Print used TI-RPC implementation Petr Vorel
2020-05-20 13:39   ` Alexey Kodanev
2020-05-20 13:39 ` [LTP] [PATCH 1/2] tst_net.sh: Print output on unexpected PASS/FAIL Alexey Kodanev
2020-05-20 14:25 ` Xiao Yang
2020-05-20 14:44   ` 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.