run-all.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/sh
  2. errors=0
  3. umask 0002
  4. if [ "x$1" = "xconcurrent-valgrind" ]; then
  5. ./start-p2p-concurrent.sh valgrind
  6. DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
  7. rm logs/last-debug
  8. for i in autogo discovery grpform; do
  9. ./run-tests.py -l logs/$DATE-run-$i -e logs/$DATE-failed-$i -f test_p2p_$i.py || errors=1
  10. cat logs/$DATE-run-$i >> logs/last-debug
  11. done
  12. ./stop-wifi.sh valgrind
  13. failures=`grep "ERROR SUMMARY" logs/$DATE-valgrind-* | grep -v " 0 errors" | wc -l`
  14. if [ $failures -gt 0 ]; then
  15. echo "Mark as failed due to valgrind errors"
  16. errors=1
  17. fi
  18. if [ $errors -gt 0 ]; then
  19. tar czf /tmp/hwsim-tests-$DATE-FAILED-concurrent-valgrind.tar.gz logs/$DATE*
  20. exit 1
  21. fi
  22. elif [ "x$1" = "xconcurrent" ]; then
  23. ./start-p2p-concurrent.sh
  24. DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
  25. rm logs/last-debug
  26. for i in autogo discovery grpform; do
  27. ./run-tests.py -l logs/$DATE-run-$i -e logs/$DATE-failed-$i -f test_p2p_$i.py || errors=1
  28. cat logs/$DATE-run-$i >> logs/last-debug
  29. done
  30. ./stop-wifi.sh
  31. if [ $errors -gt 0 ]; then
  32. tar czf /tmp/hwsim-tests-$DATE-FAILED-concurrent.tar.gz logs/$DATE*
  33. exit 1
  34. fi
  35. elif [ "x$1" = "xvalgrind" ]; then
  36. ./start.sh valgrind
  37. DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
  38. ./run-tests.py -l logs/$DATE-run -e logs/$DATE-failed || errors=1
  39. cat logs/$DATE-run > logs/last-debug
  40. ./stop-wifi.sh valgrind
  41. failures=`grep "ERROR SUMMARY" logs/$DATE-valgrind-* | grep -v " 0 errors" | wc -l`
  42. if [ $failures -gt 0 ]; then
  43. echo "Mark as failed due to valgrind errors"
  44. errors=1
  45. fi
  46. if [ $errors -gt 0 ]; then
  47. tar czf /tmp/hwsim-tests-$DATE-FAILED-valgrind.tar.gz logs/$DATE*
  48. exit 1
  49. fi
  50. else
  51. ./start.sh
  52. DATE=`ls -1tr logs | tail -1 | cut -f1 -d-`
  53. ./run-tests.py -l logs/$DATE-run -e logs/$DATE-failed || errors=1
  54. cat logs/$DATE-run > logs/last-debug
  55. ./stop-wifi.sh
  56. if [ $errors -gt 0 ]; then
  57. tar czf /tmp/hwsim-tests-$DATE-FAILED.tar.gz logs/$DATE*
  58. exit 1
  59. fi
  60. fi