public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib/test_net.sh: add waiting loop to netload()
@ 2015-09-16  9:43 Alexey Kodanev
  2015-09-17  7:41 ` Jan Stancek
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Kodanev @ 2015-09-16  9:43 UTC (permalink / raw)
  To: ltp

After starting background TCP server on remote host, check that
it assigned specified port.

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

diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
index 9df49d2..b42337a 100644
--- a/testcases/lib/test_net.sh
+++ b/testcases/lib/test_net.sh
@@ -282,6 +282,17 @@ tst_netload()
 		tst_resm TINFO "run tcp_fastopen with '$ip_addr', port '$port'"
 		tst_rhost_run -s -b -c "tcp_fastopen -R $max_requests -g $port"
 
+		# check that tcp_fastopen on rhost in 'Listening' state
+		local sec_waited=
+		for sec_waited in $(seq 1 60); do
+			tst_rhost_run -c "ss -ln | grep -q $port" && break
+			if [ $sec_waited -eq 60 ]; then
+				tst_resm TINFO "rhost not in LISTEN state"
+				return 1
+			fi
+			sleep 1
+		done
+
 		# run local tcp client
 		tcp_fastopen -a $clients_num -r $client_requests -l \
 			-H $ip_addr -g $port -d $rfile > /dev/null || ret=1
-- 
1.7.1


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

end of thread, other threads:[~2015-09-22  9:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16  9:43 [LTP] [PATCH] lib/test_net.sh: add waiting loop to netload() Alexey Kodanev
2015-09-17  7:41 ` Jan Stancek
2015-09-17  8:45   ` Alexey Kodanev
2015-09-22  9:11     ` Alexey Kodanev

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