docker: take version suffixes like -dev into account
The double and single quotes got too damn complicated, so heredoc we go! License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>
Lars Gierth committed
Jul 2, 2016 at 22:05 UTC
5bda53e55ba9f0b93b33f7489d5bdd60ce748a66
1 file changed
+9
-6
test/sharness/t0300-docker-image.sh
+9
-6
@@ -66,13 +66,16 @@ test_expect_success "simple ipfs add/cat can be run in docker container" '
66
test_cmp expected actual
67
'
68
69
-test_expect_success "version CurrentCommit is set" '
70
- docker_exec "$DOC_ID" "wget --retry-connrefused --waitretry=1 --timeout=30 -t 30 \
71
- -q -O - http://localhost:8080/version" | grep Commit | cut -d" " -f2 >actual &&
72
- docker_exec "$DOC_ID" "ipfs version --commit" | cut -d- -f2 >expected &&
73
- test -s expected && # check there actually is a commit set
69
+read testcode <<EOF
70
+ docker exec -i "$DOC_ID" wget --retry-connrefused --waitretry=1 --timeout=30 -t 30 \
71
+ -q -O - http://localhost:8080/version | grep Commit | cut -d" " -f2 >actual ; \
72
+ test -s actual ; \
73
+ docker exec -i "$DOC_ID" ipfs version --enc json \
74
+ | sed 's/^.*"Commit":"\\\([^"]*\\\)".*$/\\\1/g' >expected ; \
75
+ test -s expected ; \
76
test_cmp expected actual
75
-'
77
+EOF
78
+test_expect_success "version CurrentCommit is set" "$testcode"
79
80
test_expect_success "stop docker container" '
81
docker_stop "$DOC_ID"