Retry if a test case fails because of an unexpected resend
Palliative for https://github.com/ARMmbed/mbedtls/issues/3377. If a test case fails due to an unexpected resend, allow retrying, like in the case of a client timeout. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
0e3534c67b
commit
f11d30ecda
1 changed files with 13 additions and 5 deletions
|
@ -867,14 +867,14 @@ analyze_test_commands() {
|
||||||
# * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed
|
# * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed
|
||||||
#
|
#
|
||||||
# Outputs:
|
# Outputs:
|
||||||
# * $outcome: one of PASS/RETRY/FAIL
|
# * $outcome: one of PASS/RETRY*/FAIL
|
||||||
check_test_failure() {
|
check_test_failure() {
|
||||||
outcome=FAIL
|
outcome=FAIL
|
||||||
|
|
||||||
if [ $TIMES_LEFT -gt 0 ] &&
|
if [ $TIMES_LEFT -gt 0 ] &&
|
||||||
grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null
|
grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null
|
||||||
then
|
then
|
||||||
outcome=RETRY
|
outcome="RETRY(client-timeout)"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -939,14 +939,22 @@ check_test_failure() {
|
||||||
|
|
||||||
"-S")
|
"-S")
|
||||||
if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then
|
if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then
|
||||||
fail "pattern '$2' MUST NOT be present in the Server output"
|
if [ "$2" = "resend" ] && [ $TIMES_LEFT -gt 0 ]; then
|
||||||
|
outcome="RETRY(resend)"
|
||||||
|
else
|
||||||
|
fail "pattern '$2' MUST NOT be present in the Server output"
|
||||||
|
fi
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"-C")
|
"-C")
|
||||||
if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then
|
if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then
|
||||||
fail "pattern '$2' MUST NOT be present in the Client output"
|
if [ "$2" = "resend" ] && [ $TIMES_LEFT -gt 0 ]; then
|
||||||
|
outcome="RETRY(resend)"
|
||||||
|
else
|
||||||
|
fail "pattern '$2' MUST NOT be present in the Client output"
|
||||||
|
fi
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -1129,7 +1137,7 @@ run_test() {
|
||||||
check_test_failure "$@"
|
check_test_failure "$@"
|
||||||
case $outcome in
|
case $outcome in
|
||||||
PASS) break;;
|
PASS) break;;
|
||||||
RETRY) printf "RETRY ";;
|
RETRY*) printf "$outcome ";;
|
||||||
FAIL) return;;
|
FAIL) return;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue