From 15ece2ca8264d80113d4e5897aa1a770f2ee7ea7 Mon Sep 17 00:00:00 2001 From: Lars Gierth Date: Wed, 18 May 2016 22:10:27 +0200 Subject: [PATCH] docker: add test for ipfs version --commit License: MIT Signed-off-by: Lars Gierth --- test/sharness/t0010-basic-commands.sh | 9 +++++++++ test/sharness/t0300-docker-image.sh | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/test/sharness/t0010-basic-commands.sh b/test/sharness/t0010-basic-commands.sh index 785e5f831406..a77408227879 100755 --- a/test/sharness/t0010-basic-commands.sh +++ b/test/sharness/t0010-basic-commands.sh @@ -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 ' diff --git a/test/sharness/t0300-docker-image.sh b/test/sharness/t0300-docker-image.sh index ec964cd0d7e1..3a67c2d89a49 100755 --- a/test/sharness/t0300-docker-image.sh +++ b/test/sharness/t0300-docker-image.sh @@ -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" '