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.

127 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 test/app/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 test/app/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 test/app/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 test/app/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 test/app/counter_test.sh "Counter over GRPC via GRPC BroadcastTx"
  77. kill -9 $pid_counter $pid_tendermint
  78. }
  79. case "$1" in
  80. "kvstore_over_socket")
  81. kvstore_over_socket
  82. ;;
  83. "kvstore_over_socket_reorder")
  84. kvstore_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. kvstore_over_socket
  98. echo ""
  99. kvstore_over_socket_reorder
  100. echo ""
  101. counter_over_socket
  102. echo ""
  103. counter_over_grpc
  104. echo ""
  105. counter_over_grpc_grpc
  106. esac