Skip to contentSkip to conversation

tst_test.sh: eval TST_RETRY_FN_EXP_BACKOFF function

PATCH New Petr Vorel 2 participants 4 messages Apr 27, 2020 – May 6, 2020

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH v2 1/2 tst_test.sh: eval TST_RETRY_FN_EXP_BACKOFF function

It helps to have more advanced commands without having to declare function.

---
 testcases/lib/tst_test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/lib/tst_test.sh +1 -1
index 1d8a71d9f..8d24b4abf 100644
@@ -207,7 +207,7 @@ TST_RETRY_FN_EXP_BACKOFF()
 	fi
 
 	while true; do
-		$tst_fun
+		eval "$tst_fun"
 		if [ "$?" = "$tst_exp" ]; then
 			break
 		fi
Signature · 1 line
2.26.1
author
#1 lore raw

PATCH v2 2/2 net/sendfile01.sh: Check with timeout

---
 testcases/network/tcp_cmds/sendfile/sendfile01.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/network/tcp_cmds/sendfile/sendfile01.sh +2 -2
index af9cadf57..7104de7aa 100755
@@ -11,7 +11,7 @@ TST_SETUP=do_setup
 TST_CLEANUP=do_cleanup
 TST_TESTFUNC=do_test
 TST_NEEDS_TMPDIR=1
-TST_NEEDS_CMDS="diff stat"
+TST_NEEDS_CMDS="diff ss stat"
 . tst_net.sh
 
 do_setup()
@@ -28,7 +28,7 @@ do_setup()
 	tst_rhost_run -s -b -c "$server $(tst_ipaddr rhost) $port"
 	server_started=1
 	tst_res TINFO "wait for the server to start"
-	sleep 1
+	TST_RETRY_FUNC "tst_rhost_run -c 'ss -ltp' | grep -q '$port.*testsf'" 0
 }
 
 do_test()
Signature · 1 line
2.26.1
#2 lore raw

PATCH v2 1/2 tst_test.sh: eval TST_RETRY_FN_EXP_BACKOFF function

In reply to Petr Vorel

For patchset:

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200427/6ef5c2ce/attachment.htm>
#3 lore raw

PATCH v2 1/2 tst_test.sh: eval TST_RETRY_FN_EXP_BACKOFF function

In reply to Petr Vorel

Patchset pushed, thanks!

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200506/e4a76cf6/attachment.htm>