docker-local-tester.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/usr/bin/env bash
  2. <<COMMENT
  3. # to run with different Go version
  4. # requires prebuilt Docker image
  5. # GO_VERSION=1.10 make build-docker-functional-tester -f ./hack/scripts-dev/Makefile
  6. GO_VERSION=1.10 ./scripts/docker-local-tester.sh
  7. # to run only 1 tester round
  8. LIMIT=1 ./scripts/docker-local-tester.sh
  9. # to run long-running tests with no limit
  10. LIMIT=1 ./scripts/docker-local-tester.sh
  11. # to run only 1 tester round with election runner and others
  12. # default is STRESSER="keys,lease"
  13. LIMIT=1 \
  14. STRESSER="keys,lease,election-runner,watch-runner,lock-racer-runner,lease-runner" \
  15. ./scripts/docker-local-tester.sh
  16. # TODO: make stresser QPS configurable
  17. COMMENT
  18. if ! [[ "${0}" =~ "scripts/docker-local-tester.sh" ]]; then
  19. echo "must be run from tools/functional-tester"
  20. exit 255
  21. fi
  22. if [[ -z "${GO_VERSION}" ]]; then
  23. GO_VERSION=1.10
  24. fi
  25. echo "Running with GO_VERSION:" ${GO_VERSION}
  26. if [[ "${LIMIT}" ]]; then
  27. LIMIT_FLAG="--limit ${LIMIT}"
  28. echo "Running with:" ${LIMIT_FLAG}
  29. else
  30. echo "Running with no limit"
  31. fi
  32. if [[ "${STRESSER}" ]]; then
  33. STRESSER_FLAG="--stresser ${STRESSER}"
  34. else
  35. STRESSER_FLAG="--stresser keys,lease"
  36. fi
  37. echo "Running with:" ${STRESSER_FLAG}
  38. docker run \
  39. --rm \
  40. --net=host \
  41. --name tester \
  42. gcr.io/etcd-development/etcd-functional-tester:go${GO_VERSION} \
  43. /bin/bash -c "/etcd-tester \
  44. --agent-endpoints '127.0.0.1:19027,127.0.0.1:29027,127.0.0.1:39027' \
  45. --client-ports 1379,2379,3379 \
  46. --advertise-client-ports 13790,23790,33790 \
  47. --peer-ports 1380,2380,3380 \
  48. --advertise-peer-ports 13800,23800,33800 \
  49. ${LIMIT_FLAG} \
  50. --etcd-runner /etcd-runner \
  51. --stress-qps=2500 \
  52. --stress-key-txn-count 100 \
  53. --stress-key-txn-ops 10 \
  54. ${STRESSER_FLAG} \
  55. --exit-on-failure"