@cryptotaxi247 / kubo / commits / be6920fe9

Add testcase for key rename command output

License: MIT Signed-off-by: Xiaoyi Wang <wangxiaoyi@hyperchain.cn>

Xiaoyi Wang committed Apr 23, 2018 at 22:33 UTC be6920fe9b34c518e1ad60c8b96aee355af408d0
1 file changed +7
test/sharness/t0165-keystore.sh
+7
@@ -58,6 +58,13 @@ test_key_cmd() {
58 test_cmp list_exp list_out
59 '
60
61 + test_expect_success "key rename rename key output succeeds" '
62 + key_content=$(ipfs key gen key1 --type=rsa --size=2048) &&
63 + ipfs key rename key1 key2 >rs &&
64 + echo "Key $key_content renamed to key2" >expect &&
65 + test_cmp rs expect
66 + '
67 +
68 test_expect_success "key rename can't rename self" '
69 test_must_fail ipfs key rename self bar 2>&1 | tee key_rename_out &&
70 grep -q "Error: cannot rename key with name" key_rename_out