mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-22 06:11:34 +00:00
Merge pull request #85 from tomaka/replace-0-ipv6
Try make IPv6 work on travis
This commit is contained in:
@ -4,6 +4,13 @@ branches:
|
|||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
# Add an IPv6 config - see the corresponding Travis issue
|
||||||
|
# https://github.com/travis-ci/travis-ci/issues/8361
|
||||||
|
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
|
||||||
|
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
|
||||||
|
fi
|
||||||
|
|
||||||
cache: cargo
|
cache: cargo
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -258,7 +258,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn replace_port_0_in_returned_multiaddr() {
|
fn replace_port_0_in_returned_multiaddr_ipv4() {
|
||||||
let core = Core::new().unwrap();
|
let core = Core::new().unwrap();
|
||||||
let tcp = TcpConfig::new(core.handle());
|
let tcp = TcpConfig::new(core.handle());
|
||||||
|
|
||||||
@ -269,6 +269,18 @@ mod tests {
|
|||||||
assert!(!new_addr.to_string().contains("tcp/0"));
|
assert!(!new_addr.to_string().contains("tcp/0"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn replace_port_0_in_returned_multiaddr_ipv6() {
|
||||||
|
let core = Core::new().unwrap();
|
||||||
|
let tcp = TcpConfig::new(core.handle());
|
||||||
|
|
||||||
|
let addr = Multiaddr::new("/ip6/::1/tcp/0").unwrap();
|
||||||
|
assert!(addr.to_string().contains("tcp/0"));
|
||||||
|
|
||||||
|
let (_, new_addr) = tcp.listen_on(addr).unwrap();
|
||||||
|
assert!(!new_addr.to_string().contains("tcp/0"));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn larger_addr_denied() {
|
fn larger_addr_denied() {
|
||||||
let core = Core::new().unwrap();
|
let core = Core::new().unwrap();
|
||||||
|
Reference in New Issue
Block a user