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:
@ -344,3 +344,8 @@ generic_stat() {
|
||||
esac
|
||||
$_STAT "$1"
|
||||
}
|
||||
|
||||
test_check_peerid() {
|
||||
test $(echo "$1" | tr -dC "[:alnum:]" | wc -c | tr -d " ") = "46"
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
|
Reference in New Issue
Block a user