提交 a3f0a6eb 作者: Juan Benet

Merge pull request #1625 from ipfs/check-peerid

t0020: simplify peerid check
...@@ -58,11 +58,13 @@ test_expect_success "ipfs config succeeds" ' ...@@ -58,11 +58,13 @@ test_expect_success "ipfs config succeeds" '
test_cmp expected_config actual_config test_cmp expected_config actual_config
' '
test_check_peerid() {
test $(echo "$1" | tr -dC "[:alnum:]" | wc -c | tr -d " ") = "46"
}
test_expect_success "ipfs peer id looks good" ' test_expect_success "ipfs peer id looks good" '
PEERID=$(ipfs config Identity.PeerID) && PEERID=$(ipfs config Identity.PeerID) &&
echo $PEERID | tr -dC "[:alnum:]" | wc -c | tr -d " " >actual_peerid && test_check_peerid "$PEERID"
echo "46" >expected_peerid &&
test_cmp expected_peerid actual_peerid
' '
test_expect_success "ipfs init output looks good" ' test_expect_success "ipfs init output looks good" '
...@@ -90,9 +92,7 @@ test_expect_success "'ipfs init --empty-repo' succeeds" ' ...@@ -90,9 +92,7 @@ test_expect_success "'ipfs init --empty-repo' succeeds" '
test_expect_success "ipfs peer id looks good" ' test_expect_success "ipfs peer id looks good" '
PEERID=$(ipfs config Identity.PeerID) && PEERID=$(ipfs config Identity.PeerID) &&
echo $PEERID | tr -dC "[:alnum:]" | wc -c | tr -d " " >actual_peerid && test_check_peerid "$PEERID"
echo "46" >expected_peerid &&
test_cmp expected_peerid actual_peerid
' '
test_expect_success "'ipfs init --empty-repo' output looks good" ' test_expect_success "'ipfs init --empty-repo' output looks good" '
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论