Cleanup scripts in root directory

This commit is contained in:
Marek Siarkowicz 2022-01-26 12:11:10 +01:00
parent 986a2b51f4
commit 396efd9608
23 changed files with 58 additions and 63 deletions

View File

@ -27,31 +27,31 @@ jobs:
echo "${TARGET}" echo "${TARGET}"
case "${TARGET}" in case "${TARGET}" in
linux-amd64) linux-amd64)
ARCH=amd64 PASSES='build' ./test.sh ARCH=amd64 PASSES='build' ./scripts/test.sh
;; ;;
linux-386) linux-386)
ARCH=386 PASSES='build' ./test.sh ARCH=386 PASSES='build' ./scripts/test.sh
;; ;;
darwin-amd64) darwin-amd64)
ARCH=amd64 GOOS=darwin GO_BUILD_FLAGS='-v -mod=readonly' ./build.sh ARCH=amd64 GOOS=darwin GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
;; ;;
darwin-arm64) darwin-arm64)
ARCH=arm64 GOOS=darwin GO_BUILD_FLAGS='-v -mod=readonly' ./build.sh ARCH=arm64 GOOS=darwin GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
;; ;;
windows-amd64) windows-amd64)
ARCH=amd64 GOOS=windows GO_BUILD_FLAGS='-v -mod=readonly' ./build.sh ARCH=amd64 GOOS=windows GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
;; ;;
linux-arm) linux-arm)
ARCH=arm GO_BUILD_FLAGS='-v -mod=readonly' ./build.sh ARCH=arm GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
;; ;;
linux-arm64) linux-arm64)
ARCH=arm64 GO_BUILD_FLAGS='-v -mod=readonly' ./build.sh ARCH=arm64 GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
;; ;;
linux-ppc64le) linux-ppc64le)
ARCH=ppc64le GO_BUILD_FLAGS='-v -mod=readonly' ./build.sh ARCH=ppc64le GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
;; ;;
linux-s390x) linux-s390x)
ARCH=s390x GO_BUILD_FLAGS='-v -mod=readonly' ./build.sh ARCH=s390x GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
;; ;;
*) *)
echo "Failed to find target" echo "Failed to find target"

View File

@ -21,11 +21,11 @@ jobs:
echo "${TARGET}" echo "${TARGET}"
case "${TARGET}" in case "${TARGET}" in
linux-amd64-e2e) linux-amd64-e2e)
PASSES='build release e2e' MANUAL_VER=v3.5.0 CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./test.sh 2>&1 | tee test.log PASSES='build release e2e' MANUAL_VER=v3.5.0 CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log ! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
;; ;;
linux-386-e2e) linux-386-e2e)
GOARCH=386 PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./test.sh 2>&1 | tee test.log GOARCH=386 PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log ! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
;; ;;
*) *)

View File

@ -20,7 +20,7 @@ jobs:
echo "${TARGET}" echo "${TARGET}"
case "${TARGET}" in case "${TARGET}" in
linux-amd64-functional) linux-amd64-functional)
GO_BUILD_FLAGS='-v -mod=readonly' ./build.sh && GOARCH=amd64 PASSES='functional' ./test.sh GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh && GOARCH=amd64 PASSES='functional' ./scripts/test.sh
;; ;;
*) *)
echo "Failed to find target" echo "Failed to find target"

View File

@ -21,11 +21,11 @@ jobs:
echo "${TARGET}" echo "${TARGET}"
case "${TARGET}" in case "${TARGET}" in
linux-amd64-grpcproxy-integration) linux-amd64-grpcproxy-integration)
PASSES='build grpcproxy_integration' CPU='4' COVER='false' RACE='true' ./test.sh 2>&1 | tee test.log PASSES='build grpcproxy_integration' CPU='4' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log ! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
;; ;;
linux-amd64-grpcproxy-e2e) linux-amd64-grpcproxy-e2e)
PASSES='build grpcproxy_e2e' CPU='4' COVER='false' RACE='true' ./test.sh 2>&1 | tee test.log PASSES='build grpcproxy_e2e' CPU='4' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log ! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
;; ;;
*) *)

View File

@ -20,7 +20,7 @@ jobs:
echo "${TARGET}" echo "${TARGET}"
case "${TARGET}" in case "${TARGET}" in
linux-amd64-fmt) linux-amd64-fmt)
GOARCH=amd64 PASSES='fmt bom dep' ./test.sh GOARCH=amd64 PASSES='fmt bom dep' ./scripts/test.sh
;; ;;
*) *)
echo "Failed to find target" echo "Failed to find target"

