You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
957 B

7 years ago
7 years ago
  1. #!/bin/bash
  2. result=0
  3. function run_test {
  4. printf '\e[0;36m'
  5. echo "running test: $command $@"
  6. printf '\e[0m'
  7. $command "$@"
  8. status=$?
  9. if [ $status -ne 0 ]; then
  10. printf '\e[0;31m'
  11. echo "test failed: $command $@"
  12. printf '\e[0m'
  13. echo
  14. result=1
  15. else
  16. printf '\e[0;32m'
  17. echo OK
  18. printf '\e[0m'
  19. echo
  20. fi
  21. return 0
  22. }
  23. [ -d src -a -x src/ss-local ] &&
  24. BIN="--bin src/"
  25. run_test python tests/test.py $BIN -c tests/aes.json
  26. run_test python tests/test.py $BIN -c tests/aes-gcm.json
  27. run_test python tests/test.py $BIN -c tests/aes-ctr.json
  28. run_test python tests/test.py $BIN -c tests/rc4-md5.json
  29. run_test python tests/test.py $BIN -c tests/salsa20.json
  30. run_test python tests/test.py $BIN -c tests/chacha20.json
  31. run_test python tests/test.py $BIN -c tests/chacha20-ietf.json
  32. run_test python tests/test.py $BIN -c tests/chacha20-ietf-poly1305.json
  33. exit $result