@@ -8,14 +8,12 @@ use crate::vm::network::DUMMY_LAN_INTERFACE_IP;
8
8
9
9
use mullvad_management_interface:: MullvadProxyClient ;
10
10
use mullvad_types:: relay_constraints:: GeographicLocationConstraint ;
11
- use mullvad_types:: relay_list:: { Relay , RelayEndpointData } ;
12
11
use mullvad_types:: CustomTunnelEndpoint ;
13
12
use mullvad_types:: {
14
13
relay_constraints:: { Constraint , LocationConstraint , RelayConstraints , RelaySettings } ,
15
14
states:: TunnelState ,
16
15
} ;
17
16
use std:: net:: { IpAddr , SocketAddr } ;
18
- use talpid_types:: net:: { Endpoint , TransportProtocol , TunnelEndpoint , TunnelType } ;
19
17
use test_macro:: test_function;
20
18
use test_rpc:: ServiceClient ;
21
19
@@ -238,7 +236,6 @@ pub async fn test_error_state(
238
236
/// * Traffic can be sent and received in the tunnel.
239
237
/// This is done by pinging a single public IP address
240
238
/// and failing if there is no response.
241
- /// * The correct relay is used.
242
239
/// * Leaks outside the tunnel are blocked. Refer to the
243
240
/// `test_connecting_state` documentation for details.
244
241
#[ test_function]
@@ -248,65 +245,12 @@ pub async fn test_connected_state(
248
245
mut mullvad_client : MullvadProxyClient ,
249
246
) -> Result < ( ) , Error > {
250
247
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
-
276
248
//
277
249
// Connect
278
250
//
279
251
280
252
connect_and_wait ( & mut mullvad_client) . await ?;
281
253
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
-
310
254
//
311
255
// Ping outside of tunnel while connected
312
256
//
@@ -319,6 +263,7 @@ pub async fn test_connected_state(
319
263
. expect ( "failed to find non-tun interface" ) ;
320
264
321
265
let detected_probes = send_guest_probes ( rpc. clone ( ) , nontun_iface, inet_destination) . await ?;
266
+
322
267
assert ! (
323
268
detected_probes. none( ) ,
324
269
"observed unexpected outgoing packets: {detected_probes:?}"
0 commit comments