View File

@ -25,19 +25,19 @@ jobs:
export JUNIT_REPORT_DIR=$(realpath ${TARGET}) export JUNIT_REPORT_DIR=$(realpath ${TARGET})
case "${TARGET}" in case "${TARGET}" in
linux-amd64-integration-1-cpu) linux-amd64-integration-1-cpu)
GOARCH=amd64 CPU=1 PASSES='integration' RACE='false' ./test.sh GOARCH=amd64 CPU=1 PASSES='integration' RACE='false' ./scripts/test.sh
;; ;;
linux-amd64-integration-2-cpu) linux-amd64-integration-2-cpu)
GOARCH=amd64 CPU=2 PASSES='integration' RACE='false' ./test.sh GOARCH=amd64 CPU=2 PASSES='integration' RACE='false' ./scripts/test.sh
;; ;;
linux-amd64-integration-4-cpu) linux-amd64-integration-4-cpu)
GOARCH=amd64 CPU=4 PASSES='integration' RACE='false' ./test.sh GOARCH=amd64 CPU=4 PASSES='integration' RACE='false' ./scripts/test.sh
;; ;;
linux-amd64-unit-4-cpu-race) linux-amd64-unit-4-cpu-race)
GOARCH=amd64 PASSES='unit' RACE='true' CPU='4' ./test.sh -p=2 GOARCH=amd64 PASSES='unit' RACE='true' CPU='4' ./scripts/test.sh -p=2
;; ;;
linux-386-unit-1-cpu) linux-386-unit-1-cpu)
GOARCH=386 PASSES='unit' RACE='false' CPU='1' ./test.sh -p=4 GOARCH=386 PASSES='unit' RACE='false' CPU='1' ./scripts/test.sh -p=4
;; ;;
*) *)
echo "Failed to find target" echo "Failed to find target"

View File

@ -22,7 +22,7 @@ XARGS += rm -r
.PHONY: build .PHONY: build
build: build:
GO_BUILD_FLAGS="-v" ./build.sh GO_BUILD_FLAGS="-v" ./scripts/build.sh
./bin/etcd --version ./bin/etcd --version
./bin/etcdctl version ./bin/etcdctl version
./bin/etcdutl version ./bin/etcdutl version
@ -96,16 +96,16 @@ pull-docker-test:
test: test:
$(info TEST_OPTS: $(TEST_OPTS)) $(info TEST_OPTS: $(TEST_OPTS))
$(info log-file: test-$(TEST_SUFFIX).log) $(info log-file: test-$(TEST_SUFFIX).log)
$(TEST_OPTS) ./test.sh 2>&1 | tee test-$(TEST_SUFFIX).log $(TEST_OPTS) ./scripts/test.sh 2>&1 | tee test-$(TEST_SUFFIX).log
! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test-$(TEST_SUFFIX).log ! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test-$(TEST_SUFFIX).log
test-smoke: test-smoke:
$(info log-file: test-$(TEST_SUFFIX).log) $(info log-file: test-$(TEST_SUFFIX).log)
PASSES="fmt build unit" ./test.sh 2<&1 | tee test-$(TEST_SUFFIX).log PASSES="fmt build unit" ./scripts/test.sh 2<&1 | tee test-$(TEST_SUFFIX).log
test-full: test-full:
$(info log-file: test-$(TEST_SUFFIX).log) $(info log-file: test-$(TEST_SUFFIX).log)
PASSES="fmt build release unit integration functional e2e grpcproxy" ./test.sh 2<&1 | tee test-$(TEST_SUFFIX).log PASSES="fmt build release unit integration functional e2e grpcproxy" ./scripts/test.sh 2<&1 | tee test-$(TEST_SUFFIX).log
ensure-docker-test-image-exists: ensure-docker-test-image-exists:
make push-docker-test || echo "WARNING: Container Image not found in registry, building locally"; make build-docker-test make push-docker-test || echo "WARNING: Container Image not found in registry, building locally"; make build-docker-test
@ -122,7 +122,7 @@ docker-test: ensure-docker-test-image-exists
$(TMP_DIR_MOUNT_FLAG) \ $(TMP_DIR_MOUNT_FLAG) \
--mount type=bind,source=`pwd`,destination=/go/src/go.etcd.io/etcd \ --mount type=bind,source=`pwd`,destination=/go/src/go.etcd.io/etcd \
gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \ gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
/bin/bash -c "$(TEST_OPTS) ./test.sh 2>&1 | tee test-$(TEST_SUFFIX).log" /bin/bash -c "$(TEST_OPTS) ./scripts/test.sh 2>&1 | tee test-$(TEST_SUFFIX).log"
! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test-$(TEST_SUFFIX).log ! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test-$(TEST_SUFFIX).log
docker-test-coverage: docker-test-coverage:

