2013-03-09 14:40:31 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-03-09 16:29:22 -05:00
|
|
|
errors=0
|
2013-03-30 05:11:55 -04:00
|
|
|
umask 0002
|
2013-08-24 13:33:21 -04:00
|
|
|
|
|
|
|
if [ "x$1" = "xconcurrent-valgrind" ]; then
|
2013-09-28 11:19:38 -04:00
|
|
|
if ! ./start-p2p-concurrent.sh valgrind; then
|
|
|
|
echo "Could not start test environment" > logs/last-debug
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-08-24 13:33:21 -04:00
|
|
|
DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
|
2013-08-25 13:15:54 -04:00
|
|
|
rm logs/last-debug
|
2013-08-24 13:33:21 -04:00
|
|
|
for i in autogo discovery grpform; do
|
2013-09-28 11:31:00 -04:00
|
|
|
./run-tests.py -l logs/$DATE-run-$i -e logs/$DATE-failed-$i -r logs/results.txt -f test_p2p_$i.py || errors=1
|
2013-08-25 13:15:54 -04:00
|
|
|
cat logs/$DATE-run-$i >> logs/last-debug
|
2013-08-24 13:33:21 -04:00
|
|
|
done
|
2013-08-26 04:28:32 -04:00
|
|
|
./stop-wifi.sh
|
2013-08-24 13:33:21 -04:00
|
|
|
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
|
2013-09-28 11:19:38 -04:00
|
|
|
if ! ./start-p2p-concurrent.sh; then
|
|
|
|
echo "Could not start test environment" > logs/last-debug
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-08-24 13:33:21 -04:00
|
|
|
DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
|
2013-08-25 13:15:54 -04:00
|
|
|
rm logs/last-debug
|
2013-08-24 13:33:21 -04:00
|
|
|
for i in autogo discovery grpform; do
|
2013-09-28 11:31:00 -04:00
|
|
|
./run-tests.py -l logs/$DATE-run-$i -e logs/$DATE-failed-$i -r logs/results.txt -f test_p2p_$i.py || errors=1
|
2013-08-25 13:15:54 -04:00
|
|
|
cat logs/$DATE-run-$i >> logs/last-debug
|
2013-08-24 13:33:21 -04:00
|
|
|
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
|
2013-09-28 11:19:38 -04:00
|
|
|
if ! ./start.sh valgrind; then
|
|
|
|
echo "Could not start test environment" > logs/last-debug
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-08-24 13:33:21 -04:00
|
|
|
DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
|
2013-09-28 11:31:00 -04:00
|
|
|
./run-tests.py -l logs/$DATE-run -e logs/$DATE-failed -r logs/results.txt || errors=1
|
2013-08-25 13:15:54 -04:00
|
|
|
cat logs/$DATE-run > logs/last-debug
|
2013-08-26 04:28:32 -04:00
|
|
|
./stop-wifi.sh
|
2013-08-24 13:33:21 -04:00
|
|
|
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
|
2013-09-28 03:36:56 -04:00
|
|
|
elif [ "x$1" = "xtrace" ]; then
|
2013-09-28 11:19:38 -04:00
|
|
|
if ! ./start.sh trace; then
|
|
|
|
echo "Could not start test environment" > logs/last-debug
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-09-28 03:36:56 -04:00
|
|
|
DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
|
2013-09-28 11:31:00 -04:00
|
|
|
sudo trace-cmd record -o logs/$DATE-trace.dat -e mac80211 -e cfg80211 su $USER -c "./run-tests.py -l logs/$DATE-run -e logs/$DATE-failed -r logs/results.txt" || errors=1
|
2013-09-28 03:36:56 -04:00
|
|
|
if [ -e logs/$DATE-failed ]; then
|
|
|
|
error=1
|
|
|
|
fi
|
|
|
|
sudo chown $USER logs/$DATE-trace.dat
|
|
|
|
cat logs/$DATE-run > logs/last-debug
|
|
|
|
./stop-wifi.sh
|
|
|
|
if [ $errors -gt 0 ]; then
|
|
|
|
tar czf /tmp/hwsim-tests-$DATE-FAILED-trace.tar.gz logs/$DATE*
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-08-24 13:33:21 -04:00
|
|
|
else
|
2013-09-28 11:19:38 -04:00
|
|
|
if ! ./start.sh; then
|
|
|
|
echo "Could not start test environment" > logs/last-debug
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-08-24 13:33:21 -04:00
|
|
|
DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
|
2013-09-28 11:31:00 -04:00
|
|
|
./run-tests.py -l logs/$DATE-run -e logs/$DATE-failed -r logs/results.txt || errors=1
|
2013-08-25 13:15:54 -04:00
|
|
|
cat logs/$DATE-run > logs/last-debug
|
2013-08-24 13:33:21 -04:00
|
|
|
./stop-wifi.sh
|
|
|
|
if [ $errors -gt 0 ]; then
|
|
|
|
tar czf /tmp/hwsim-tests-$DATE-FAILED.tar.gz logs/$DATE*
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-03-09 16:29:22 -05:00
|
|
|
fi
|
2013-09-28 11:19:38 -04:00
|
|
|
|
|
|
|
echo "ALL-PASSED"
|