Skip to content

Commit

Permalink
docker: add test for ipfs version --commit
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
  • Loading branch information
Lars Gierth committed May 18, 2016
1 parent 60e7fd4 commit 15ece2c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/sharness/t0010-basic-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ test_expect_success "ipfs version output looks good" '
test_fsh cat version.txt
'

test_expect_success "version --commit succeeds" '
ipfs version --commit >version_commit.txt
'

test_expect_success "ipfs version --commit output looks good" '
egrep "^ipfs version [0-9]+\.[0-9]+\.[0-9]-[0-9a-f]{7}" version_commit.txt >/dev/null ||
test_fsh cat version_commit.txt
'

test_expect_success "ipfs help succeeds" '
ipfs help >help.txt
'
Expand Down
6 changes: 6 additions & 0 deletions test/sharness/t0300-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ test_expect_success "simple ipfs add/cat can be run in docker container" '
test_cmp expected actual
'

test_expect_success "version CurrentCommit is set" '
actual=$(docker_exec "$DOC_ID" "wget --retry-connrefused --waitretry=1 --timeout=30 -t 30 \
-q -O - http://localhost:8080/version" | grep CurrentCommit | cut -d" " -f2)
test_cmp 7 ${#actual}
'

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

0 comments on commit 15ece2c

Please sign in to comment.