run-all.sh 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/bin/sh
  2. errors=0
  3. umask 0002
  4. if [ -z "$LOGDIR" ]; then
  5. LOGDIR=logs
  6. fi
  7. if [ -z "$DBFILE" ]; then
  8. DB=""
  9. else
  10. DB="-S $DBFILE"
  11. if [ -n "$BUILD" ]; then
  12. DB="$DB -b $BUILD"
  13. fi
  14. fi
  15. if [ "x$1" = "xconcurrent-valgrind" ]; then
  16. if ! ./start.sh concurrent valgrind; then
  17. echo "Could not start test environment" > $LOGDIR/last-debug
  18. exit 1
  19. fi
  20. DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
  21. rm $LOGDIR/last-debug
  22. for i in autogo discovery grpform; do
  23. ./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i || errors=1
  24. cat $LOGDIR/$DATE-run-$i >> $LOGDIR/last-debug
  25. done
  26. ./stop-wifi.sh
  27. failures=`grep "ERROR SUMMARY" $LOGDIR/$DATE-valgrind-* | grep -v " 0 errors" | wc -l`
  28. if [ $failures -gt 0 ]; then
  29. echo "Mark as failed due to valgrind errors"
  30. errors=1
  31. fi
  32. if [ $errors -gt 0 ]; then
  33. tar czf /tmp/hwsim-tests-$DATE-FAILED-concurrent-valgrind.tar.gz $LOGDIR/$DATE*
  34. exit 1
  35. fi
  36. elif [ "x$1" = "xconcurrent" ]; then
  37. if ! ./start.sh concurrent; then
  38. echo "Could not start test environment" > $LOGDIR/last-debug
  39. exit 1
  40. fi
  41. DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
  42. rm $LOGDIR/last-debug
  43. for i in autogo discovery grpform; do
  44. ./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i || errors=1
  45. cat $LOGDIR/$DATE-run-$i >> $LOGDIR/last-debug
  46. done
  47. ./stop-wifi.sh
  48. if [ $errors -gt 0 ]; then
  49. tar czf /tmp/hwsim-tests-$DATE-FAILED-concurrent.tar.gz $LOGDIR/$DATE*
  50. exit 1
  51. fi
  52. elif [ "x$1" = "xvalgrind" ]; then
  53. if ! ./start.sh valgrind; then
  54. echo "Could not start test environment" > $LOGDIR/last-debug
  55. exit 1
  56. fi
  57. DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
  58. ./run-tests.py -l $LOGDIR/$DATE-run $DB -e $LOGDIR/$DATE-failed -r $LOGDIR/results.txt || errors=1
  59. cat $LOGDIR/$DATE-run > $LOGDIR/last-debug
  60. ./stop-wifi.sh
  61. failures=`grep "ERROR SUMMARY" $LOGDIR/$DATE-valgrind-* | grep -v " 0 errors" | wc -l`
  62. if [ $failures -gt 0 ]; then
  63. echo "Mark as failed due to valgrind errors"
  64. errors=1
  65. fi
  66. if [ $errors -gt 0 ]; then
  67. tar czf /tmp/hwsim-tests-$DATE-FAILED-valgrind.tar.gz $LOGDIR/$DATE*
  68. exit 1
  69. fi
  70. elif [ "x$1" = "xtrace" ]; then
  71. if ! ./start.sh trace; then
  72. echo "Could not start test environment" > $LOGDIR/last-debug
  73. exit 1
  74. fi
  75. DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
  76. 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
  77. if [ -e $LOGDIR/$DATE-failed ]; then
  78. error=1
  79. fi
  80. sudo chown $USER $LOGDIR/$DATE-trace.dat
  81. cat $LOGDIR/$DATE-run > $LOGDIR/last-debug
  82. ./stop-wifi.sh
  83. if [ $errors -gt 0 ]; then
  84. tar czf /tmp/hwsim-tests-$DATE-FAILED-trace.tar.gz $LOGDIR/$DATE*
  85. exit 1
  86. fi
  87. else
  88. if ! ./start.sh; then
  89. echo "Could not start test environment" > $LOGDIR/last-debug
  90. exit 1
  91. fi
  92. DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
  93. ./run-tests.py -l $LOGDIR/$DATE-run $DB -e $LOGDIR/$DATE-failed -r $LOGDIR/results.txt || errors=1
  94. cat $LOGDIR/$DATE-run > $LOGDIR/last-debug
  95. ./stop-wifi.sh
  96. if [ $errors -gt 0 ]; then
  97. tar czf /tmp/hwsim-tests-$DATE-FAILED.tar.gz $LOGDIR/$DATE*
  98. exit 1
  99. fi
  100. fi
  101. echo "ALL-PASSED"