Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix key rename command output error #4962

Merged
merged 2 commits into from
May 12, 2018

Conversation

grokcoder
Copy link
Contributor

fix: Error when renaming keys #4953

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

License: MIT
Signed-off-by: Xiaoyi Wang <wangxiaoyi@hyperchain.cn>
@grokcoder grokcoder requested a review from Kubuxu as a code owner April 22, 2018 03:48
Copy link
Member

@magik6k magik6k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Would be great to get a test reproducing this issue before the fix (in test/sharness)

@grokcoder
Copy link
Contributor Author

@magik6k I don't understand, if I have fixed this issue #4953, how to reproduce it.

test_expect_success "ipfs key rename failed reproduce succeeds" ' ipfs init && ipfs key gen --type=rsa --size=2048 key1 && ipfs key rename key1 key2 2>rename_err && EXPECT="expected a KeyRenameOutput as command result" && grep "$EXPECT" rename_err '
this can reproduce before I fix it, but failed if I fixed it.
So could you please explain it more clearly?

@magik6k
Copy link
Member

magik6k commented Apr 23, 2018

this can reproduce before I fix it, but failed if I fixed it

That's what I asked for, a test which will fail before the issue was fixed

I looked at the current keystore tests and it looks like there already is a test for rename - https://github.com/ipfs/go-ipfs/blob/master/test/sharness/t0165-keystore.sh#L53, but only in offline mode

Basically, what you want to do is to replace https://github.com/ipfs/go-ipfs/blob/master/test/sharness/t0165-keystore.sh#L72 with something like

test_key_cmd

test_launch_ipfs_daemon

test_expect_success "cleanup" '
  ipfs key rm fooed
'

test_key_cmd

test_kill_ipfs_daemon

License: MIT
Signed-off-by: Xiaoyi Wang <wangxiaoyi@hyperchain.cn>
@grokcoder
Copy link
Contributor Author

@magik6k thx for explain, the issue what I fixed is the key rename output msg parse error, not the rename function. The rename function is worked but with error output msg.

@Stebalien Stebalien added the RFM label Apr 23, 2018
@whyrusleeping
Copy link
Member

Thanks @grokcoder!

@whyrusleeping whyrusleeping merged commit 053f123 into ipfs:master May 12, 2018
@grokcoder grokcoder deleted the fix/core/commands branch May 13, 2018 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants