Skip to content

Commit 24971b8

Browse files
WIP do not test the relay selector in test_connected_state
1 parent 623df1a commit 24971b8

File tree

1 file changed

+1
-56
lines changed

1 file changed

+1
-56
lines changed

test/test-manager/src/tests/tunnel_state.rs

+1-56
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ use crate::vm::network::DUMMY_LAN_INTERFACE_IP;
88

99
use mullvad_management_interface::MullvadProxyClient;
1010
use mullvad_types::relay_constraints::GeographicLocationConstraint;
11-
use mullvad_types::relay_list::{Relay, RelayEndpointData};
1211
use mullvad_types::CustomTunnelEndpoint;
1312
use mullvad_types::{
1413
relay_constraints::{Constraint, LocationConstraint, RelayConstraints, RelaySettings},
1514
states::TunnelState,
1615
};
1716
use std::net::{IpAddr, SocketAddr};
18-
use talpid_types::net::{Endpoint, TransportProtocol, TunnelEndpoint, TunnelType};
1917
use test_macro::test_function;
2018
use test_rpc::ServiceClient;
2119

@@ -238,7 +236,6 @@ pub async fn test_error_state(
238236
/// * Traffic can be sent and received in the tunnel.
239237
/// This is done by pinging a single public IP address
240238
/// and failing if there is no response.
241-
/// * The correct relay is used.
242239
/// * Leaks outside the tunnel are blocked. Refer to the
243240
/// `test_connecting_state` documentation for details.
244241
#[test_function]
@@ -248,65 +245,12 @@ pub async fn test_connected_state(
248245
mut mullvad_client: MullvadProxyClient,
249246
) -> Result<(), Error> {
250247
let inet_destination = "1.1.1.1:1337".parse().unwrap();
251-
252-
//
253-
// Set relay to use
254-
//
255-
256-
log::info!("Select relay");
257-
258-
let relay_filter = |relay: &Relay| {
259-
relay.active && matches!(relay.endpoint_data, RelayEndpointData::Wireguard(_))
260-
};
261-
262-
let relay = helpers::filter_relays(&mut mullvad_client, relay_filter)
263-
.await?
264-
.pop()
265-
.unwrap();
266-
267-
let relay_settings = RelaySettings::Normal(RelayConstraints {
268-
location: helpers::into_constraint(&relay),
269-
..Default::default()
270-
});
271-
272-
set_relay_settings(&mut mullvad_client, relay_settings)
273-
.await
274-
.expect("failed to update relay settings");
275-
276248
//
277249
// Connect
278250
//
279251

280252
connect_and_wait(&mut mullvad_client).await?;
281253

282-
//
283-
// Verify that endpoint was selected
284-
//
285-
286-
match mullvad_client.get_tunnel_state().await? {
287-
TunnelState::Connected {
288-
endpoint:
289-
TunnelEndpoint {
290-
endpoint:
291-
Endpoint {
292-
address: SocketAddr::V4(addr),
293-
protocol: TransportProtocol::Udp,
294-
},
295-
// TODO: Consider the type of `relay` / `relay_filter` instead
296-
tunnel_type: TunnelType::Wireguard,
297-
quantum_resistant: _,
298-
proxy: None,
299-
obfuscation: None,
300-
entry_endpoint: None,
301-
tunnel_interface: _,
302-
},
303-
..
304-
} => {
305-
assert_eq!(*addr.ip(), relay.ipv4_addr_in);
306-
}
307-
actual => panic!("unexpected tunnel state: {:?}", actual),
308-
}
309-
310254
//
311255
// Ping outside of tunnel while connected
312256
//
@@ -319,6 +263,7 @@ pub async fn test_connected_state(
319263
.expect("failed to find non-tun interface");
320264

321265
let detected_probes = send_guest_probes(rpc.clone(), nontun_iface, inet_destination).await?;
266+
322267
assert!(
323268
detected_probes.none(),
324269
"observed unexpected outgoing packets: {detected_probes:?}"

0 commit comments

Comments
 (0)