Use 127.0.0.1 in tests to avoid firewall warnings

pull/97/head
Dominik Nakamura 4 years ago committed by Sebastian Dröge
parent 714e096ae4
commit f69a7fa035
  1. 8
      tests/communication.rs
  2. 4
      tests/handshakes.rs

@ -30,7 +30,7 @@ async fn communication() {
let (msg_tx, msg_rx) = futures::channel::oneshot::channel();
let f = async move {
let listener = TcpListener::bind("0.0.0.0:12345").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:12345").await.unwrap();
info!("Server ready");
con_tx.send(()).unwrap();
info!("Waiting on next connection");
@ -45,7 +45,7 @@ async fn communication() {
info!("Waiting for server to be ready");
con_rx.await.expect("Server not ready");
let tcp = TcpStream::connect("0.0.0.0:12345")
let tcp = TcpStream::connect("127.0.0.1:12345")
.await
.expect("Failed to connect");
let url = "ws://localhost:12345/";
@ -76,7 +76,7 @@ async fn split_communication() {
let (msg_tx, msg_rx) = futures::channel::oneshot::channel();
let f = async move {
let listener = TcpListener::bind("0.0.0.0:12346").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:12346").await.unwrap();
info!("Server ready");
con_tx.send(()).unwrap();
info!("Waiting on next connection");
@ -91,7 +91,7 @@ async fn split_communication() {
info!("Waiting for server to be ready");
con_rx.await.expect("Server not ready");
let tcp = TcpStream::connect("0.0.0.0:12346")
let tcp = TcpStream::connect("127.0.0.1:12346")
.await
.expect("Failed to connect");
let url = url::Url::parse("ws://localhost:12345/").unwrap();

@ -7,7 +7,7 @@ async fn handshakes() {
let (tx, rx) = futures::channel::oneshot::channel();
let f = async move {
let listener = TcpListener::bind("0.0.0.0:12345").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:12345").await.unwrap();
tx.send(()).unwrap();
while let Ok((connection, _)) = listener.accept().await {
let stream = accept_async(connection).await;
@ -18,7 +18,7 @@ async fn handshakes() {
task::spawn(f);
rx.await.expect("Failed to wait for server to be ready");
let tcp = TcpStream::connect("0.0.0.0:12345")
let tcp = TcpStream::connect("127.0.0.1:12345")
.await
.expect("Failed to connect");
let url = url::Url::parse("ws://localhost:12345/").unwrap();

Loading…
Cancel
Save