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

Adds arbitrary port support to t0060-daemon.sh #2370

Merged
merged 4 commits into from
Feb 23, 2016

Conversation

hackergrrl
Copy link
Contributor

Addresses #1936.

Removes all of the hardcoded ports and defaults to non-standard API,
Gateway, and Swarm ports.

A good next step would be to choose ports randomly in a looping fashion, so
that eventually a free set of ports can be found on the test machine.

# - also default ports: might clash with local clients. Failure in that case isn't clear as well because pollEndpoint just uses the already running node
test_expect_success "ipfs daemon --init launches" '
ipfs daemon --init >actual_daemon 2>daemon_err &
test_expect_success "ipfs daemon launches" '
Copy link
Member

Choose a reason for hiding this comment

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

we could reuse the test_launch_ipfs_daemon code here i think

@whyrusleeping
Copy link
Member

one comment, otherwise looks like a good step forward. The next step will be to make it nicely use port zero

@hackergrrl
Copy link
Contributor Author

Awesome call on launch_test_ipfs_daemon -- way better! LGTY?

@chriscool
Copy link
Contributor

LGTM!

apiport=5002
swarmport=4003

API_MADDR="/ip4/0.0.0.0/tcp/$apiport"
Copy link
Member

Choose a reason for hiding this comment

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

now that youre using test_launch_ipfs_daemon it will handle setting these _MADDR variables for you:

https://github.com/ipfs/go-ipfs/blob/master/test/sharness/lib/test-lib.sh#L196

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need them to be set here first, so I can provide them to ipfs init/config before the daemon gets run.

I don't want to clobber what test-lib.sh sets though, so I've renamed the vars and use the globals later on instead.

Removes all of the hardcoded ports and defaults to non-standard API,
Gateway, and Swarm ports.

License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
@hackergrrl
Copy link
Contributor Author

🐴 ping @whyrusleeping for merge

@whyrusleeping
Copy link
Member

alright, LGTM

whyrusleeping added a commit that referenced this pull request Feb 23, 2016
Adds arbitrary port support to t0060-daemon.sh
@whyrusleeping whyrusleeping merged commit 3988031 into ipfs:master Feb 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants