agent-2.sh 942 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env bash
  2. <<COMMENT
  3. # to run agent
  4. ./scripts/agent-2.sh
  5. # to run with failpoints
  6. ETCD_EXEC_PATH=/etcd-failpoints ./scripts/agent-2.sh
  7. COMMENT
  8. if ! [[ "$0" =~ "scripts/agent-2.sh" ]]; then
  9. echo "must be run from tools/functional-tester"
  10. exit 255
  11. fi
  12. if [ -z "${ETCD_EXEC_PATH}" ]; then
  13. ETCD_EXEC_PATH=/etcd
  14. echo "Running agent without failpoints:" ${ETCD_EXEC_PATH}
  15. elif [[ "${ETCD_EXEC_PATH}" == "/etcd-failpoints" ]]; then
  16. echo "Running agent with failpoints:" ${ETCD_EXEC_PATH}
  17. else
  18. echo "Cannot find executable:" ${ETCD_EXEC_PATH}
  19. exit 255
  20. fi
  21. rm -rf `pwd`/agent-2 && mkdir -p `pwd`/agent-2
  22. docker run \
  23. --rm \
  24. --net=host \
  25. --name agent-2 \
  26. --mount type=bind,source=`pwd`/agent-2,destination=/agent-2 \
  27. gcr.io/etcd-development/etcd-functional-tester:go1.9.3 \
  28. /bin/bash -c "/etcd-agent \
  29. --etcd-path ${ETCD_EXEC_PATH} \
  30. --etcd-log-dir /agent-2 \
  31. --port :29027 \
  32. --failpoint-addr :7382"