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.

128 lines
2.5 KiB

8 years ago
8 years ago
8 years ago
8 years ago
  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 TMHOME=$HOME/.tendermint_app
  9. function dummy_over_socket(){
  10. rm -rf $TMHOME
  11. tendermint init
  12. echo "Starting dummy_over_socket"
  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. # start tendermint first
  23. function dummy_over_socket_reorder(){
  24. rm -rf $TMHOME
  25. tendermint init
  26. echo "Starting dummy_over_socket_reorder (ie. start tendermint first)"
  27. tendermint node > tendermint.log &
  28. pid_tendermint=$!
  29. sleep 2
  30. dummy > /dev/null &
  31. pid_dummy=$!
  32. sleep 5
  33. echo "running test"
  34. bash dummy_test.sh "Dummy over Socket"
  35. kill -9 $pid_dummy $pid_tendermint
  36. }
  37. function counter_over_socket() {
  38. rm -rf $TMHOME
  39. tendermint init
  40. echo "Starting counter_over_socket"
  41. counter --serial > /dev/null &
  42. pid_counter=$!
  43. tendermint node > tendermint.log &
  44. pid_tendermint=$!
  45. sleep 5
  46. echo "running test"
  47. bash counter_test.sh "Counter over Socket"
  48. kill -9 $pid_counter $pid_tendermint
  49. }
  50. function counter_over_grpc() {
  51. rm -rf $TMHOME
  52. tendermint init
  53. echo "Starting counter_over_grpc"
  54. counter --serial --abci grpc > /dev/null &
  55. pid_counter=$!
  56. tendermint node --abci grpc > tendermint.log &
  57. pid_tendermint=$!
  58. sleep 5
  59. echo "running test"
  60. bash counter_test.sh "Counter over GRPC"
  61. kill -9 $pid_counter $pid_tendermint
  62. }
  63. function counter_over_grpc_grpc() {
  64. rm -rf $TMHOME
  65. tendermint init
  66. echo "Starting counter_over_grpc_grpc (ie. with grpc broadcast_tx)"
  67. counter --serial --abci grpc > /dev/null &
  68. pid_counter=$!
  69. sleep 1
  70. GRPC_PORT=36656
  71. tendermint node --abci grpc --rpc.grpc_laddr tcp://localhost:$GRPC_PORT > tendermint.log &
  72. pid_tendermint=$!
  73. sleep 5
  74. echo "running test"
  75. GRPC_BROADCAST_TX=true bash counter_test.sh "Counter over GRPC via GRPC BroadcastTx"
  76. kill -9 $pid_counter $pid_tendermint
  77. }
  78. cd $GOPATH/src/github.com/tendermint/tendermint/test/app
  79. case "$1" in
  80. "dummy_over_socket")
  81. dummy_over_socket
  82. ;;
  83. "dummy_over_socket_reorder")
  84. dummy_over_socket_reorder
  85. ;;
  86. "counter_over_socket")
  87. counter_over_socket
  88. ;;
  89. "counter_over_grpc")
  90. counter_over_grpc
  91. ;;
  92. "counter_over_grpc_grpc")
  93. counter_over_grpc_grpc
  94. ;;
  95. *)
  96. echo "Running all"
  97. dummy_over_socket
  98. echo ""
  99. dummy_over_socket_reorder
  100. echo ""
  101. counter_over_socket
  102. echo ""
  103. counter_over_grpc
  104. echo ""
  105. counter_over_grpc_grpc
  106. esac