1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-26 07:28:20 +08:00

sharness: generalize test_check_peerid()

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
This commit is contained in:
Christian Couder
2015-09-12 19:00:26 +02:00
parent 65507cb174
commit 5c118a20d7
2 changed files with 5 additions and 4 deletions

View File

@ -344,3 +344,8 @@ generic_stat() {
esac
$_STAT "$1"
}
test_check_peerid() {
test $(echo "$1" | tr -dC "[:alnum:]" | wc -c | tr -d " ") = "46"
}

View File

@ -58,10 +58,6 @@ test_expect_success "ipfs config succeeds" '
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" '
PEERID=$(ipfs config Identity.PeerID) &&
test_check_peerid "$PEERID"