From f213b3827adcf9f1ee3e09dbef1cb59122e1783a Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Tue, 2 Jan 2024 18:25:34 +0200 Subject: [PATCH] scripts,testsuite: move tests from scripts to testsuite folder The tests in `scripts/` seemed always weird to me. However, we actually have a dedicated folder for integration tests. * Move all test related stuff into that folder. * Rename files for clarity. * Add small description for the tests. Fixes https://github.com/storj/storj/issues/6661 Change-Id: I1365e703fde7ef7147e6a3a86de4065035b8f1df --- Jenkinsfile | 4 ++-- Jenkinsfile.premerge | 2 +- Jenkinsfile.public | 2 +- Jenkinsfile.verify | 2 +- Jenkinsfile.versions | 2 +- Makefile | 10 ++++---- satellite/configlock_test.go | 2 +- .../satellite-config.yaml.lock | 0 testsuite/backward-compatibility/README.md | 13 ++++++++++ .../backward-compatibility/start-sim-dev.sh | 2 +- .../backward-compatibility/start-sim.sh | 2 +- .../backward-compatibility/start-up.sh | 16 ++++++------- .../backward-compatibility/steps.sh | 4 ++-- testsuite/basic/README.md | 17 +++++++++++++ .../basic/start-sim-dev.sh | 2 +- .../basic/start-sim.sh | 16 ++++++------- .../basic/start-up.sh | 12 +++++----- .../basic/step-billing.sh | 0 .../basic/step-uplink-rs-download.sh | 0 .../basic/step-uplink-rs-upload.sh | 0 .../basic/step-uplink-share.sh | 2 +- .../basic/step-uplink.sh | 2 +- {scripts/tests => testsuite}/postgres-dev.sh | 0 testsuite/redis/README.md | 3 +++ .../tests => testsuite}/redis/redis-server.sh | 0 .../redis/start-sim-dev.sh | 2 +- .../redis/start-sim.sh | 16 ++++++------- .../redis/step.sh | 8 +++---- testsuite/rolling-upgrade/README.md | 7 ++++++ .../rolling-upgrade/start-sim-dev.sh | 2 +- .../rolling-upgrade/start-sim.sh | 24 +++++++++---------- .../rolling-upgrade/step-1.sh | 6 ++--- .../rolling-upgrade/step-2.sh | 0 {scripts => testsuite}/test-certificates.sh | 2 +- {scripts => testsuite}/test-network-stalls.go | 0 {scripts => testsuite}/update-access.go | 0 testsuite/uplink-versions/README.md | 16 +++++++++++++ .../uplink-versions/start-sim-dev.sh | 2 +- .../uplink-versions/start-sim.sh | 8 +++---- .../uplink-versions/steps.sh | 4 ++-- testsuite/wasm/README.md | 3 +++ .../wasm/check-size.sh | 0 .../test-wasm.sh => testsuite/wasm/start.sh | 2 +- 43 files changed, 138 insertions(+), 79 deletions(-) rename {scripts/testdata => satellite}/satellite-config.yaml.lock (100%) mode change 100755 => 100644 create mode 100644 testsuite/backward-compatibility/README.md rename scripts/tests/backwardcompatibility/test-sim-backwards-dev.sh => testsuite/backward-compatibility/start-sim-dev.sh (87%) rename scripts/tests/backwardcompatibility/test-sim-backwards.sh => testsuite/backward-compatibility/start-sim.sh (99%) rename scripts/tests/backwardcompatibility/test-storj-up-backwards.sh => testsuite/backward-compatibility/start-up.sh (87%) rename scripts/tests/backwardcompatibility/test-backwards.sh => testsuite/backward-compatibility/steps.sh (95%) create mode 100644 testsuite/basic/README.md rename scripts/tests/integration/test-sim-dev.sh => testsuite/basic/start-sim-dev.sh (85%) rename scripts/tests/integration/test-sim.sh => testsuite/basic/start-sim.sh (84%) rename scripts/tests/integration/test-storj-up.sh => testsuite/basic/start-up.sh (89%) rename scripts/tests/integration/test-billing.sh => testsuite/basic/step-billing.sh (100%) rename scripts/tests/integration/test-uplink-rs-download.sh => testsuite/basic/step-uplink-rs-download.sh (100%) rename scripts/tests/integration/test-uplink-rs-upload.sh => testsuite/basic/step-uplink-rs-upload.sh (100%) rename scripts/tests/integration/test-uplink-share.sh => testsuite/basic/step-uplink-share.sh (96%) rename scripts/tests/integration/test-uplink.sh => testsuite/basic/step-uplink.sh (99%) rename {scripts/tests => testsuite}/postgres-dev.sh (100%) create mode 100644 testsuite/redis/README.md rename {scripts/tests => testsuite}/redis/redis-server.sh (100%) rename scripts/tests/redis/test-sim-redis-up-and-down-dev.sh => testsuite/redis/start-sim-dev.sh (81%) rename scripts/tests/redis/test-sim-redis-up-and-down.sh => testsuite/redis/start-sim.sh (78%) rename scripts/tests/redis/test-uplink-redis-up-and-down.sh => testsuite/redis/step.sh (96%) create mode 100644 testsuite/rolling-upgrade/README.md rename scripts/tests/rollingupgrade/test-sim-rolling-upgrade-dev.sh => testsuite/rolling-upgrade/start-sim-dev.sh (96%) mode change 100755 => 100644 rename scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh => testsuite/rolling-upgrade/start-sim.sh (90%) rename scripts/tests/rollingupgrade/test-rolling-upgrade.sh => testsuite/rolling-upgrade/step-1.sh (96%) rename scripts/tests/rollingupgrade/test-rolling-upgrade-final-upload.sh => testsuite/rolling-upgrade/step-2.sh (100%) rename {scripts => testsuite}/test-certificates.sh (98%) rename {scripts => testsuite}/test-network-stalls.go (100%) rename {scripts => testsuite}/update-access.go (100%) create mode 100644 testsuite/uplink-versions/README.md rename scripts/tests/testversions/test-sim-versions-dev.sh => testsuite/uplink-versions/start-sim-dev.sh (96%) mode change 100755 => 100644 rename scripts/tests/testversions/test-sim-versions.sh => testsuite/uplink-versions/start-sim.sh (96%) rename scripts/tests/testversions/test-versions.sh => testsuite/uplink-versions/steps.sh (98%) create mode 100644 testsuite/wasm/README.md rename scripts/test-wasm-size.sh => testsuite/wasm/check-size.sh (100%) rename scripts/test-wasm.sh => testsuite/wasm/start.sh (87%) diff --git a/Jenkinsfile b/Jenkinsfile index 8fa8b15089f1..40289370e0f9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,7 +34,7 @@ node('node') { sh 'docker exec postgres-$BUILD_NUMBER createdb -U postgres teststorj' // fetch the remote main branch sh 'git fetch --no-tags --progress -- https://github.com/storj/storj.git +refs/heads/main:refs/remotes/origin/main' - sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh -e BRANCH_NAME -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS -e STORJ_MIGRATION_DB --link redis-$BUILD_NUMBER:redis --link postgres-$BUILD_NUMBER:postgres storjlabs/golang:1.21.3' + sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/testsuite/rolling-upgrade/start-sim.sh -e BRANCH_NAME -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS -e STORJ_MIGRATION_DB --link redis-$BUILD_NUMBER:redis --link postgres-$BUILD_NUMBER:postgres storjlabs/golang:1.21.3' } catch(err){ throw err @@ -71,7 +71,7 @@ node('node') { // fetch the remote main branch sh 'git fetch --no-tags --progress -- https://github.com/storj/storj.git +refs/heads/main:refs/remotes/origin/main' - sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh -e BRANCH_NAME -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS -e STORJ_MIGRATION_DB -e STORJ_SKIP_FIX_LAST_NETS --link redis-$BUILD_NUMBER:redis --link cockroach-$BUILD_NUMBER:cockroach storjlabs/golang:1.21.3' + sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/testsuite/rolling-upgrade/start-sim.sh -e BRANCH_NAME -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS -e STORJ_MIGRATION_DB -e STORJ_SKIP_FIX_LAST_NETS --link redis-$BUILD_NUMBER:redis --link cockroach-$BUILD_NUMBER:cockroach storjlabs/golang:1.21.3' } catch(err){ throw err diff --git a/Jenkinsfile.premerge b/Jenkinsfile.premerge index 008359f5a50f..a4be88318239 100644 --- a/Jenkinsfile.premerge +++ b/Jenkinsfile.premerge @@ -54,7 +54,7 @@ pipeline { stage('wasm') { steps { - sh './scripts/test-wasm.sh' + sh './testsuite/wasm/start.sh' } } diff --git a/Jenkinsfile.public b/Jenkinsfile.public index ddfd7dda95de..4e2b5171f4d2 100644 --- a/Jenkinsfile.public +++ b/Jenkinsfile.public @@ -47,7 +47,7 @@ pipeline { stage('wasm') { steps { - sh './scripts/test-wasm.sh' + sh './testsuite/wasm/start.sh' } } diff --git a/Jenkinsfile.verify b/Jenkinsfile.verify index 816aa5f46a73..ee19abae75f0 100644 --- a/Jenkinsfile.verify +++ b/Jenkinsfile.verify @@ -100,7 +100,7 @@ pipeline { } stage('wasm') { steps { - sh './scripts/test-wasm.sh' + sh './testsuite/wasm/start.sh' } } stage('web/storagenode') { diff --git a/Jenkinsfile.versions b/Jenkinsfile.versions index a156d547e608..d363e5ed3815 100644 --- a/Jenkinsfile.versions +++ b/Jenkinsfile.versions @@ -32,7 +32,7 @@ node('node') { sh 'docker exec postgres-$BUILD_NUMBER createdb -U postgres teststorj' // fetch the remote main branch sh 'git fetch --no-tags --progress -- https://github.com/storj/storj.git +refs/heads/main:refs/remotes/origin/main' - sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/scripts/tests/testversions/test-sim-versions.sh -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS --link redis-$BUILD_NUMBER:redis --link postgres-$BUILD_NUMBER:postgres storjlabs/golang:1.21.3' + sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/testsuite/uplink-versions/start-sim.sh -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS --link redis-$BUILD_NUMBER:redis --link postgres-$BUILD_NUMBER:postgres storjlabs/golang:1.21.3' } catch(err){ throw err diff --git a/Makefile b/Makefile index 59f82cbb4fb4..834470d8863a 100644 --- a/Makefile +++ b/Makefile @@ -199,23 +199,23 @@ test: test/setup ## Run tests against CockroachDB and Postgres (developer) .PHONY: test-sim test-sim: ## Test source with storj-sim (jenkins) @echo "Running ${@}" - @./scripts/tests/integration/test-sim.sh + @./testsuite/basic/start-sim.sh .PHONY: test-sim-redis-unavailability test-sim-redis-unavailability: ## Test source with Redis availability with storj-sim (jenkins) @echo "Running ${@}" - @./scripts/tests/redis/test-sim-redis-up-and-down.sh + @./testsuite/redis/start-sim.sh .PHONY: test-certificates test-certificates: ## Test certificate signing service and storagenode setup (jenkins) @echo "Running ${@}" - @./scripts/test-certificates.sh + @./testsuite/test-certificates.sh .PHONY: test-sim-backwards-compatible test-sim-backwards-compatible: ## Test uploading a file with lastest release (jenkins) @echo "Running ${@}" - @./scripts/tests/backwardcompatibility/test-sim-backwards.sh + @./testsuite/backward-compatibility/start-sim.sh .PHONY: check-monitoring check-monitoring: ## Check for locked monkit calls that have changed @@ -227,7 +227,7 @@ check-monitoring: ## Check for locked monkit calls that have changed .PHONY: test-wasm-size test-wasm-size: ## Test that the built .wasm code has not increased in size @echo "Running ${@}" - @./scripts/test-wasm-size.sh + @./testsuite/wasm/check-size.sh ##@ Build diff --git a/satellite/configlock_test.go b/satellite/configlock_test.go index 298cc09e79d1..093ec9995b94 100644 --- a/satellite/configlock_test.go +++ b/satellite/configlock_test.go @@ -40,7 +40,7 @@ func TestConfigLock(t *testing.T) { normalizeConfig(t, filepath.Join(tempDir, "config.yaml"), cleanedupConfig, tempDir) // either compare or save the lock file - lockPath := filepath.Join("..", "scripts", "testdata", "satellite-config.yaml.lock") + lockPath := "satellite-config.yaml.lock" if *createLock { // update satellite-config.yaml.lock // copy using ReadFile/WriteFile, since os.Rename() won't work across drives input, err := os.ReadFile(cleanedupConfig) diff --git a/scripts/testdata/satellite-config.yaml.lock b/satellite/satellite-config.yaml.lock old mode 100755 new mode 100644 similarity index 100% rename from scripts/testdata/satellite-config.yaml.lock rename to satellite/satellite-config.yaml.lock diff --git a/testsuite/backward-compatibility/README.md b/testsuite/backward-compatibility/README.md new file mode 100644 index 000000000000..d7a552e6ce76 --- /dev/null +++ b/testsuite/backward-compatibility/README.md @@ -0,0 +1,13 @@ +This folder contains basic backwards compatibility tests. + +Such that all these work together: + +* storage nodes: + * half on the latest release + * half on the current tip +* uplink: + * latest release + * current tip +* satellite + * latest release + * current tip \ No newline at end of file diff --git a/scripts/tests/backwardcompatibility/test-sim-backwards-dev.sh b/testsuite/backward-compatibility/start-sim-dev.sh similarity index 87% rename from scripts/tests/backwardcompatibility/test-sim-backwards-dev.sh rename to testsuite/backward-compatibility/start-sim-dev.sh index ce6abb1ad6f3..df281f7df6d0 100755 --- a/scripts/tests/backwardcompatibility/test-sim-backwards-dev.sh +++ b/testsuite/backward-compatibility/start-sim-dev.sh @@ -6,4 +6,4 @@ source $SCRIPTDIR/../postgres-dev.sh export STORJ_MIGRATION_DB="${STORJ_SIM_POSTGRES}&options=--search_path=satellite/0/meta" -$SCRIPTDIR/test-sim-backwards.sh \ No newline at end of file +$SCRIPTDIR/start-sim.sh \ No newline at end of file diff --git a/scripts/tests/backwardcompatibility/test-sim-backwards.sh b/testsuite/backward-compatibility/start-sim.sh similarity index 99% rename from scripts/tests/backwardcompatibility/test-sim-backwards.sh rename to testsuite/backward-compatibility/start-sim.sh index 727da959fb11..8be45d7ca98d 100755 --- a/scripts/tests/backwardcompatibility/test-sim-backwards.sh +++ b/testsuite/backward-compatibility/start-sim.sh @@ -31,7 +31,7 @@ test() { DIR=$1 shift - PATH="$DIR"/bin:"$PATH" storj-sim -x --storage-nodes="$STORJ_NUM_NODES" --host="$STORJ_NETWORK_HOST4" network test -- bash "$SCRIPTDIR"/test-backwards.sh "$@" + PATH="$DIR"/bin:"$PATH" storj-sim -x --storage-nodes="$STORJ_NUM_NODES" --host="$STORJ_NETWORK_HOST4" network test -- bash "$SCRIPTDIR"/steps.sh "$@" } test_release() { diff --git a/scripts/tests/backwardcompatibility/test-storj-up-backwards.sh b/testsuite/backward-compatibility/start-up.sh similarity index 87% rename from scripts/tests/backwardcompatibility/test-storj-up-backwards.sh rename to testsuite/backward-compatibility/start-up.sh index 911155a47055..372b63274e93 100755 --- a/scripts/tests/backwardcompatibility/test-storj-up-backwards.sh +++ b/testsuite/backward-compatibility/start-up.sh @@ -84,10 +84,10 @@ eval $(storj-up credentials -e) #### release tests #### # upload using everything release -PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/test-backwards.sh" -b release-network-release-uplink upload +PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/steps.sh" -b release-network-release-uplink upload # check that it worked with everything release -PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/test-backwards.sh" -b release-network-release-uplink download +PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/steps.sh" -b release-network-release-uplink download #### build branch binaries #### BRANCH_BIN="$STORJ_NETWORK_DIR/bin/branch" @@ -120,19 +120,19 @@ sleep 60 #### Branch tests #### # check that branch uplink + branch network can read fully release data -PATH="$BRANCH_BIN":"$PATH" "$SCRIPTDIR""/test-backwards.sh" -b release-network-release-uplink download +PATH="$BRANCH_BIN":"$PATH" "$SCRIPTDIR""/steps.sh" -b release-network-release-uplink download # check that branch uplink + branch network can upload -PATH="$BRANCH_BIN":"$PATH" "$SCRIPTDIR""/test-backwards.sh" -b branch-network-branch-uplink upload +PATH="$BRANCH_BIN":"$PATH" "$SCRIPTDIR""/steps.sh" -b branch-network-branch-uplink upload # check that release uplink + branch network can read fully release data -PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/test-backwards.sh" -b release-network-release-uplink download +PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/steps.sh" -b release-network-release-uplink download # check that release uplink + branch network can read fully branch data -PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/test-backwards.sh" -b branch-network-branch-uplink download +PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/steps.sh" -b branch-network-branch-uplink download # check that release uplink + branch network can upload -PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/test-backwards.sh" -b branch-network-release-uplink upload +PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/steps.sh" -b branch-network-release-uplink upload # check that release uplink + branch network can read mixed data -PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/test-backwards.sh" -b branch-network-release-uplink download +PATH="$RELEASE_BIN":"$PATH" "$SCRIPTDIR""/steps.sh" -b branch-network-release-uplink download diff --git a/scripts/tests/backwardcompatibility/test-backwards.sh b/testsuite/backward-compatibility/steps.sh similarity index 95% rename from scripts/tests/backwardcompatibility/test-backwards.sh rename to testsuite/backward-compatibility/steps.sh index 1fa4c6422564..5dfb55cf3776 100755 --- a/scripts/tests/backwardcompatibility/test-backwards.sh +++ b/testsuite/backward-compatibility/steps.sh @@ -2,7 +2,7 @@ set -ueo pipefail SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source $SCRIPTDIR/../../utils.sh +source $SCRIPTDIR/../../scripts/utils.sh TMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX) @@ -32,7 +32,7 @@ DOWNLOAD_FILES_DIR="$STORJ_NETWORK_DIR/download/$BUCKET" if [[ ! -v UPLINK_ACCESS ]]; then # override configured access with access where address is node ID + satellite addess - STORJ_ACCESS=$(go run "$SCRIPTDIR"/../../update-access.go "$SATELLITE_0_DIR" "$GATEWAY_0_ACCESS") + STORJ_ACCESS=$(go run "$SCRIPTDIR"/../../testsuite/update-access.go "$SATELLITE_0_DIR" "$GATEWAY_0_ACCESS") UPLINK_ACCESS="$STORJ_ACCESS" export STORJ_ACCESS diff --git a/testsuite/basic/README.md b/testsuite/basic/README.md new file mode 100644 index 000000000000..8fa7d6785077 --- /dev/null +++ b/testsuite/basic/README.md @@ -0,0 +1,17 @@ +This folder contains basic integration tests. + +These test: + +* uplink: + * create bucket + * delete bucket + * upload + * download + * share + * listing + * server side move + * server side copy + * delete +* running billing commands +* reed-solomon value changes + * uplink can upload/download old data \ No newline at end of file diff --git a/scripts/tests/integration/test-sim-dev.sh b/testsuite/basic/start-sim-dev.sh similarity index 85% rename from scripts/tests/integration/test-sim-dev.sh rename to testsuite/basic/start-sim-dev.sh index 728d3b4288e8..7865aefb2356 100755 --- a/scripts/tests/integration/test-sim-dev.sh +++ b/testsuite/basic/start-sim-dev.sh @@ -4,4 +4,4 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source $SCRIPTDIR/../postgres-dev.sh -$SCRIPTDIR/test-sim.sh \ No newline at end of file +$SCRIPTDIR/start-sim.sh \ No newline at end of file diff --git a/scripts/tests/integration/test-sim.sh b/testsuite/basic/start-sim.sh similarity index 84% rename from scripts/tests/integration/test-sim.sh rename to testsuite/basic/start-sim.sh index 6733cd72964d..6b55f9990b7a 100755 --- a/scripts/tests/integration/test-sim.sh +++ b/testsuite/basic/start-sim.sh @@ -11,8 +11,8 @@ cleanup(){ } trap cleanup EXIT -echo "Running test-sim" -make -C "$SCRIPTDIR"/../../.. install-sim +echo "Running basic/start-sim" +make -C "$SCRIPTDIR"/../.. install-sim echo "Overriding default max segment size to 6MiB" GOBIN=$TMP go install -v -ldflags "-X 'storj.io/uplink.maxSegmentSize=6MiB'" storj.io/storj/cmd/uplink @@ -37,14 +37,14 @@ else fi # run tests -storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/test-uplink.sh -storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/test-uplink-share.sh -storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/test-billing.sh +storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/step-uplink.sh +storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/step-uplink-share.sh +storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/step-billing.sh -storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/test-uplink-rs-upload.sh +storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/step-uplink-rs-upload.sh # change RS values and try download sed -i 's@# metainfo.rs: 4/6/8/10-256 B@metainfo.rs: 2/3/6/8-256 B@g' $(storj-sim network env SATELLITE_0_DIR)/config.yaml -storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/test-uplink-rs-download.sh +storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/step-uplink-rs-download.sh storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network destroy @@ -53,5 +53,5 @@ storj-sim -x --satellites 1 --host $STORJ_NETWORK_HOST4 network destroy # aws-cli doesn't support gateway with ipv6 address, so change it to use localhost #find "$STORJ_NETWORK_DIR"/gateway -type f -name config.yaml -exec sed -i 's/server.address: "\[::1\]/server.address: "127.0.0.1/' '{}' + # run aws-cli tests using ipv6 -#storj-sim -x --host "::1" network test bash "$SCRIPTDIR"/test-sim-aws.sh +#storj-sim -x --host "::1" network test bash "$SCRIPTDIR"/step-sim-aws.sh #storj-sim -x network destroy diff --git a/scripts/tests/integration/test-storj-up.sh b/testsuite/basic/start-up.sh similarity index 89% rename from scripts/tests/integration/test-storj-up.sh rename to testsuite/basic/start-up.sh index dfb46bb3ebb0..e1a7adc3c53a 100755 --- a/scripts/tests/integration/test-storj-up.sh +++ b/testsuite/basic/start-up.sh @@ -72,16 +72,16 @@ export GATEWAY_0_ACCESS=$UPLINK_ACCESS export SATELLITE_0_DIR=$TMP # run tests -PATH="$TMP_BIN":"$PATH" "$SCRIPTDIR"/test-uplink.sh -PATH="$TMP_BIN":"$PATH" "$SCRIPTDIR"/test-uplink-share.sh +PATH="$TMP_BIN":"$PATH" "$SCRIPTDIR"/step-uplink.sh +PATH="$TMP_BIN":"$PATH" "$SCRIPTDIR"/step-uplink-share.sh # todo: this doesn't really test anything. we should probably make a separate test for it if [ "$DB" == "cockroach" ] then - PATH="$TMP_BIN":"$PATH" STORJ_DATABASE=cockroach://root@localhost:26257/master?sslmode=disable "$SCRIPTDIR"/test-billing.sh + PATH="$TMP_BIN":"$PATH" STORJ_DATABASE=cockroach://root@localhost:26257/master?sslmode=disable "$SCRIPTDIR"/step-billing.sh else - PATH="$TMP_BIN":"$PATH" STORJ_DATABASE=postgres://postgres@localhost:6543/master?sslmode=disable "$SCRIPTDIR"/test-billing.sh + PATH="$TMP_BIN":"$PATH" STORJ_DATABASE=postgres://postgres@localhost:6543/master?sslmode=disable "$SCRIPTDIR"/step-billing.sh fi -PATH="$TMP_BIN":"$PATH" "$SCRIPTDIR"/test-uplink-rs-upload.sh +PATH="$TMP_BIN":"$PATH" "$SCRIPTDIR"/step-uplink-rs-upload.sh # change RS values and try download storj-up env set satellite-api STORJ_METAINFO_RS_ERASURE_SHARE_SIZE=256 @@ -91,4 +91,4 @@ storj-up env set satellite-api STORJ_METAINFO_RS_SUCCESS=6 storj-up env set satellite-api STORJ_METAINFO_RS_TOTAL=8 docker compose up -d docker compose exec -T storagenode1 storj-up util wait-for-satellite satellite-api:7777 -PATH="$TMP_BIN":"$PATH" "$SCRIPTDIR"/test-uplink-rs-download.sh \ No newline at end of file +PATH="$TMP_BIN":"$PATH" "$SCRIPTDIR"/step-uplink-rs-download.sh \ No newline at end of file diff --git a/scripts/tests/integration/test-billing.sh b/testsuite/basic/step-billing.sh similarity index 100% rename from scripts/tests/integration/test-billing.sh rename to testsuite/basic/step-billing.sh diff --git a/scripts/tests/integration/test-uplink-rs-download.sh b/testsuite/basic/step-uplink-rs-download.sh similarity index 100% rename from scripts/tests/integration/test-uplink-rs-download.sh rename to testsuite/basic/step-uplink-rs-download.sh diff --git a/scripts/tests/integration/test-uplink-rs-upload.sh b/testsuite/basic/step-uplink-rs-upload.sh similarity index 100% rename from scripts/tests/integration/test-uplink-rs-upload.sh rename to testsuite/basic/step-uplink-rs-upload.sh diff --git a/scripts/tests/integration/test-uplink-share.sh b/testsuite/basic/step-uplink-share.sh similarity index 96% rename from scripts/tests/integration/test-uplink-share.sh rename to testsuite/basic/step-uplink-share.sh index abe3debe9360..e03470a0b69a 100755 --- a/scripts/tests/integration/test-uplink-share.sh +++ b/testsuite/basic/step-uplink-share.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source $SCRIPTDIR/../../utils.sh +source $SCRIPTDIR/../../scripts/utils.sh TMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX) diff --git a/scripts/tests/integration/test-uplink.sh b/testsuite/basic/step-uplink.sh similarity index 99% rename from scripts/tests/integration/test-uplink.sh rename to testsuite/basic/step-uplink.sh index d0f9e2b4f1c1..71cf5fef1547 100755 --- a/scripts/tests/integration/test-uplink.sh +++ b/testsuite/basic/step-uplink.sh @@ -2,7 +2,7 @@ set -ueo pipefail SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source $SCRIPTDIR/../../utils.sh +source $SCRIPTDIR/../../scripts/utils.sh TMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX) diff --git a/scripts/tests/postgres-dev.sh b/testsuite/postgres-dev.sh similarity index 100% rename from scripts/tests/postgres-dev.sh rename to testsuite/postgres-dev.sh diff --git a/testsuite/redis/README.md b/testsuite/redis/README.md new file mode 100644 index 000000000000..639c4b174a8a --- /dev/null +++ b/testsuite/redis/README.md @@ -0,0 +1,3 @@ +This folder contains basic redis tests. + +It currently tests whether satellite can still function when redis fails. \ No newline at end of file diff --git a/scripts/tests/redis/redis-server.sh b/testsuite/redis/redis-server.sh similarity index 100% rename from scripts/tests/redis/redis-server.sh rename to testsuite/redis/redis-server.sh diff --git a/scripts/tests/redis/test-sim-redis-up-and-down-dev.sh b/testsuite/redis/start-sim-dev.sh similarity index 81% rename from scripts/tests/redis/test-sim-redis-up-and-down-dev.sh rename to testsuite/redis/start-sim-dev.sh index 51cb8d1ef2dd..f04c6745ab3e 100755 --- a/scripts/tests/redis/test-sim-redis-up-and-down-dev.sh +++ b/testsuite/redis/start-sim-dev.sh @@ -6,4 +6,4 @@ export STORJ_REDIS_PORT=7379 # shellcheck source=/postgres-dev.sh source "${SCRIPTDIR}/../postgres-dev.sh" -"${SCRIPTDIR}/test-sim-redis-up-and-down.sh" +"${SCRIPTDIR}/start-sim.sh" diff --git a/scripts/tests/redis/test-sim-redis-up-and-down.sh b/testsuite/redis/start-sim.sh similarity index 78% rename from scripts/tests/redis/test-sim-redis-up-and-down.sh rename to testsuite/redis/start-sim.sh index badf19f24d1c..2f52da480b5a 100755 --- a/scripts/tests/redis/test-sim-redis-up-and-down.sh +++ b/testsuite/redis/start-sim.sh @@ -14,8 +14,8 @@ if [ -z "${STORJ_REDIS_PORT}" ]; then fi # constants -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" -readonly SCRIPT_DIR +SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +readonly SCRIPTDIR TMP_DIR=$(mktemp -d -t tmp.XXXXXXXXXX) readonly TMP_DIR STORJ_REDIS_DIR=$(mktemp -d -p /tmp test-sim-redis.XXXX) @@ -25,14 +25,14 @@ export STORJ_REDIS_DIR cleanup() { trap - EXIT ERR - "${SCRIPT_DIR}/redis-server.sh" stop + "${SCRIPTDIR}/redis-server.sh" stop rm -rf "${TMP_DIR}" rm -rf "${STORJ_REDIS_DIR}" } trap cleanup ERR EXIT echo "install sim" -make -C "$SCRIPT_DIR"/../../.. install-sim +make -C "$SCRIPTDIR"/../.. install-sim echo "overriding default max segment size to 6MiB" GOBIN="${TMP_DIR}" go install -v -ldflags "-X 'storj.io/uplink.maxSegmentSize=6MiB'" storj.io/storj/cmd/uplink @@ -48,15 +48,15 @@ export STORJ_REDIS_HOST=${STORJ_NETWORK_HOST4} export STORJ_METAINFO_SERVER_SIDE_COPY_DUPLICATE_METADATA=true # setup the network -"${SCRIPT_DIR}/redis-server.sh" start +"${SCRIPTDIR}/redis-server.sh" start storj-sim --failfast -x --satellites 1 --host "${STORJ_NETWORK_HOST4}" network \ --postgres="${STORJ_SIM_POSTGRES}" --redis="${STORJ_REDIS_HOST}:${STORJ_REDIS_PORT}" setup # run test that checks that the satellite runs when Redis is up and down storj-sim --failfast -x --satellites 1 --host "${STORJ_NETWORK_HOST4}" network \ - --redis="127.0.0.1:6379" test bash "${SCRIPT_DIR}/test-uplink-redis-up-and-down.sh" "${REDIS_CONTAINER_NAME}" + --redis="127.0.0.1:6379" test bash "${SCRIPTDIR}/step.sh" "${REDIS_CONTAINER_NAME}" # run test that checks that the satellite runs despite of not being able to connect to Redis -"${SCRIPT_DIR}/redis-server.sh" stop +"${SCRIPTDIR}/redis-server.sh" stop storj-sim --failfast -x --satellites 1 --host "${STORJ_NETWORK_HOST4}" network \ - --redis="127.0.0.1:6379" test bash "${SCRIPT_DIR}/../integration/test-uplink.sh" + --redis="127.0.0.1:6379" test bash "${SCRIPTDIR}/../basic/step-uplink.sh" diff --git a/scripts/tests/redis/test-uplink-redis-up-and-down.sh b/testsuite/redis/step.sh similarity index 96% rename from scripts/tests/redis/test-uplink-redis-up-and-down.sh rename to testsuite/redis/step.sh index 7d04487df973..4c84a0c743a7 100755 --- a/scripts/tests/redis/test-uplink-redis-up-and-down.sh +++ b/testsuite/redis/step.sh @@ -3,11 +3,11 @@ set -Eeo pipefail set +x # constants -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" -source $SCRIPT_DIR/../../utils.sh +SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +source $SCRIPTDIR/../../scripts/utils.sh -readonly SCRIPT_DIR +readonly SCRIPTDIR BUCKET="bucket-123" readonly BUCKET UPLINK_DEBUG_ADDR="" @@ -124,5 +124,5 @@ uplink_test() { uplink_test # Run the test with Redis container not running -"${SCRIPT_DIR}/redis-server.sh" stop +"${SCRIPTDIR}/redis-server.sh" stop uplink_test diff --git a/testsuite/rolling-upgrade/README.md b/testsuite/rolling-upgrade/README.md new file mode 100644 index 000000000000..9f40df091a2e --- /dev/null +++ b/testsuite/rolling-upgrade/README.md @@ -0,0 +1,7 @@ +This folder contains rolling upgrade tests. + +1. It first sets up an old satellite. +2. Uploads some data +3. Migrate database and configuration files +4. Run half-and-half latest-release and tip of storagenodes +5. Test upload/download with both old and new satellite-api \ No newline at end of file diff --git a/scripts/tests/rollingupgrade/test-sim-rolling-upgrade-dev.sh b/testsuite/rolling-upgrade/start-sim-dev.sh old mode 100755 new mode 100644 similarity index 96% rename from scripts/tests/rollingupgrade/test-sim-rolling-upgrade-dev.sh rename to testsuite/rolling-upgrade/start-sim-dev.sh index dd73f8e81f71..23843b50349d --- a/scripts/tests/rollingupgrade/test-sim-rolling-upgrade-dev.sh +++ b/testsuite/rolling-upgrade/start-sim-dev.sh @@ -29,4 +29,4 @@ export STORJ_MIGRATION_DB="${STORJ_SIM_POSTGRES}&options=--search_path=satellite # fetch the remote main branch git fetch --no-tags --progress -- https://github.com/storj/storj.git +refs/heads/main:refs/remotes/origin/main -$SCRIPTDIR/test-sim-rolling-upgrade.sh +$SCRIPTDIR/start-sim.sh diff --git a/scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh b/testsuite/rolling-upgrade/start-sim.sh similarity index 90% rename from scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh rename to testsuite/rolling-upgrade/start-sim.sh index 3f6fffcb3529..736332313e40 100755 --- a/scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh +++ b/testsuite/rolling-upgrade/start-sim.sh @@ -6,18 +6,18 @@ # * Set up a storj-sim network on the latest point release (all storagenodes and satellite on latest point release). # * If the current commit is a release tag use the previous release instead. Exclude -rc release tags. # * Check out the latest point release of the uplink. -# * (test-versions.sh upload) - Upload an inline, remote, and multisegment file to the network with the selected uplink. +# * (uplink-versions/steps.sh upload) - Upload an inline, remote, and multisegment file to the network with the selected uplink. # Stage 2: # * Upgrade the satellite to current commit. Run an "old" satellite api server on the latest point release (port 30000). # * Keep half of the storagenodes on the latest point release. Upgrade the other half to main. # * Point half of the storagenodes to the old satellite api (port 30000). Keep the other half on the new satellite api (port 10000). # * Check out the main version of the uplink. -# * (test-rolling-upgrade.sh) - Download the inline, remote, and multisegment file from the network using the main uplink and the new satellite api. -# * (test-rolling-upgrade.sh) - Download the inline, remote, and multisegment file from the network using the main uplink and the old satellite api. -# * (test-rolling-upgrade-final-upload.sh) - Upload an inline, remote, and multisegment file to the network using the main uplink and the new satellite api. -# * (test-rolling-upgrade-final-upload.sh) - Upload an inline, remote, and multisegment file to the network using the main uplink and the old satellite api. -# * (test-rolling-upgrade-final-upload.sh) - Download the six inline, remote, and multisegment files from the previous two steps using the main uplink and new satellite api. -# * (test-rolling-upgrade-final-upload.sh) - Download the six inline, remote, and multisegment files from the previous two steps using the main uplink and old satellite api. +# * (step-1.sh) - Download the inline, remote, and multisegment file from the network using the main uplink and the new satellite api. +# * (step-1.sh) - Download the inline, remote, and multisegment file from the network using the main uplink and the old satellite api. +# * (step-2.sh) - Upload an inline, remote, and multisegment file to the network using the main uplink and the new satellite api. +# * (step-2.sh) - Upload an inline, remote, and multisegment file to the network using the main uplink and the old satellite api. +# * (step-2.sh) - Download the six inline, remote, and multisegment files from the previous two steps using the main uplink and new satellite api. +# * (step-2.sh) - Download the six inline, remote, and multisegment files from the previous two steps using the main uplink and old satellite api. set -ueo pipefail set +x @@ -263,15 +263,15 @@ done test_dir=$(version_dir "test_dir") cp -r $(version_dir ${stage1_sat_version}) ${test_dir} echo -e "\nSetting up stage 1 in ${test_dir}" -test_versions_path="$( dirname "${scriptdir}" )/testversions/test-versions.sh" +test_versions_path="$( dirname "${scriptdir}" )/uplink-versions/steps.sh" setup_stage "${test_dir}" "${stage1_sat_version}" "${stage1_storagenode_versions}" "1" -update_access_script_path="$(version_dir $current_commit)/scripts/update-access.go" +update_access_script_path="$(version_dir $current_commit)/testsuite/update-access.go" # Uploading files to the network using the latest release version echo "Stage 1 uplink version: ${stage1_uplink_version}" src_ul_version_dir=$(version_dir ${stage1_uplink_version}) ln -f ${src_ul_version_dir}/bin/uplink $test_dir/bin/uplink -# use test-versions.sh instead of test-rolling-upgrade.sh for upload step, since the setup for the two tests should be identical +# use uplink-versions/steps.sh instead of ./step-1.sh for upload step, since the setup for the two tests should be identical PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${test_versions_path}" "${test_dir}/local-network" "upload" "${stage1_uplink_version}" "$update_access_script_path" echo -e "\nSetting up stage 2 in ${test_dir}" @@ -318,11 +318,11 @@ for ul_version in ${stage2_uplink_versions}; do echo "Stage 2 uplink version: ${ul_version}" src_ul_version_dir=$(version_dir ${ul_version}) ln -f ${src_ul_version_dir}/bin/uplink $test_dir/bin/uplink - PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/test-rolling-upgrade.sh" "${test_dir}/local-network" "${stage1_uplink_version}" "$update_access_script_path" + PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/step-1.sh" "${test_dir}/local-network" "${stage1_uplink_version}" "$update_access_script_path" if [[ $ul_version == $current_commit ]];then echo "Running final upload/download test on $current_commit" - PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/test-rolling-upgrade-final-upload.sh" "${test_dir}/local-network" + PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/step-2.sh" "${test_dir}/local-network" fi done diff --git a/scripts/tests/rollingupgrade/test-rolling-upgrade.sh b/testsuite/rolling-upgrade/step-1.sh similarity index 96% rename from scripts/tests/rollingupgrade/test-rolling-upgrade.sh rename to testsuite/rolling-upgrade/step-1.sh index f7e93b5d1ebe..a0dadc061ce1 100755 --- a/scripts/tests/rollingupgrade/test-rolling-upgrade.sh +++ b/testsuite/rolling-upgrade/step-1.sh @@ -8,7 +8,7 @@ set -ueo pipefail # This script assumes that storj-sim and uplink has already been set up and initial files have been -# uploaded via scripts/test-versions.sh +# uploaded via /uplink-versions/steps.sh main_cfg_dir=$1 existing_bucket_name_suffixes=$2 update_access_script_path=$3 @@ -18,7 +18,7 @@ test_files_dir="${main_cfg_dir}/testfiles" stage1_dst_dir="${main_cfg_dir}/stage1" stage2_dst_dir="${main_cfg_dir}/stage2" -echo "Begin test-rolling-upgrade.sh, storj-sim config directory:" ${main_cfg_dir} +echo "Begin rolling-upgrade/step-1.sh, storj-sim config directory:" ${main_cfg_dir} echo "which storj-sim: $(which storj-sim)" echo "Shasum for storj-sim:" @@ -132,4 +132,4 @@ for suffix in ${existing_bucket_name_suffixes}; do rm -rf ${download_dst_dir} done -echo "Done with test-rolling-upgrade.sh" +echo "Done with rolling-upgrade/step-1.sh" diff --git a/scripts/tests/rollingupgrade/test-rolling-upgrade-final-upload.sh b/testsuite/rolling-upgrade/step-2.sh similarity index 100% rename from scripts/tests/rollingupgrade/test-rolling-upgrade-final-upload.sh rename to testsuite/rolling-upgrade/step-2.sh diff --git a/scripts/test-certificates.sh b/testsuite/test-certificates.sh similarity index 98% rename from scripts/test-certificates.sh rename to testsuite/test-certificates.sh index 334f0d13eff7..24267edfa60d 100755 --- a/scripts/test-certificates.sh +++ b/testsuite/test-certificates.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -ueo pipefail -source $(dirname $0)/utils.sh +source $(dirname $0)/../scripts/utils.sh TMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX) IDENTS_DIR=$TMPDIR/identities diff --git a/scripts/test-network-stalls.go b/testsuite/test-network-stalls.go similarity index 100% rename from scripts/test-network-stalls.go rename to testsuite/test-network-stalls.go diff --git a/scripts/update-access.go b/testsuite/update-access.go similarity index 100% rename from scripts/update-access.go rename to testsuite/update-access.go diff --git a/testsuite/uplink-versions/README.md b/testsuite/uplink-versions/README.md new file mode 100644 index 000000000000..7f450e7dc7b1 --- /dev/null +++ b/testsuite/uplink-versions/README.md @@ -0,0 +1,16 @@ +This folder contains uplink versions tests. + +It tests a set of important uplink releases to ensure all old uplinks work. + +On a network where: + +* half of storagenodes are on latest release and half on current tip +* latest satellite release and current tip + +Tetsing uplink versions such as: + +* first stable version +* pre-metainfo refactoring versions +* latest release +* current tip +* last N releases \ No newline at end of file diff --git a/scripts/tests/testversions/test-sim-versions-dev.sh b/testsuite/uplink-versions/start-sim-dev.sh old mode 100755 new mode 100644 similarity index 96% rename from scripts/tests/testversions/test-sim-versions-dev.sh rename to testsuite/uplink-versions/start-sim-dev.sh index c75657381641..7f106bd4a14e --- a/scripts/tests/testversions/test-sim-versions-dev.sh +++ b/testsuite/uplink-versions/start-sim-dev.sh @@ -26,4 +26,4 @@ done docker exec postgres-$BUILD_NUMBER createdb -U postgres teststorj # fetch the remote main branch git fetch --no-tags --progress -- https://github.com/storj/storj.git +refs/heads/main:refs/remotes/origin/main -$SCRIPTDIR/test-sim-versions.sh +$SCRIPTDIR/start-sim.sh diff --git a/scripts/tests/testversions/test-sim-versions.sh b/testsuite/uplink-versions/start-sim.sh similarity index 96% rename from scripts/tests/testversions/test-sim-versions.sh rename to testsuite/uplink-versions/start-sim.sh index 99baf4196181..acccc1c65b10 100755 --- a/scripts/tests/testversions/test-sim-versions.sh +++ b/testsuite/uplink-versions/start-sim.sh @@ -261,14 +261,14 @@ test_dir=$(version_dir "test_dir") cp -r $(version_dir ${stage1_sat_version}) ${test_dir} echo -e "\nSetting up stage 1 in ${test_dir}" setup_stage "${test_dir}" "${stage1_sat_version}" "${stage1_storagenode_versions}" -update_access_script_path="$(version_dir "main")/scripts/update-access.go" +update_access_script_path="$(version_dir "main")/testsuite/update-access.go" # Uploading files to the network using the latest release version for each uplink version for ul_version in ${stage1_uplink_versions}; do echo "Stage 1 Uplink version: ${ul_version}" src_ul_version_dir=$(version_dir ${ul_version}) ln -f ${src_ul_version_dir}/bin/uplink $test_dir/bin/uplink - PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/test-versions.sh" "${test_dir}/local-network" "upload" "${ul_version}" "$update_access_script_path" + PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/steps.sh" "${test_dir}/local-network" "upload" "${ul_version}" "$update_access_script_path" done # Remove current uplink config to regenerate uplink config for older uplink version rm -rf "${test_dir}/local-network/uplink" @@ -282,9 +282,9 @@ for ul_version in ${stage2_uplink_versions}; do echo "Stage 2 Uplink version: ${ul_version}" src_ul_version_dir=$(version_dir ${ul_version}) ln -f ${src_ul_version_dir}/bin/uplink $test_dir/bin/uplink - PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/test-versions.sh" "${test_dir}/local-network" "download" "${ul_version}" "$update_access_script_path" "${stage1_uplink_versions}" + PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/steps.sh" "${test_dir}/local-network" "download" "${ul_version}" "$update_access_script_path" "${stage1_uplink_versions}" done echo -e "\nCleaning up." -PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/test-versions.sh" "${test_dir}/local-network" "cleanup" "${stage1_uplink_versions}" "" +PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/steps.sh" "${test_dir}/local-network" "cleanup" "${stage1_uplink_versions}" "" diff --git a/scripts/tests/testversions/test-versions.sh b/testsuite/uplink-versions/steps.sh similarity index 98% rename from scripts/tests/testversions/test-versions.sh rename to testsuite/uplink-versions/steps.sh index 355bfa23dac3..21fa1c9fffe0 100755 --- a/scripts/tests/testversions/test-versions.sh +++ b/testsuite/uplink-versions/steps.sh @@ -55,7 +55,7 @@ wait_for_all_background_jobs_to_finish(){ done } -echo "Begin test-versions.sh, storj-sim config directory:" ${main_cfg_dir} +echo "Begin uplink-versions/steps.sh, storj-sim config directory:" ${main_cfg_dir} echo "which storj-sim: $(which storj-sim)" echo "Shasum for storj-sim:" @@ -205,4 +205,4 @@ if [[ "$command" == "cleanup" ]]; then done fi -echo "Done with test-versions.sh" +echo "Done with uplink-versions/steps.sh" diff --git a/testsuite/wasm/README.md b/testsuite/wasm/README.md new file mode 100644 index 000000000000..8487130262c2 --- /dev/null +++ b/testsuite/wasm/README.md @@ -0,0 +1,3 @@ +This folder contains console webassembly tests. + +These are helper scripts that probably should be somewhere else. \ No newline at end of file diff --git a/scripts/test-wasm-size.sh b/testsuite/wasm/check-size.sh similarity index 100% rename from scripts/test-wasm-size.sh rename to testsuite/wasm/check-size.sh diff --git a/scripts/test-wasm.sh b/testsuite/wasm/start.sh similarity index 87% rename from scripts/test-wasm.sh rename to testsuite/wasm/start.sh index 034352b613f4..b76d9860da9b 100755 --- a/scripts/test-wasm.sh +++ b/testsuite/wasm/start.sh @@ -2,7 +2,7 @@ # Copyright (C) 2022 Storj Labs, Inc. # See LICENSE for copying information. set -x -cd "$(dirname "${BASH_SOURCE[0]}")/.." +cd "$(dirname "${BASH_SOURCE[0]}")/../.." mkdir -p .build rm -rf .build/wasm || true