*: rename, clean up functional tests

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyuho Lee
2018-04-09 07:09:48 -07:00
parent b7770cd9fe
commit 85e050a120
53 changed files with 668 additions and 620 deletions

View File

@@ -0,0 +1,42 @@
#!/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 functional"
exit 255
fi
if [[ -z "${GO_VERSION}" ]]; then
GO_VERSION=1.10.1
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_ADDR_FLAG="--network tcp --address 127.0.0.1:${1}9027"
fi
echo "AGENT_NAME:" ${AGENT_NAME}
echo "AGENT_ADDR_FLAG:" ${AGENT_ADDR_FLAG}
docker run \
--rm \
--net=host \
--name ${AGENT_NAME} \
gcr.io/etcd-development/etcd-functional-tester:go${GO_VERSION} \
/bin/bash -c "./bin/etcd-agent ${AGENT_ADDR_FLAG}"

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
if ! [[ "${0}" =~ "scripts/docker-local-tester.sh" ]]; then
echo "must be run from functional"
exit 255
fi
if [[ -z "${GO_VERSION}" ]]; then
GO_VERSION=1.10.1
fi
echo "Running with GO_VERSION:" ${GO_VERSION}
docker run \
--rm \
--net=host \
--name tester \
gcr.io/etcd-development/etcd-functional-tester:go${GO_VERSION} \
/bin/bash -c "./bin/etcd-tester --config ./functional.yaml"

28
functional/scripts/genproto.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -e
if ! [[ "$0" =~ "scripts/genproto.sh" ]]; then
echo "must be run from repository root"
exit 255
fi
# for now, be conservative about what version of protoc we expect
if ! [[ $(protoc --version) =~ "3.5.1" ]]; then
echo "could not find protoc 3.5.1, is it installed + in PATH?"
exit 255
fi
echo "Installing gogo/protobuf..."
GOGOPROTO_ROOT="$GOPATH/src/github.com/gogo/protobuf"
rm -rf $GOGOPROTO_ROOT
go get -v github.com/gogo/protobuf/{proto,protoc-gen-gogo,gogoproto,protoc-gen-gofast}
go get -v golang.org/x/tools/cmd/goimports
pushd "${GOGOPROTO_ROOT}"
git reset --hard HEAD
make install
popd
printf "Generating agent\n"
protoc --gofast_out=plugins=grpc:. \
--proto_path=$GOPATH/src:$GOPATH/src/github.com/gogo/protobuf/protobuf:. \
rpcpb/*.proto;