From 4f5b0178cc9b2aed6bfb57bd11e7b66458e90026 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Tue, 24 Nov 2020 22:29:48 +0100 Subject: [PATCH] fix test sleep/loop problem --- test/lib.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/lib.sh b/test/lib.sh index 6912ddcb..6bde04ce 100755 --- a/test/lib.sh +++ b/test/lib.sh @@ -120,7 +120,9 @@ fi # Multiplication factor to sleep less than whole seconds DEMSLEEP=.5 -let DEMWAIT*=2; + +# DEMWAIT is expressed in seconds, but really * DEMSLEEP +let DEMLOOP=2*DEMWAIT # RESTCONF protocol, eg http or https : ${RCPROTO:=http} @@ -284,7 +286,7 @@ wait_backend(){ reply=$(echo ']]>]]>' | clixon_netconf -qef $cfg 2> /dev/null) let i++; # echo "wait_backend $i" - if [ $i -ge $DEMWAIT ]; then + if [ $i -ge $DEMLOOP ]; then err "backend timeout $DEMWAIT seconds" fi done @@ -333,7 +335,7 @@ wait_restconf(){ # echo "hdr:\"$hdr\"" let i++; # echo "wait_restconf $i" - if [ $i -ge $DEMWAIT ]; then + if [ $i -ge $DEMLOOP ]; then err "restconf timeout $DEMWAIT seconds" fi done