Test: stabilized test_restconf_internal* tests by looping

This commit is contained in:
Olof hagsand 2023-09-27 13:10:33 +02:00
parent 2d8567cd1b
commit 520f20def5
2 changed files with 64 additions and 48 deletions

View file

@ -96,7 +96,8 @@ function rpcstatus()
active=$1
status=$2
sleep $DEMSLEEP
jmax=10
for j in $(seq 1 $jmax); do
new "send rpc status"
rpc=$(chunked_framing "<rpc $DEFAULTNS><process-control $LIBNS><name>restconf</name><operation>status</operation></process-control></rpc>")
retx=$($clixon_netconf -qef $cfg<<EOF
@ -123,6 +124,13 @@ EOF
match=$(echo "$retx" | grep --null -Go "$expect")
if [ -z "$match" ]; then
echo "retry after sleep"
sleep $DEMSLEEP
continue
fi
break
done
if [ $j -eq $jmax ]; then
err "$expect" "$retx"
fi
}

View file

@ -111,7 +111,8 @@ function rpcstatus()
active=$1
status=$2
sleep $DEMSLEEP
jmax=10
for j in $(seq 1 $jmax); do
new "send rpc status"
rpc=$(chunked_framing "<rpc $DEFAULTNS><process-control $LIBNS><name>restconf</name><operation>status</operation></process-control></rpc>")
retx=$($clixon_netconf -qef $cfg<<EOF
@ -139,6 +140,13 @@ EOF
fi
match=$(echo "$retx" | grep --null -Go "$expect")
if [ -z "$match" ]; then
echo "retry after sleep"
sleep $DEMSLEEP
continue
fi
break
done
if [ $j -eq $jmax ]; then
err "$expect" "$retx"
fi
}