2013-03-09 20:40:31 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-03-09 22:29:22 +01:00
|
|
|
errors=0
|
2013-03-30 10:11:55 +01:00
|
|
|
umask 0002
|
2013-08-24 19:33:21 +02:00
|
|
|
|
2013-10-30 14:55:58 +01:00
|
|
|
if [ -z "$LOGDIR" ]; then
|
|
|
|
LOGDIR=logs
|
|
|
|
fi
|
|
|
|
|
2013-10-27 00:05:45 +02:00
|
|
|
if [ -z "$DBFILE" ]; then
|
|
|
|
DB=""
|
|
|
|
else
|
|
|
|
DB="-S $DBFILE"
|
|
|
|
if [ -n "$BUILD" ]; then
|
|
|
|
DB="$DB -b $BUILD"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-08-24 19:33:21 +02:00
|
|
|
if [ "x$1" = "xconcurrent-valgrind" ]; then
|
2013-09-29 15:37:25 +02:00
|
|
|
if ! ./start.sh concurrent valgrind; then
|
2013-10-30 14:55:58 +01:00
|
|
|
echo "Could not start test environment" > $LOGDIR/last-debug
|
2013-09-28 17:19:38 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2013-10-30 14:55:58 +01:00
|
|
|
DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
|
|
|
|
rm $LOGDIR/last-debug
|
2013-08-24 19:33:21 +02:00
|
|
|
for i in autogo discovery grpform; do
|
2013-10-30 18:28:22 +01:00
|
|
|
./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i || errors=1
|
2013-10-30 14:55:58 +01:00
|
|
|
cat $LOGDIR/$DATE-run-$i >> $LOGDIR/last-debug
|
2013-08-24 19:33:21 +02:00
|
|
|
done
|
2013-08-26 10:28:32 +02:00
|
|
|
./stop-wifi.sh
|
2013-10-30 14:55:58 +01:00
|
|
|
failures=`grep "ERROR SUMMARY" $LOGDIR/$DATE-valgrind-* | grep -v " 0 errors" | wc -l`
|
2013-08-24 19:33:21 +02:00
|
|
|
if [ $failures -gt 0 ]; then
|
|
|
|
echo "Mark as failed due to valgrind errors"
|
|
|
|
errors=1
|
|
|
|
fi
|
|
|
|
if [ $errors -gt 0 ]; then
|
2013-10-30 14:55:58 +01:00
|
|
|
tar czf /tmp/hwsim-tests-$DATE-FAILED-concurrent-valgrind.tar.gz $LOGDIR/$DATE*
|
2013-08-24 19:33:21 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
elif [ "x$1" = "xconcurrent" ]; then
|
2013-09-29 15:37:25 +02:00
|
|
|
if ! ./start.sh concurrent; then
|
2013-10-30 14:55:58 +01:00
|
|
|
echo "Could not start test environment" > $LOGDIR/last-debug
|
2013-09-28 17:19:38 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2013-10-30 14:55:58 +01:00
|
|
|
DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
|
|
|
|
rm $LOGDIR/last-debug
|
2013-08-24 19:33:21 +02:00
|
|
|
for i in autogo discovery grpform; do
|
2013-10-30 18:28:22 +01:00
|
|
|
./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i || errors=1
|
2013-10-30 14:55:58 +01:00
|
|
|
cat $LOGDIR/$DATE-run-$i >> $LOGDIR/last-debug
|
2013-08-24 19:33:21 +02:00
|
|
|
done
|
|
|
|
./stop-wifi.sh
|
|
|
|
if [ $errors -gt 0 ]; then
|
2013-10-30 14:55:58 +01:00
|
|
|
tar czf /tmp/hwsim-tests-$DATE-FAILED-concurrent.tar.gz $LOGDIR/$DATE*
|
2013-08-24 19:33:21 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
elif [ "x$1" = "xvalgrind" ]; then
|
2013-09-28 17:19:38 +02:00
|
|
|
if ! ./start.sh valgrind; then
|
2013-10-30 14:55:58 +01:00
|
|
|
echo "Could not start test environment" > $LOGDIR/last-debug
|
2013-09-28 17:19:38 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2013-10-30 14:55:58 +01:00
|
|
|
DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
|
|
|
|
./run-tests.py -l $LOGDIR/$DATE-run $DB -e $LOGDIR/$DATE-failed -r $LOGDIR/results.txt || errors=1
|
|
|
|
cat $LOGDIR/$DATE-run > $LOGDIR/last-debug
|
2013-08-26 10:28:32 +02:00
|
|
|
./stop-wifi.sh
|
2013-10-30 14:55:58 +01:00
|
|
|
failures=`grep "ERROR SUMMARY" $LOGDIR/$DATE-valgrind-* | grep -v " 0 errors" | wc -l`
|
2013-08-24 19:33:21 +02:00
|
|
|
if [ $failures -gt 0 ]; then
|
|
|
|
echo "Mark as failed due to valgrind errors"
|
|
|
|
errors=1
|
|
|
|
fi
|
|
|
|
if [ $errors -gt 0 ]; then
|
2013-10-30 14:55:58 +01:00
|
|
|
tar czf /tmp/hwsim-tests-$DATE-FAILED-valgrind.tar.gz $LOGDIR/$DATE*
|
2013-08-24 19:33:21 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2013-09-28 09:36:56 +02:00
|
|
|
elif [ "x$1" = "xtrace" ]; then
|
2013-09-28 17:19:38 +02:00
|
|
|
if ! ./start.sh trace; then
|
2013-10-30 14:55:58 +01:00
|
|
|
echo "Could not start test environment" > $LOGDIR/last-debug
|
2013-09-28 17:19:38 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2013-10-30 14:55:58 +01:00
|
|
|
DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
|
|
|
|
sudo trace-cmd record -o $LOGDIR/$DATE-trace.dat -e mac80211 -e cfg80211 su $USER -c "./run-tests.py -l $LOGDIR/$DATE-run $DB -e $LOGDIR/$DATE-failed -r $LOGDIR/results.txt" || errors=1
|
|
|
|
if [ -e $LOGDIR/$DATE-failed ]; then
|
2013-09-28 09:36:56 +02:00
|
|
|
error=1
|
|
|
|
fi
|
2013-10-30 14:55:58 +01:00
|
|
|
sudo chown $USER $LOGDIR/$DATE-trace.dat
|
|
|
|
cat $LOGDIR/$DATE-run > $LOGDIR/last-debug
|
2013-09-28 09:36:56 +02:00
|
|
|
./stop-wifi.sh
|
|
|
|
if [ $errors -gt 0 ]; then
|
2013-10-30 14:55:58 +01:00
|
|
|
tar czf /tmp/hwsim-tests-$DATE-FAILED-trace.tar.gz $LOGDIR/$DATE*
|
2013-09-28 09:36:56 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2013-08-24 19:33:21 +02:00
|
|
|
else
|
2013-09-28 17:19:38 +02:00
|
|
|
if ! ./start.sh; then
|
2013-10-30 14:55:58 +01:00
|
|
|
echo "Could not start test environment" > $LOGDIR/last-debug
|
2013-09-28 17:19:38 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2013-10-30 14:55:58 +01:00
|
|
|
DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
|
|
|
|
./run-tests.py -l $LOGDIR/$DATE-run $DB -e $LOGDIR/$DATE-failed -r $LOGDIR/results.txt || errors=1
|
|
|
|
cat $LOGDIR/$DATE-run > $LOGDIR/last-debug
|
2013-08-24 19:33:21 +02:00
|
|
|
./stop-wifi.sh
|
|
|
|
if [ $errors -gt 0 ]; then
|
2013-10-30 14:55:58 +01:00
|
|
|
tar czf /tmp/hwsim-tests-$DATE-FAILED.tar.gz $LOGDIR/$DATE*
|
2013-08-24 19:33:21 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2013-03-09 22:29:22 +01:00
|
|
|
fi
|
2013-09-28 17:19:38 +02:00
|
|
|
|
|
|
|
echo "ALL-PASSED"
|