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.

44 lines
1.0 KiB

6 years ago
6 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. if [ "$http_proxy" ]; then
  26. echo "SKIP: shadowsocks-libev does not support an upstream HTTP proxy"
  27. exit 0
  28. fi
  29. run_test python tests/test.py $BIN -c tests/aes.json
  30. run_test python tests/test.py $BIN -c tests/aes-gcm.json
  31. run_test python tests/test.py $BIN -c tests/aes-ctr.json
  32. run_test python tests/test.py $BIN -c tests/rc4-md5.json
  33. run_test python tests/test.py $BIN -c tests/salsa20.json
  34. run_test python tests/test.py $BIN -c tests/chacha20.json
  35. run_test python tests/test.py $BIN -c tests/chacha20-ietf.json
  36. run_test python tests/test.py $BIN -c tests/chacha20-ietf-poly1305.json
  37. exit $result