6
build
View File

@ -1,6 +0,0 @@
#!/usr/bin/env bash
echo -e "\\e[91mDEPRECATED!!! Use build.sh script instead.\\e[0m\\n"
sleep 1
source ./build.sh

View File

@ -87,7 +87,7 @@ function main {
export GOARCH=${TARGET_ARCH} export GOARCH=${TARGET_ARCH}
pushd etcd >/dev/null pushd etcd >/dev/null
GO_LDFLAGS="-s" ./build.sh GO_LDFLAGS="-s" ./scripts/build.sh
popd >/dev/null popd >/dev/null
TARGET="etcd-${VER}-${GOOS}-${GOARCH}" TARGET="etcd-${VER}-${GOOS}-${GOARCH}"

View File

@ -22,7 +22,7 @@ ETCD_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
pushd "${ETCD_ROOT}" >/dev/null pushd "${ETCD_ROOT}" >/dev/null
log_callout "Building etcd binary..." log_callout "Building etcd binary..."
./scripts/build-binary "${VERSION}" ./scripts/build-binary.sh "${VERSION}"
for TARGET_ARCH in "amd64" "arm64" "ppc64le" "s390x"; do for TARGET_ARCH in "amd64" "arm64" "ppc64le" "s390x"; do
log_callout "Building ${TARGET_ARCH} docker image..." log_callout "Building ${TARGET_ARCH} docker image..."

View File

@ -8,7 +8,7 @@ set -o pipefail
LOG_FILE=${1:-test-coverage.log} LOG_FILE=${1:-test-coverage.log}
# We collect the coverage # We collect the coverage
COVERDIR=covdir PASSES='build build_cov cov' ./test.sh 2>&1 | tee "${LOG_FILE}" COVERDIR=covdir PASSES='build build_cov cov' ./scripts/test.sh 2>&1 | tee "${LOG_FILE}"
test_success="$?" test_success="$?"
# We try to upload whatever we have: # We try to upload whatever we have:

View File

@ -140,7 +140,8 @@ main() {
if [[ -n $(git status -s) ]]; then if [[ -n $(git status -s) ]]; then
log_callout "Committing mods & api/version/version.go update." log_callout "Committing mods & api/version/version.go update."
run git add api/version/version.go run git add api/version/version.go
run git add $(find -name go.mod ! -path './release/*'| xargs) # shellcheck disable=SC2038,SC2046
run git add $(find . -name go.mod ! -path './release/*'| xargs)
run git diff --staged | cat run git diff --staged | cat
run git commit -m "version: bump up to ${VERSION}" run git commit -m "version: bump up to ${VERSION}"
run git diff --staged | cat run git diff --staged | cat
@ -162,6 +163,7 @@ main() {
fi fi
# Verify the latest commit has the version tag # Verify the latest commit has the version tag
# shellcheck disable=SC2155
local tag="$(git describe --exact-match HEAD)" local tag="$(git describe --exact-match HEAD)"
if [ "${tag}" != "${RELEASE_VERSION}" ]; then if [ "${tag}" != "${RELEASE_VERSION}" ]; then
log_error "Error: Expected HEAD to be tagged with ${RELEASE_VERSION}, but 'git describe --exact-match HEAD' reported: ${tag}" log_error "Error: Expected HEAD to be tagged with ${RELEASE_VERSION}, but 'git describe --exact-match HEAD' reported: ${tag}"
@ -169,6 +171,7 @@ main() {
fi fi
# Verify the version tag is on the right branch # Verify the version tag is on the right branch
# shellcheck disable=SC2155
local branch=$(git for-each-ref --contains "${RELEASE_VERSION}" --format="%(refname)" 'refs/heads' | cut -d '/' -f 3) local branch=$(git for-each-ref --contains "${RELEASE_VERSION}" --format="%(refname)" 'refs/heads' | cut -d '/' -f 3)
if [ "${branch}" != "${BRANCH}" ]; then if [ "${branch}" != "${BRANCH}" ]; then
log_error "Error: Git tag ${RELEASE_VERSION} should be on branch '${BRANCH}' but is on '${branch}'" log_error "Error: Git tag ${RELEASE_VERSION} should be on branch '${BRANCH}' but is on '${branch}'"
@ -198,6 +201,7 @@ main() {
# Generate SHA256SUMS # Generate SHA256SUMS
log_callout "Generating sha256sums of release artifacts." log_callout "Generating sha256sums of release artifacts."
pushd ./release pushd ./release
# shellcheck disable=SC2010
ls . | grep -E '\.tar.gz$|\.zip$' | xargs shasum -a 256 > ./SHA256SUMS ls . | grep -E '\.tar.gz$|\.zip$' | xargs shasum -a 256 > ./SHA256SUMS
popd popd
if [ -s ./release/SHA256SUMS ]; then if [ -s ./release/SHA256SUMS ]; then
@ -263,6 +267,7 @@ main() {
# Check image versions # Check image versions
for IMAGE in "quay.io/coreos/etcd:${RELEASE_VERSION}" "gcr.io/etcd-development/etcd:${RELEASE_VERSION}"; do for IMAGE in "quay.io/coreos/etcd:${RELEASE_VERSION}" "gcr.io/etcd-development/etcd:${RELEASE_VERSION}"; do
# shellcheck disable=SC2155
local image_version=$(docker run --rm "${IMAGE}" etcd --version | grep "etcd Version" | awk -F: '{print $2}' | tr -d '[:space:]') local image_version=$(docker run --rm "${IMAGE}" etcd --version | grep "etcd Version" | awk -F: '{print $2}' | tr -d '[:space:]')
if [ "${image_version}" != "${VERSION}" ]; then if [ "${image_version}" != "${VERSION}" ]; then
log_error "Check failed: etcd --version output for ${IMAGE} is incorrect: ${image_version}" log_error "Check failed: etcd --version output for ${IMAGE} is incorrect: ${image_version}"
@ -271,9 +276,11 @@ main() {
done done
# Check gsutil binary versions # Check gsutil binary versions
# shellcheck disable=SC2155
local BINARY_TGZ="etcd-${RELEASE_VERSION}-$(go env GOOS)-amd64.tar.gz" local BINARY_TGZ="etcd-${RELEASE_VERSION}-$(go env GOOS)-amd64.tar.gz"
gsutil cp "gs://etcd/${RELEASE_VERSION}/${BINARY_TGZ}" downloads gsutil cp "gs://etcd/${RELEASE_VERSION}/${BINARY_TGZ}" downloads
tar -zx -C downloads -f "downloads/${BINARY_TGZ}" tar -zx -C downloads -f "downloads/${BINARY_TGZ}"
# shellcheck disable=SC2155
local binary_version=$("./downloads/etcd-${RELEASE_VERSION}-$(go env GOOS)-amd64/etcd" --version | grep "etcd Version" | awk -F: '{print $2}' | tr -d '[:space:]') local binary_version=$("./downloads/etcd-${RELEASE_VERSION}-$(go env GOOS)-amd64/etcd" --version | grep "etcd Version" | awk -F: '{print $2}' | tr -d '[:space:]')
if [ "${binary_version}" != "${VERSION}" ]; then if [ "${binary_version}" != "${VERSION}" ]; then
log_error "Check failed: etcd --version output for ${BINARY_TGZ} from gs://etcd/${RELEASE_VERSION} is incorrect: ${binary_version}" log_error "Check failed: etcd --version output for ${BINARY_TGZ} from gs://etcd/${RELEASE_VERSION} is incorrect: ${binary_version}"

View File

@ -1,35 +1,35 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Run all etcd tests # Run all etcd tests
# ./test.sh # ./scripts/test.sh
# ./test.sh -v # ./scripts/test.sh -v
# #
# #
# Run specified test pass # Run specified test pass
# #
# $ PASSES=unit ./test.sh # $ PASSES=unit ./scripts/test.sh
# $ PASSES=integration ./test.sh # $ PASSES=integration ./scripts/test.sh
# #
# #
# Run tests for one package # Run tests for one package
# Each pass has different default timeout, if you just run tests in one package or 1 test case then you can set TIMEOUT # Each pass has different default timeout, if you just run tests in one package or 1 test case then you can set TIMEOUT
# flag for different expectation # flag for different expectation
# #
# $ PASSES=unit PKG=./wal TIMEOUT=1m ./test.sh # $ PASSES=unit PKG=./wal TIMEOUT=1m ./scripts/test.sh
# $ PASSES=integration PKG=./clientv3 TIMEOUT=1m ./test.sh # $ PASSES=integration PKG=./clientv3 TIMEOUT=1m ./scripts/test.sh
# #
# Run specified unit tests in one package # Run specified unit tests in one package
# To run all the tests with prefix of "TestNew", set "TESTCASE=TestNew "; # To run all the tests with prefix of "TestNew", set "TESTCASE=TestNew ";
# to run only "TestNew", set "TESTCASE="\bTestNew\b"" # to run only "TestNew", set "TESTCASE="\bTestNew\b""
# #
# $ PASSES=unit PKG=./wal TESTCASE=TestNew TIMEOUT=1m ./test.sh # $ PASSES=unit PKG=./wal TESTCASE=TestNew TIMEOUT=1m ./scripts/test.sh
# $ PASSES=unit PKG=./wal TESTCASE="\bTestNew\b" TIMEOUT=1m ./test.sh # $ PASSES=unit PKG=./wal TESTCASE="\bTestNew\b" TIMEOUT=1m ./scripts/test.sh
# $ PASSES=integration PKG=./client/integration TESTCASE="\bTestV2NoRetryEOF\b" TIMEOUT=1m ./test.sh # $ PASSES=integration PKG=./client/integration TESTCASE="\bTestV2NoRetryEOF\b" TIMEOUT=1m ./scripts/test.sh
# #
# #
# Run code coverage # Run code coverage
# COVERDIR must either be a absolute path or a relative path to the etcd root # COVERDIR must either be a absolute path or a relative path to the etcd root
# $ COVERDIR=coverage PASSES="build build_cov cov" ./test.sh # $ COVERDIR=coverage PASSES="build build_cov cov" ./scripts/test.sh
# $ go tool cover -html ./coverage/cover.out # $ go tool cover -html ./coverage/cover.out
set -e set -e
@ -43,7 +43,7 @@ set -o pipefail
export GOFLAGS=-mod=readonly export GOFLAGS=-mod=readonly
source ./scripts/test_lib.sh source ./scripts/test_lib.sh
source ./build.sh source ./scripts/build.sh
PASSES=${PASSES:-"fmt bom dep build unit"} PASSES=${PASSES:-"fmt bom dep build unit"}
PKG=${PKG:-} PKG=${PKG:-}
@ -299,7 +299,7 @@ function cov_pass {
fi fi
if [ ! -f "bin/etcd_test" ]; then if [ ! -f "bin/etcd_test" ]; then
log_error "etcd_test binary not found. Call: PASSES='build_cov' ./test.sh" log_error "etcd_test binary not found. Call: PASSES='build_cov' ./scripts/test.sh"
return 255 return 255
fi fi
@ -400,7 +400,7 @@ function fmt_pass {
function shellcheck_pass { function shellcheck_pass {
if tool_exists "shellcheck" "https://github.com/koalaman/shellcheck#installing"; then if tool_exists "shellcheck" "https://github.com/koalaman/shellcheck#installing"; then
generic_checker run shellcheck -fgcc build test scripts/*.sh ./*.sh generic_checker run shellcheck -fgcc scripts/*.sh
fi fi
} }
@ -410,7 +410,7 @@ function shellws_pass {
local files local files
files=$(find ./ -name '*.sh' -print0 | xargs -0 ) files=$(find ./ -name '*.sh' -print0 | xargs -0 )
# shellcheck disable=SC2206 # shellcheck disable=SC2206
files=( ${files[@]} "./scripts/build-binary" "./scripts/build-docker" "./scripts/release" ) files=( ${files[@]} "./scripts/build-binary.sh" "./scripts/build-docker.sh" "./scripts/release.sh" )
log_cmd "grep -E -n $'^ *${TAB}' ${files[*]}" log_cmd "grep -E -n $'^ *${TAB}' ${files[*]}"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
if grep -E -n $'^ *${TAB}' "${files[@]}" | sed $'s|${TAB}|[\\\\tab]|g'; then if grep -E -n $'^ *${TAB}' "${files[@]}" | sed $'s|${TAB}|[\\\\tab]|g'; then

View File

@ -71,7 +71,7 @@ function relativePath {
local commonPart=$source local commonPart=$source
local result="" local result=""
while [[ "${target#$commonPart}" == "${target}" ]]; do while [[ "${target#"$commonPart"}" == "${target}" ]]; do
# no match, means that candidate common part is not correct # no match, means that candidate common part is not correct
# go up one level (reduce common part) # go up one level (reduce common part)
commonPart="$(dirname "$commonPart")" commonPart="$(dirname "$commonPart")"
@ -90,7 +90,7 @@ function relativePath {
# since we now have identified the common part, # since we now have identified the common part,
# compute the non-common part # compute the non-common part
local forwardPart="${target#$commonPart}" local forwardPart="${target#"$commonPart"}"
# and now stick all parts together # and now stick all parts together
if [[ -n $result ]] && [[ -n $forwardPart ]]; then if [[ -n $result ]] && [[ -n $forwardPart ]]; then

6
test
View File

@ -1,6 +0,0 @@
#!/usr/bin/env bash
echo -e "\\e[91mDEPRECATED!!! Use test.sh script instead.\\e[0m\\n"
sleep 1
source ./test.sh

View File

@ -26,11 +26,11 @@ ADD ./tests/functional/functional.yaml /functional.yaml
RUN go get -v go.etcd.io/gofail \ RUN go get -v go.etcd.io/gofail \
&& pushd ${GOPATH}/src/go.etcd.io/etcd \ && pushd ${GOPATH}/src/go.etcd.io/etcd \
&& GO_BUILD_FLAGS="-v" ./build.sh \ && GO_BUILD_FLAGS="-v" ./scripts/build.sh \
&& mkdir -p /bin \ && mkdir -p /bin \
&& cp ./bin/etcd /bin/etcd \ && cp ./bin/etcd /bin/etcd \
&& cp ./bin/etcdctl /bin/etcdctl \ && cp ./bin/etcdctl /bin/etcdctl \
&& GO_BUILD_FLAGS="-v" FAILPOINTS=1 ./build.sh \ && GO_BUILD_FLAGS="-v" FAILPOINTS=1 ./scripts/build.sh \
&& cp ./bin/etcd /bin/etcd-failpoints \ && cp ./bin/etcd /bin/etcd-failpoints \
&& ./tests/functional/build \ && ./tests/functional/build \
&& cp ./bin/etcd-agent /bin/etcd-agent \ && cp ./bin/etcd-agent /bin/etcd-agent \

View File

@ -39,7 +39,7 @@ Proxy layer that simulates various network conditions.
Test locally Test locally
```bash ```bash
$ ./build.sh $ ./scripts/build.sh
$ ./bin/etcd $ ./bin/etcd
$ make build-functional $ make build-functional
@ -201,7 +201,7 @@ $ curl -L http://localhost:2378/blackhole-tx -X DELETE
Trigger leader election Trigger leader election
```bash ```bash
$ ./build.sh $ ./scripts/build.sh
$ make build-functional $ make build-functional
$ rm -rf /tmp/etcd-proxy-data.s* $ rm -rf /tmp/etcd-proxy-data.s*

View File

@ -54,7 +54,7 @@ See README.md for more examples.
Example: Example:
# build etcd # build etcd
$ ./build.sh $ ./scripts/build.sh
$ ./bin/etcd $ ./bin/etcd
# build etcd-proxy # build etcd-proxy

View File

@ -11,7 +11,7 @@ local-tester depends on `goreman` to manage its processes and `bash` to run faul
local-tester needs `etcd`, `benchmark`, and `bridge` binaries. To build these binaries, run the following from the etcd repository root: local-tester needs `etcd`, `benchmark`, and `bridge` binaries. To build these binaries, run the following from the etcd repository root:
```sh ```sh
./build.sh ./scripts/build.sh
pushd tools/benchmark/ && go build && popd pushd tools/benchmark/ && go build && popd
pushd tools/local-tester/bridge && go build && popd pushd tools/local-tester/bridge && go build && popd
``` ```