public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] lib/test_net.sh: fix 'tst_rhost_run -s' when errors occur
@ 2015-01-23 12:35 Alexey Kodanev
  2015-01-28 12:24 ` Alexey Kodanev
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Kodanev @ 2015-01-23 12:35 UTC (permalink / raw)
  To: ltp-list; +Cc: vasily.isaenko

Don't redirect stderr to /dev/null, print it in TBROK message.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 testcases/lib/test_net.sh |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
index ec3366b..d72e84e 100644
--- a/testcases/lib/test_net.sh
+++ b/testcases/lib/test_net.sh
@@ -45,7 +45,10 @@ tst_rhost_run()
 			post_cmd=" > /dev/null 2>&1 &"
 			out="1> /dev/null"
 		;;
-		s) safe=1 ;;
+		s)
+			safe=1
+			post_cmd=' || echo TERR'
+		;;
 		c) cmd=$OPTARG ;;
 		u) user=$OPTARG ;;
 		*)
@@ -62,14 +65,14 @@ tst_rhost_run()
 	local ret=
 	if [ -n "$TST_USE_SSH" ]; then
 		output=`ssh -n -q $user@$RHOST "sh -c \
-			'$pre_cmd $cmd $post_cmd'" $out 2> /dev/null`
+			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'TERR'`
 	else
 		output=`rsh -n -l $user $RHOST "sh -c \
-			'$pre_cmd $cmd $post_cmd'" $out 2> /dev/null`
+			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'TERR'`
 	fi
-	ret=$?
-	[ "$ret" -ne 0 -a "$safe" -eq 1 ] && \
-		tst_brkm TBROK "failed to run '$cmd' on '$RHOST'"
+	echo "$output" | grep -q 'TERR$' && ret=1 || ret=0
+	[ $ret -eq 1 -a "$safe" -eq 1 ] && \
+		tst_brkm TBROK "failed to run '$cmd' on '$RHOST': '$output'"
 
 	[ -z "$out" -a -n "$output" ] && echo "$output"
 
-- 
1.7.1


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH v2] lib/test_net.sh: fix 'tst_rhost_run -s' when errors occur
  2015-01-23 12:35 [LTP] [PATCH v2] lib/test_net.sh: fix 'tst_rhost_run -s' when errors occur Alexey Kodanev
@ 2015-01-28 12:24 ` Alexey Kodanev
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Kodanev @ 2015-01-28 12:24 UTC (permalink / raw)
  To: ltp-list; +Cc: vasily.isaenko

Hi!
On 01/23/2015 03:35 PM, Alexey Kodanev wrote:
> Don't redirect stderr to /dev/null, print it in TBROK message.
>
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
>   testcases/lib/test_net.sh |   15 +++++++++------
>   1 files changed, 9 insertions(+), 6 deletions(-)

Patch pushed.

Best regards,
Alexey


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2015-01-28 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-23 12:35 [LTP] [PATCH v2] lib/test_net.sh: fix 'tst_rhost_run -s' when errors occur Alexey Kodanev
2015-01-28 12:24 ` Alexey Kodanev

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