From be6920fe9b34c518e1ad60c8b96aee355af408d0 Mon Sep 17 00:00:00 2001 From: Xiaoyi Wang Date: Mon, 23 Apr 2018 22:33:31 +0800 Subject: [PATCH] Add testcase for key rename command output License: MIT Signed-off-by: Xiaoyi Wang --- test/sharness/t0165-keystore.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/sharness/t0165-keystore.sh b/test/sharness/t0165-keystore.sh index 39c3b5dd9..80d39ab82 100755 --- a/test/sharness/t0165-keystore.sh +++ b/test/sharness/t0165-keystore.sh @@ -58,6 +58,13 @@ test_key_cmd() { test_cmp list_exp list_out ' + test_expect_success "key rename rename key output succeeds" ' + key_content=$(ipfs key gen key1 --type=rsa --size=2048) && + ipfs key rename key1 key2 >rs && + echo "Key $key_content renamed to key2" >expect && + test_cmp rs expect + ' + test_expect_success "key rename can't rename 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