public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib/test_net.sh: fix 'tst_rhost_run -s' when errors occur
@ 2015-01-15 12:22 Alexey Kodanev
  2015-01-15 12:22 ` [LTP] [PATCH 1/4] network/stress/dns: rename dns4-stress script Alexey Kodanev
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexey Kodanev @ 2015-01-15 12:22 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..310d3d1 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$'
+	[ $? -eq 0 -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] 4+ messages in thread

end of thread, other threads:[~2015-03-19  9:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-15 12:22 [LTP] [PATCH] lib/test_net.sh: fix 'tst_rhost_run -s' when errors occur Alexey Kodanev
2015-01-15 12:22 ` [LTP] [PATCH 1/4] network/stress/dns: rename dns4-stress script Alexey Kodanev
2015-01-15 12:22 ` [LTP] [PATCH 2/4] testscripts/network.sh: add reverse IPv6 addresses Alexey Kodanev
     [not found] ` <1421324561-6680-5-git-send-email-alexey.kodanev@oracle.com>
2015-03-19  9:12   ` [LTP] [PATCH 4/4] runtest/network-stress.appl: fix dns test names Alexey Kodanev

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