-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
t0020: simplify peerid check #1625
Conversation
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
@@ -58,11 +58,13 @@ test_expect_success "ipfs config succeeds" ' | |||
test_cmp expected_config actual_config | |||
' | |||
|
|||
test_check_peerid() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Though this could have been moved to the library, to replace https://github.com/ipfs/go-ipfs/pull/1626/files#diff-21a8cbf17e33b82a8fca825aca160f1dR21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this could be moved to the library and used in t0062-daemon-api.sh too.
I don't understand why you say that it could replace the changes you link to though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_check_peerid $(ipfs "$@" id -f="<id>")
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok.
But as the output of ipfs "$@" id -f="<id>"
is already tested with:
ipfs "$@" id -f="<id>" >actual &&
test_cmp expected actual
I think it is better to just use it like this:
test_expect_success "config setup" '
api_fromcfg=$(ipfs config Addresses.API) &&
peerid=$(ipfs config Identity.PeerID) &&
test_check_peerid "$peerid"
'
I plan to do something like that when this PR and PR #1626 are merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check needed in t0062 is a generic check on whether the client works.
License: MIT
Signed-off-by: Christian Couder chriscool@tuxfamily.org