diff --git a/contrib/scripts/functions.sh b/contrib/scripts/functions.sh index 5a465781d99..f2ac6c14a76 100755 --- a/contrib/scripts/functions.sh +++ b/contrib/scripts/functions.sh @@ -54,6 +54,6 @@ function stopCluster { function loginWithGroot() { curl -s -XPOST localhost:8180/login -d '{"userid": "groot","password": "password"}' \ - | python -c \ - "import json; resp = raw_input(); data = json.loads(resp); print data['data']['accessJWT']" + | python3 -c \ + "import json; resp = input(); data = json.loads(resp); print(data['data']['accessJWT'])" } diff --git a/contrib/scripts/goldendata-queries.sh b/contrib/scripts/goldendata-queries.sh index f60ec83eebb..d47b7564803 100755 --- a/contrib/scripts/goldendata-queries.sh +++ b/contrib/scripts/goldendata-queries.sh @@ -34,7 +34,7 @@ function run_index_test { timeout=$(( timeout * 2 )) done - NUM=$(echo $N | python -m json.tool | grep $GREPFOR | wc -l) + NUM=$(echo $N | python3 -m json.tool | grep $GREPFOR | wc -l) if [[ ! "$NUM" -eq "$ANS" ]]; then echo "Index test failed: ${X} Expected: $ANS Got: $NUM" exit 1 diff --git a/dgraph/cmd/bulk/systest/test-bulk-schema.sh b/dgraph/cmd/bulk/systest/test-bulk-schema.sh index afd408de7e0..12a6393e58b 100755 --- a/dgraph/cmd/bulk/systest/test-bulk-schema.sh +++ b/dgraph/cmd/bulk/systest/test-bulk-schema.sh @@ -71,7 +71,7 @@ function StartAlpha if [[ $p_dir ]]; then docker cp $p_dir alpha1:/data/alpha1/ fi - DockerCompose -f $DOCKER_CONF up -d alpha1 + DockerCompose -f $DOCKER_CONF up -d --remove-orphans alpha1 TIMEOUT=10 while [[ $TIMEOUT > 0 ]]; do @@ -88,7 +88,7 @@ function StartAlpha function ResetCluster { INFO "restarting cluster with only one zero and alpha" - DockerCompose -f $DOCKER_CONF down + DockerCompose -f $DOCKER_CONF down --remove-orphans StartZero StartAlpha } @@ -119,7 +119,7 @@ function QuerySchema { INFO "running schema query" local out_file="schema.out" - curl -sS -H "Content-Type: application/graphql+-" localhost:$HTTP_PORT/query -XPOST -d'schema(pred:[genre,language,name,revenue,predicate_with_default_type,predicate_with_index_no_uid_count,predicate_with_no_uid_count]) {}' | python -c "import json,sys; d=json.load(sys.stdin); json.dump(d['data'],sys.stdout,sort_keys=True,indent=2)" > $out_file + curl -sS -H "Content-Type: application/graphql+-" localhost:$HTTP_PORT/query -XPOST -d'schema(pred:[genre,language,name,revenue,predicate_with_default_type,predicate_with_index_no_uid_count,predicate_with_no_uid_count]) {}' | python3 -c "import json,sys; d=json.load(sys.stdin); json.dump(d['data'],sys.stdout,sort_keys=True,indent=2)" > $out_file echo >> $out_file } @@ -218,7 +218,7 @@ EOF function StopServers { INFO "stopping containers" - DockerCompose -f $DOCKER_CONF down + DockerCompose -f $DOCKER_CONF down --remove-orphans } function Cleanup @@ -235,7 +235,6 @@ UpdateDatabase QuerySchema DoExport StopServers - popd >/dev/null mkdir dir2 pushd dir2 >/dev/null diff --git a/systest/1million/test-reindex.sh b/systest/1million/test-reindex.sh index 775ea75cfef..9f58eb04ac9 100755 --- a/systest/1million/test-reindex.sh +++ b/systest/1million/test-reindex.sh @@ -28,7 +28,7 @@ Info "entering directory $SRCDIR" cd $SRCDIR Info "bringing down zero and alpha and data volumes" -DockerCompose down -v +DockerCompose down -v --remove-orphans Info "bringing up zero container" DockerCompose up -d --remove-orphans --force-recreate zero1 @@ -51,7 +51,7 @@ DockerCompose run -v $BENCHMARKS_REPO:$BENCHMARKS_REPO --name bulk_load zero1 \ EOF Info "bringing up alpha container" -DockerCompose up -d --force-recreate alpha1 alpha2 alpha3 +DockerCompose up -d --force-recreate --remove-orphans alpha1 alpha2 alpha3 Info "waiting for alpha to be ready" DockerCompose logs -f alpha1 | grep -q -m1 "Server is ready" @@ -71,7 +71,7 @@ Info "running regression queries" go test -v -tags systest || FOUND_DIFFS=1 Info "bringing down zero and alpha and data volumes" -DockerCompose down -v +DockerCompose down -v --remove-orphans if [[ $FOUND_DIFFS -eq 0 ]]; then Info "no diffs found in query results" diff --git a/systest/21million/test-21million.sh b/systest/21million/test-21million.sh index 22e62f97a9a..52fe6780246 100755 --- a/systest/21million/test-21million.sh +++ b/systest/21million/test-21million.sh @@ -182,12 +182,12 @@ fi if [[ $CLEANUP == all ]]; then Info "bringing down zero and alpha and data volumes" - DockerCompose down -v + DockerCompose down -v --remove-orphans elif [[ $CLEANUP == none ]]; then Info "leaving up zero and alpha" else Info "bringing down zero and alpha only" - DockerCompose down + DockerCompose down --remove-orphans fi exit $FOUND_DIFFS diff --git a/systest/bgindex/test-bgindex.sh b/systest/bgindex/test-bgindex.sh index 85647e2a1af..e90bdb359a7 100755 --- a/systest/bgindex/test-bgindex.sh +++ b/systest/bgindex/test-bgindex.sh @@ -15,10 +15,10 @@ Info "entering directory $SRCDIR" cd $SRCDIR Info "bringing down dgraph cluster and data volumes" -DockerCompose down -v +DockerCompose down -v --remove-orphans Info "bringing up dgraph cluster" -DockerCompose up -d +DockerCompose up -d --remove-orphans Info "waiting for zero to become leader" DockerCompose logs -f alpha1 | grep -q -m1 "Successfully upserted groot account" @@ -32,7 +32,7 @@ Info "running background indexing test" go test -v -tags systest || FOUND_DIFFS=1 Info "bringing down dgraph cluster and data volumes" -DockerCompose down -v +DockerCompose down -v --remove-orphans if [[ $FOUND_DIFFS -eq 0 ]]; then Info "test passed"