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.

82 lines
1.5 KiB

  1. #! /bin/bash
  2. set -e
  3. #- dummy over socket, curl
  4. #- counter over socket, curl
  5. #- counter over grpc, curl
  6. #- counter over grpc, grpc
  7. # TODO: install everything
  8. export TMROOT=$HOME/.tendermint_app
  9. function dummy_over_socket(){
  10. rm -rf $TMROOT
  11. tendermint init
  12. echo "Starting dummy and tendermint"
  13. dummy > /dev/null &
  14. pid_dummy=$!
  15. tendermint node > tendermint.log &
  16. pid_tendermint=$!
  17. sleep 5
  18. echo "running test"
  19. bash dummy_test.sh "Dummy over Socket"
  20. kill -9 $pid_dummy $pid_tendermint
  21. }
  22. function counter_over_socket() {
  23. rm -rf $TMROOT
  24. tendermint init
  25. echo "Starting counter and tendermint"
  26. counter --serial > /dev/null &
  27. pid_counter=$!
  28. tendermint node > tendermint.log &
  29. pid_tendermint=$!
  30. sleep 5
  31. echo "running test"
  32. bash counter_test.sh "Counter over Socket"
  33. kill -9 $pid_counter $pid_tendermint
  34. }
  35. function counter_over_grpc() {
  36. rm -rf $TMROOT
  37. tendermint init
  38. echo "Starting counter and tendermint"
  39. counter --serial --tmsp grpc > /dev/null &
  40. pid_counter=$!
  41. tendermint node --tmsp grpc > tendermint.log &
  42. pid_tendermint=$!
  43. sleep 5
  44. echo "running test"
  45. bash counter_test.sh "Counter over GRPC"
  46. kill -9 $pid_counter $pid_tendermint
  47. }
  48. cd $GOPATH/src/github.com/tendermint/tendermint/test/app
  49. case "$1" in
  50. "dummy_over_socket")
  51. dummy_over_socket
  52. ;;
  53. "counter_over_socket")
  54. counter_over_socket
  55. ;;
  56. "counter_over_grpc")
  57. counter_over_grpc
  58. ;;
  59. *)
  60. echo "Running all"
  61. dummy_over_socket
  62. echo ""
  63. counter_over_socket
  64. echo ""
  65. counter_over_grpc
  66. esac