hostap/tests/hwsim/run-all.sh
Jouni Malinen 0c43a982c7 tests: Add option to run test cases under valgrind/concurrent P2P
./run-all.sh can now take an optional argument to select whether to run
all test cases as before (default), to run these under valgrind
("valgrind"), to run P2P test cases with concurrent station interface
("concurrent"), or the concurrent P2P test cases under valgrind
("concurrent-valgrind").

valgrind cases report errors if a test case fails or valgrind reports an
error.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-08-24 20:33:21 +03:00

56 lines
1.7 KiB
Bash
Executable file

#!/bin/sh
errors=0
umask 0002
if [ "x$1" = "xconcurrent-valgrind" ]; then
./start-p2p-concurrent.sh valgrind
DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
for i in autogo discovery grpform; do
./run-tests.py -e logs/$DATE-failed-$i -f test_p2p_$i.py || errors=1
done
./stop-wifi.sh valgrind
failures=`grep "ERROR SUMMARY" logs/$DATE-valgrind-* | grep -v " 0 errors" | wc -l`
if [ $failures -gt 0 ]; then
echo "Mark as failed due to valgrind errors"
errors=1
fi
if [ $errors -gt 0 ]; then
tar czf /tmp/hwsim-tests-$DATE-FAILED-concurrent-valgrind.tar.gz logs/$DATE*
exit 1
fi
elif [ "x$1" = "xconcurrent" ]; then
./start-p2p-concurrent.sh
DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
for i in autogo discovery grpform; do
./run-tests.py -e logs/$DATE-failed-$i -f test_p2p_$i.py || errors=1
done
./stop-wifi.sh
if [ $errors -gt 0 ]; then
tar czf /tmp/hwsim-tests-$DATE-FAILED-concurrent.tar.gz logs/$DATE*
exit 1
fi
elif [ "x$1" = "xvalgrind" ]; then
./start.sh valgrind
DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
./run-tests.py -e logs/$DATE-failed || errors=1
./stop-wifi.sh valgrind
failures=`grep "ERROR SUMMARY" logs/$DATE-valgrind-* | grep -v " 0 errors" | wc -l`
if [ $failures -gt 0 ]; then
echo "Mark as failed due to valgrind errors"
errors=1
fi
if [ $errors -gt 0 ]; then
tar czf /tmp/hwsim-tests-$DATE-FAILED-valgrind.tar.gz logs/$DATE*
exit 1
fi
else
./start.sh
DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
./run-tests.py -e logs/$DATE-failed || errors=1
./stop-wifi.sh
if [ $errors -gt 0 ]; then
tar czf /tmp/hwsim-tests-$DATE-FAILED.tar.gz logs/$DATE*
exit 1
fi
fi