提交 493e5d3b 作者: Juan Batiz-Benet

test: test init output

上级 8d4c2169
......@@ -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
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论