Skip to content

Commit

Permalink
docker: take version suffixes like -dev into account
Browse files Browse the repository at this point in the history
The double and single quotes got too damn complicated, so heredoc we go!

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
  • Loading branch information
Lars Gierth committed Jul 2, 2016
1 parent 4fa85cc commit 5bda53e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/sharness/t0300-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@ test_expect_success "simple ipfs add/cat can be run in docker container" '
test_cmp expected actual
'

test_expect_success "version CurrentCommit is set" '
docker_exec "$DOC_ID" "wget --retry-connrefused --waitretry=1 --timeout=30 -t 30 \
-q -O - http://localhost:8080/version" | grep Commit | cut -d" " -f2 >actual &&
docker_exec "$DOC_ID" "ipfs version --commit" | cut -d- -f2 >expected &&
test -s expected && # check there actually is a commit set
read testcode <<EOF
docker exec -i "$DOC_ID" wget --retry-connrefused --waitretry=1 --timeout=30 -t 30 \
-q -O - http://localhost:8080/version | grep Commit | cut -d" " -f2 >actual ; \
test -s actual ; \
docker exec -i "$DOC_ID" ipfs version --enc json \
| sed 's/^.*"Commit":"\\\([^"]*\\\)".*$/\\\1/g' >expected ; \
test -s expected ; \
test_cmp expected actual
'
EOF
test_expect_success "version CurrentCommit is set" "$testcode"

test_expect_success "stop docker container" '
docker_stop "$DOC_ID"
Expand Down

0 comments on commit 5bda53e

Please sign in to comment.