ソースを参照

Fix minor nits in the nuxeo tests which were causing them to fail

Tianon Gravi 10 年 前
コミット
548adc792e
2 ファイル変更22 行追加14 行削除
  1. 21 11
      test/tests/nuxeo-basics/run.sh
  2. 1 3
      test/tests/nuxeo-conf/run.sh

+ 21 - 11
test/tests/nuxeo-basics/run.sh

@@ -15,23 +15,33 @@ trap "docker rm -vf $cid > /dev/null" EXIT
 get() {
 	docker run --rm -i \
 		--link "$cname":nuxeo \
-		"$image" curl -fs \
-		-H "Content-Type:application/json" \
-		-u Administrator:Administrator \
-		http://nuxeo:8080/nuxeo/api/v1/$1 
+		--entrypoint curl \
+		"$image" \
+		-fs \
+			-H "Content-Type:application/json" \
+			-u Administrator:Administrator \
+			"http://nuxeo:8080/nuxeo/api/v1/$1"
 }
 
-. "./../../retry.sh" --tries "$NUXEO_TEST_TRIES" \
-	--sleep "$NUXEO_TEST_SLEEP" \
-	"get default-domain/workspaces"
+python3() {
+	docker run --rm -i \
+		--entrypoint python3 \
+		"$image" \
+		"$@"
+}
 
-PATH1="default-domain/workspaces"
+PATH1='default-domain/workspaces'
+
+. "$dir/../../retry.sh" \
+	--tries "$NUXEO_TEST_TRIES" \
+	--sleep "$NUXEO_TEST_SLEEP" \
+	"get 'path/$PATH1'"
 
 # First get a document by its path to get its id
-DUID=$(get path/$PATH1 | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["uid"];')
+DUID="$(get "path/$PATH1" | python3 -c 'import json, sys; obj = json.load(sys.stdin); print(obj["uid"]);')"
 
 # Then get the same document by its id
-PATH2=$(get id/$DUID | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["path"];')
+PATH2="$(get "id/$DUID" | python3 -c 'import json, sys; obj = json.load(sys.stdin); print(obj["path"]);')"
 
 # Compare both path
-[ "/$PATH1" == "$PATH2" ]
+[ "/$PATH1" = "$PATH2" ]

+ 1 - 3
test/tests/nuxeo-conf/run.sh

@@ -1,7 +1,6 @@
 #!/bin/bash
 set -eo pipefail
 
-
 image="$1"
 
 export NUXEO_DEV_MODE='true'
@@ -11,5 +10,4 @@ docker run --rm -i \
 	-e NUXEO_DEV_MODE \
 	-e NUXEO_AUTOMATION_TRACE \
 	"$image" \
-	./bin/nuxeoctl showconf | grep org.nuxeo 
-
+	nuxeoctl showconf | grep ^org.nuxeo | sort