Retry hwsim tests 3 times on fail

This commit is contained in:
Juliusz Sosinowicz
2023-03-22 19:16:47 +01:00
parent 496a15037b
commit e73ae077dc

View File

@ -189,12 +189,24 @@ jobs:
id: testing
working-directory: hostap/tests/hwsim/
run: |
# Run tests in increments of 100 to cut down on the uploaded log size.
while mapfile -t -n 100 ary && ((${#ary[@]})); do
# Run tests in increments of 50 to cut down on the uploaded log size.
while mapfile -t -n 50 ary && ((${#ary[@]})); do
TESTS=$(printf '%s\n' "${ary[@]}" | tr '\n' ' ')
sudo ./start.sh
sudo ./run-tests.py ${{ env.hostap_debug_flags }} --split ${{ matrix.server }}/5 $TESTS
sudo ./stop.sh
# Retry up to three times
for i in {1..3}; do
HWSIM_RES=0
# Logs can grow quickly especially in debug mode
sudo rm -rf logs
sudo ./start.sh
sudo ./run-tests.py ${{ env.hostap_debug_flags }} --split ${{ matrix.server }}/5 $TESTS || HWSIM_RES=$?
sudo ./stop.sh
if [ "$HWSIM_RES" -eq "0" ]; then
break
fi
done
if [ "$HWSIM_RES" -ne "0" ]; then
exit $HWSIM_RES
fi
done < $GITHUB_WORKSPACE/wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/tests
- name: Change failure log permissions