1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 02:30:39 +08:00

add sharness test for ipfs key rename

License: MIT
Signed-off-by: Michael Muré <batolettre@gmail.com>
This commit is contained in:
Michael Muré
2017-05-04 21:56:58 +09:00
parent 3aa6d78ee1
commit c0a04a06c3

View File

@ -44,6 +44,24 @@ test_key_cmd() {
ipfs key list | sort > list_out &&
test_cmp list_exp list_out
'
test_expect_success "key rename rename a key" '
ipfs key rename bazed fooed
echo fooed > list_exp &&
echo self >> list_exp
ipfs key list | sort > list_out &&
test_cmp list_exp list_out
'
test_expect_success "key rename can't remove self" '
test_must_fail ipfs key rename self bar 2>&1 | tee key_rename_out &&
grep -q "Error: cannot rename key with name" key_rename_out
'
test_expect_success "key rename can't overwrite self, even with force" '
test_must_fail ipfs key rename -f fooed self 2>&1 | tee key_rename_out &&
grep -q "Error: cannot overwrite key with name" key_rename_out
'
}
test_key_cmd