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.

129 lines
2.8 KiB

  1. #! /bin/bash
  2. set -ex
  3. #- kvstore over socket, curl
  4. #- counter over socket, curl
  5. #- counter over grpc, curl
  6. #- counter over grpc, grpc
  7. # TODO: install everything
  8. export PATH="$GOBIN:$PATH"
  9. export TMHOME=$HOME/.tendermint_app
  10. function kvstore_over_socket(){
  11. rm -rf $TMHOME
  12. tendermint init
  13. echo "Starting kvstore_over_socket"
  14. abci-cli kvstore > /dev/null &
  15. pid_kvstore=$!
  16. tendermint node > tendermint.log &
  17. pid_tendermint=$!
  18. sleep 5
  19. echo "running test"
  20. bash kvstore_test.sh "KVStore over Socket"
  21. kill -9 $pid_kvstore $pid_tendermint
  22. }
  23. # start tendermint first
  24. function kvstore_over_socket_reorder(){
  25. rm -rf $TMHOME
  26. tendermint init
  27. echo "Starting kvstore_over_socket_reorder (ie. start tendermint first)"
  28. tendermint node > tendermint.log &
  29. pid_tendermint=$!
  30. sleep 2
  31. abci-cli kvstore > /dev/null &
  32. pid_kvstore=$!
  33. sleep 5
  34. echo "running test"
  35. bash kvstore_test.sh "KVStore over Socket"
  36. kill -9 $pid_kvstore $pid_tendermint
  37. }
  38. function counter_over_socket() {
  39. rm -rf $TMHOME
  40. tendermint init
  41. echo "Starting counter_over_socket"
  42. abci-cli counter --serial > /dev/null &
  43. pid_counter=$!
  44. tendermint node > tendermint.log &
  45. pid_tendermint=$!
  46. sleep 5
  47. echo "running test"
  48. bash counter_test.sh "Counter over Socket"
  49. kill -9 $pid_counter $pid_tendermint
  50. }
  51. function counter_over_grpc() {
  52. rm -rf $TMHOME
  53. tendermint init
  54. echo "Starting counter_over_grpc"
  55. abci-cli counter --serial --abci grpc > /dev/null &
  56. pid_counter=$!
  57. tendermint node --abci grpc > tendermint.log &
  58. pid_tendermint=$!
  59. sleep 5
  60. echo "running test"
  61. bash counter_test.sh "Counter over GRPC"
  62. kill -9 $pid_counter $pid_tendermint
  63. }
  64. function counter_over_grpc_grpc() {
  65. rm -rf $TMHOME
  66. tendermint init
  67. echo "Starting counter_over_grpc_grpc (ie. with grpc broadcast_tx)"
  68. abci-cli counter --serial --abci grpc > /dev/null &
  69. pid_counter=$!
  70. sleep 1
  71. GRPC_PORT=36656
  72. tendermint node --abci grpc --rpc.grpc_laddr tcp://localhost:$GRPC_PORT > tendermint.log &
  73. pid_tendermint=$!
  74. sleep 5
  75. echo "running test"
  76. GRPC_BROADCAST_TX=true bash counter_test.sh "Counter over GRPC via GRPC BroadcastTx"
  77. kill -9 $pid_counter $pid_tendermint
  78. }
  79. cd $GOPATH/src/github.com/tendermint/tendermint/test/app
  80. case "$1" in
  81. "kvstore_over_socket")
  82. kvstore_over_socket
  83. ;;
  84. "kvstore_over_socket_reorder")
  85. kvstore_over_socket_reorder
  86. ;;
  87. "counter_over_socket")
  88. counter_over_socket
  89. ;;
  90. "counter_over_grpc")
  91. counter_over_grpc
  92. ;;
  93. "counter_over_grpc_grpc")
  94. counter_over_grpc_grpc
  95. ;;
  96. *)
  97. echo "Running all"
  98. kvstore_over_socket
  99. echo ""
  100. kvstore_over_socket_reorder
  101. echo ""
  102. counter_over_socket
  103. echo ""
  104. counter_over_grpc
  105. echo ""
  106. counter_over_grpc_grpc
  107. esac