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.

105 lines
1.9 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. # start tendermint first
  23. function dummy_over_socket_reorder(){
  24. rm -rf $TMROOT
  25. tendermint init
  26. echo "Starting tendermint and dummy"
  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 $TMROOT
  39. tendermint init
  40. echo "Starting counter and tendermint"
  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 $TMROOT
  52. tendermint init
  53. echo "Starting counter and tendermint"
  54. counter --serial --tmsp grpc > /dev/null &
  55. pid_counter=$!
  56. tendermint node --tmsp 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. cd $GOPATH/src/github.com/tendermint/tendermint/test/app
  64. case "$1" in
  65. "dummy_over_socket")
  66. dummy_over_socket
  67. ;;
  68. "dummy_over_socket_reorder")
  69. dummy_over_socket_reorder
  70. ;;
  71. "counter_over_socket")
  72. counter_over_socket
  73. ;;
  74. "counter_over_grpc")
  75. counter_over_grpc
  76. ;;
  77. *)
  78. echo "Running all"
  79. dummy_over_socket
  80. echo ""
  81. dummy_over_socket_reorder
  82. echo ""
  83. counter_over_socket
  84. echo ""
  85. counter_over_grpc
  86. esac