-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9323 from gyuho/functional-tester-guide
*: clean up functional tester guide with local cluster, docker container
- Loading branch information
Showing
12 changed files
with
147 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env bash | ||
|
||
<<COMMENT | ||
# run 3 agents for 3-node local etcd cluster | ||
./scripts/docker-local-agent.sh 1 | ||
./scripts/docker-local-agent.sh 2 | ||
./scripts/docker-local-agent.sh 3 | ||
COMMENT | ||
|
||
if ! [[ "${0}" =~ "scripts/docker-local-agent.sh" ]]; then | ||
echo "must be run from tools/functional-tester" | ||
exit 255 | ||
fi | ||
|
||
if [[ -z "${GO_VERSION}" ]]; then | ||
GO_VERSION=1.9.4 | ||
fi | ||
echo "Running with GO_VERSION:" ${GO_VERSION} | ||
|
||
if [[ -z ${1} ]]; then | ||
echo "Expected second argument: 1, 2, or 3" | ||
exit 255 | ||
else | ||
case ${1} in | ||
1) ;; | ||
2) ;; | ||
3) ;; | ||
*) echo "Expected second argument 1, 2, or 3, got" \"${1}\" | ||
exit 255 ;; | ||
esac | ||
AGENT_NAME="agent-${1}" | ||
AGENT_PORT_FLAG="--port :${1}9027" | ||
FAILPOINT_ADDR_FLAG="--failpoint-addr :738${1}" | ||
fi | ||
echo "AGENT_NAME:" ${AGENT_NAME} | ||
echo "AGENT_PORT_FLAG:" ${AGENT_PORT_FLAG} | ||
echo "FAILPOINT_ADDR_FLAG:" ${FAILPOINT_ADDR_FLAG} | ||
|
||
if [[ -z "${ETCD_EXEC_PATH}" ]]; then | ||
ETCD_EXEC_PATH=/etcd | ||
elif [[ "${ETCD_EXEC_PATH}" != "/etcd-failpoints" ]]; then | ||
echo "Cannot find etcd executable:" ${ETCD_EXEC_PATH} | ||
exit 255 | ||
fi | ||
echo "ETCD_EXEC_PATH:" ${ETCD_EXEC_PATH} | ||
|
||
rm -rf `pwd`/${AGENT_NAME} && mkdir -p `pwd`/${AGENT_NAME} | ||
docker run \ | ||
--rm \ | ||
--net=host \ | ||
--name ${AGENT_NAME} \ | ||
--mount type=bind,source=`pwd`/${AGENT_NAME},destination=/${AGENT_NAME} \ | ||
gcr.io/etcd-development/etcd-functional-tester:go${GO_VERSION} \ | ||
/bin/bash -c "/etcd-agent \ | ||
--etcd-path ${ETCD_EXEC_PATH} \ | ||
--etcd-log-dir /${AGENT_NAME} \ | ||
${AGENT_PORT_FLAG} \ | ||
${FAILPOINT_ADDR_FLAG}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env bash | ||
|
||
<<COMMENT | ||
# to run with different Go version | ||
# requires prebuilt Docker image | ||
# GO_VERSION=1.9.4 make build-docker-functional-tester -f ./hack/scripts-dev/Makefile | ||
GO_VERSION=1.9.4 ./scripts/docker-local-tester.sh | ||
# to run only 1 tester round | ||
LIMIT=1 ./scripts/docker-local-tester.sh | ||
# to run long-running tests with no limit | ||
LIMIT=1 ./scripts/docker-local-tester.sh | ||
# to run only 1 tester round with election runner and others | ||
# default is STRESSER="keys,lease" | ||
LIMIT=1 \ | ||
STRESSER="keys,lease,election-runner,watch-runner,lock-racer-runner,lease-runner" \ | ||
./scripts/docker-local-tester.sh | ||
# TODO: make stresser QPS configurable | ||
COMMENT | ||
|
||
if ! [[ "${0}" =~ "scripts/docker-local-tester.sh" ]]; then | ||
echo "must be run from tools/functional-tester" | ||
exit 255 | ||
fi | ||
|
||
if [[ -z "${GO_VERSION}" ]]; then | ||
GO_VERSION=1.9.4 | ||
fi | ||
echo "Running with GO_VERSION:" ${GO_VERSION} | ||
|
||
if [[ "${LIMIT}" ]]; then | ||
LIMIT_FLAG="--limit ${LIMIT}" | ||
echo "Running with:" ${LIMIT_FLAG} | ||
else | ||
echo "Running with no limit" | ||
fi | ||
|
||
if [[ "${STRESSER}" ]]; then | ||
STRESSER_FLAG="--stresser ${STRESSER}" | ||
else | ||
STRESSER_FLAG="--stresser keys,lease" | ||
fi | ||
echo "Running with:" ${STRESSER_FLAG} | ||
|
||
docker run \ | ||
--rm \ | ||
--net=host \ | ||
--name tester \ | ||
gcr.io/etcd-development/etcd-functional-tester:go${GO_VERSION} \ | ||
/bin/bash -c "/etcd-tester \ | ||
--agent-endpoints '127.0.0.1:19027,127.0.0.1:29027,127.0.0.1:39027' \ | ||
--client-ports 1379,2379,3379 \ | ||
--advertise-client-ports 13790,23790,33790 \ | ||
--peer-ports 1380,2380,3380 \ | ||
--advertise-peer-ports 13800,23800,33800 \ | ||
${LIMIT_FLAG} \ | ||
--etcd-runner /etcd-runner \ | ||
--stress-qps=2500 \ | ||
--stress-key-txn-count 100 \ | ||
--stress-key-txn-ops 10 \ | ||
${STRESSER_FLAG} \ | ||
--exit-on-failure" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.