From 493e5d3b3ea63ecb908c4f04b50a4d77ea219fd1 Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet <juan@benet.ai> Date: Mon, 17 Nov 2014 21:56:41 -0800 Subject: [PATCH] test: test init output --- test/t0020-init.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/test/t0020-init.sh b/test/t0020-init.sh index 7ca9d1653..47199c811 100755 --- a/test/t0020-init.sh +++ b/test/t0020-init.sh @@ -10,7 +10,7 @@ test_description="Test init command" test_expect_success "ipfs init succeeds" ' export IPFS_DIR="$(pwd)/.go-ipfs" && - ipfs init + ipfs init >actual_init ' test_expect_success ".go-ipfs/ has been created" ' @@ -25,5 +25,20 @@ test_expect_success "ipfs config succeeds" ' test_cmp expected actual ' -test_done +test_expect_success "ipfs peer id looks good" ' + PEERID=$(ipfs config Identity.PeerID) && + echo $PEERID | tr -dC "[:alnum:]" | wc -c | tr -d " " >actual && + echo "46" >expected && + test_cmp expected actual +' +test_expect_success "ipfs init output looks good" ' + STARTHASH="QmYpv2VEsxzTTXRYX3PjDg961cnJE3kY1YDXLycHGQ3zZB" && + echo "initializing ipfs node at $IPFS_DIR" >expected && + echo "generating key pair...done" >>expected && + echo "peer identity: $PEERID" >>expected && + echo "\nto get started, enter: ipfs cat $STARTHASH" >>expected && + test_cmp expected actual_init +' + +test_done -- GitLab