From 6ae9a7658a95c778dc81e44f5563796229968cbb Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Wed, 14 Feb 2018 10:41:15 -0800 Subject: [PATCH 1/2] tools/functional-tester: clean up Docker scripts Signed-off-by: Gyuho Lee --- tools/functional-tester/README.md | 30 ++++++--- tools/functional-tester/scripts/agent-1.sh | 37 ----------- tools/functional-tester/scripts/agent-2.sh | 37 ----------- tools/functional-tester/scripts/agent-3.sh | 37 ----------- .../scripts/docker-local-agent.sh | 58 +++++++++++++++++ .../scripts/docker-local-tester.sh | 65 +++++++++++++++++++ .../functional-tester/scripts/tester-limit.sh | 24 ------- .../scripts/tester-runner.sh | 25 ------- tools/functional-tester/scripts/tester.sh | 22 ------- 9 files changed, 143 insertions(+), 192 deletions(-) delete mode 100755 tools/functional-tester/scripts/agent-1.sh delete mode 100755 tools/functional-tester/scripts/agent-2.sh delete mode 100755 tools/functional-tester/scripts/agent-3.sh create mode 100755 tools/functional-tester/scripts/docker-local-agent.sh create mode 100755 tools/functional-tester/scripts/docker-local-tester.sh delete mode 100755 tools/functional-tester/scripts/tester-limit.sh delete mode 100755 tools/functional-tester/scripts/tester-runner.sh delete mode 100755 tools/functional-tester/scripts/tester.sh diff --git a/tools/functional-tester/README.md b/tools/functional-tester/README.md index 4c4ccdb20fb..c562d3dd732 100644 --- a/tools/functional-tester/README.md +++ b/tools/functional-tester/README.md @@ -4,7 +4,7 @@ etcd functional test suite tests the functionality of an etcd cluster with a foc etcd functional test suite has two components: etcd-agent and etcd-tester. etcd-agent runs on every test machines and etcd-tester is a single controller of the test. etcd-tester controls all the etcd-agent to start etcd clusters and simulate various failure cases. -## requirements +## Requirements The environment of the cluster must be stable enough, so etcd test suite can assume that most of the failures are generated by itself. @@ -18,8 +18,8 @@ etcd functional tester control the progress of the functional tests. It calls th ### Run locally -``` -$ PASSES=functional ./test +```bash +PASSES=functional ./test ``` ### Run with Docker @@ -29,8 +29,7 @@ To run locally, first build tester image: ```bash pushd ../.. -GO_VERSION=1.9.3 \ - make build-docker-functional-tester \ +make build-docker-functional-tester \ -f ./hack/scripts-dev/Makefile popd @@ -39,9 +38,20 @@ popd And run [example scripts](./scripts). ```bash -./scripts/agent-1.sh -./scripts/agent-2.sh -./scripts/agent-3.sh - -./scripts/tester-limit.sh +# 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 + +# 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 ``` diff --git a/tools/functional-tester/scripts/agent-1.sh b/tools/functional-tester/scripts/agent-1.sh deleted file mode 100755 index 5f4bb44fb52..00000000000 --- a/tools/functional-tester/scripts/agent-1.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -< Date: Wed, 14 Feb 2018 11:03:01 -0800 Subject: [PATCH 2/2] *: remove "./cmd/tools" in build commands Signed-off-by: Gyuho Lee --- Dockerfile-functional-tester | 4 ++-- hack/scripts-dev/Makefile | 2 +- tools/etcd-test-proxy/README.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile-functional-tester b/Dockerfile-functional-tester index cfd80867570..5c11d07cf8d 100644 --- a/Dockerfile-functional-tester +++ b/Dockerfile-functional-tester @@ -47,7 +47,7 @@ RUN go get -v github.com/coreos/gofail \ && cp ./bin/etcd-agent /etcd-agent \ && cp ./bin/etcd-tester /etcd-tester \ && cp ./bin/etcd-runner /etcd-runner \ - && go build -v -o /benchmark ./cmd/tools/benchmark \ - && go build -v -o /etcd-test-proxy ./cmd/tools/etcd-test-proxy \ + && go build -v -o /benchmark ./tools/benchmark \ + && go build -v -o /etcd-test-proxy ./tools/etcd-test-proxy \ && popd \ && rm -rf ${GOPATH}/src/github.com/coreos/etcd diff --git a/hack/scripts-dev/Makefile b/hack/scripts-dev/Makefile index e01ff209866..8cc5877f843 100644 --- a/hack/scripts-dev/Makefile +++ b/hack/scripts-dev/Makefile @@ -418,7 +418,7 @@ docker-dns-srv-test-certs-wildcard-run: # make build-etcd-test-proxy -f ./hack/scripts-dev/Makefile build-etcd-test-proxy: - go build -v -o ./bin/etcd-test-proxy ./cmd/tools/etcd-test-proxy + go build -v -o ./bin/etcd-test-proxy ./tools/etcd-test-proxy diff --git a/tools/etcd-test-proxy/README.md b/tools/etcd-test-proxy/README.md index e7836809d18..edeac4d11f6 100644 --- a/tools/etcd-test-proxy/README.md +++ b/tools/etcd-test-proxy/README.md @@ -20,7 +20,7 @@ $ ETCDCTL_API=3 ./bin/etcdctl --endpoints localhost:23790 put foo bar Proxy overhead per request is under 500μs ```bash -$ go build -v -o ./bin/benchmark ./cmd/tools/benchmark +$ go build -v -o ./bin/benchmark ./tools/benchmark $ ./bin/benchmark \ --endpoints localhost:2379 \