Skip to content

Commit

Permalink
Remove explicit disconnects, log probe fail causes
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed Nov 19, 2023
1 parent 5d9a6b6 commit 80039ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
21 changes: 10 additions & 11 deletions test/test-manager/src/tests/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub async fn test_lan(
.await?;
assert!(
detected_probes.none(),
"observed unexpected outgoing LAN packets"
"observed unexpected outgoing LAN packets: {detected_probes:?}"
);

//
Expand All @@ -79,11 +79,9 @@ pub async fn test_lan(
send_guest_probes(rpc.clone(), Some(default_interface), lan_destination).await?;
assert!(
detected_probes.all(),
"did not observe all outgoing LAN packets"
"did not observe all outgoing LAN packets: {detected_probes:?}"
);

disconnect_and_wait(&mut mullvad_client).await?;

Ok(())
}

Expand Down Expand Up @@ -146,7 +144,10 @@ pub async fn test_lockdown(
lan_destination,
)
.await?;
assert!(detected_probes.none(), "observed outgoing packets to LAN");
assert!(
detected_probes.none(),
"observed outgoing packets to LAN: {detected_probes:?}"
);

let detected_probes = send_guest_probes(
rpc.clone(),
Expand All @@ -156,7 +157,7 @@ pub async fn test_lockdown(
.await?;
assert!(
detected_probes.none(),
"observed outgoing packets to internet"
"observed outgoing packets to internet: {detected_probes:?}"
);

//
Expand All @@ -182,7 +183,7 @@ pub async fn test_lockdown(
.await?;
assert!(
detected_probes.all(),
"did not observe some outgoing packets"
"did not observe some outgoing packets: {detected_probes:?}"
);

let detected_probes = send_guest_probes(
Expand All @@ -193,7 +194,7 @@ pub async fn test_lockdown(
.await?;
assert!(
detected_probes.none(),
"observed outgoing packets to internet"
"observed outgoing packets to internet: {detected_probes:?}"
);

//
Expand All @@ -217,7 +218,7 @@ pub async fn test_lockdown(
send_guest_probes(rpc.clone(), Some(default_interface), inet_destination).await?;
assert!(
detected_probes.none(),
"observed outgoing packets to internet"
"observed outgoing packets to internet: {detected_probes:?}"
);

//
Expand All @@ -228,7 +229,5 @@ pub async fn test_lockdown(
.await
.expect("failed to disable lockdown mode");

disconnect_and_wait(&mut mullvad_client).await?;

Ok(())
}
20 changes: 1 addition & 19 deletions test/test-manager/src/tests/tunnel_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,6 @@ pub async fn test_connecting_state(

assert_tunnel_state!(&mut mullvad_client, TunnelState::Connecting { .. });

//
// Disconnect
//

log::info!("Disconnecting");

disconnect_and_wait(&mut mullvad_client).await?;

Ok(())
}

Expand Down Expand Up @@ -257,14 +249,6 @@ pub async fn test_error_state(
"observed unexpected outgoing packets (DNS, lan)"
);

//
// Disconnect
//

log::info!("Disconnecting");

disconnect_and_wait(&mut mullvad_client).await?;

Ok(())
}

Expand Down Expand Up @@ -358,15 +342,13 @@ pub async fn test_connected_state(
send_guest_probes(rpc.clone(), Some(nontun_iface), inet_destination).await?;
assert!(
detected_probes.none(),
"observed unexpected outgoing packets"
"observed unexpected outgoing packets: {detected_probes:?}"
);

assert!(
helpers::using_mullvad_exit(&rpc).await,
"expected Mullvad exit IP"
);

disconnect_and_wait(&mut mullvad_client).await?;

Ok(())
}

0 comments on commit 80039ac

Please sign in to comment.