Commit c0a04a06 authored by Michael Muré's avatar Michael Muré

add sharness test for ipfs key rename

License: MIT
Signed-off-by: default avatarMichael Muré <batolettre@gmail.com>
parent 3aa6d78e
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment