diff options
| author | Joakim Hulthe <joakim.hulthe@mullvad.net> | 2024-08-21 14:24:01 +0200 |
|---|---|---|
| committer | Joakim Hulthe <joakim.hulthe@mullvad.net> | 2024-09-17 11:29:34 +0200 |
| commit | 39bc888ca4fa4d74ed6113a7406da4061afec260 (patch) | |
| tree | df860c52af762132079815fdf307c2e723c72bab | |
| parent | 83b5d571c20c359e027cab30c4f44294a075623a (diff) | |
| download | mullvadvpn-39bc888ca4fa4d74ed6113a7406da4061afec260.tar.xz mullvadvpn-39bc888ca4fa4d74ed6113a7406da4061afec260.zip | |
Add unit test for daita_use_anywhere with singlehop
| -rw-r--r-- | mullvad-relay-selector/tests/relay_selector.rs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/mullvad-relay-selector/tests/relay_selector.rs b/mullvad-relay-selector/tests/relay_selector.rs index 2ac05c8a7c..fc08ee23c1 100644 --- a/mullvad-relay-selector/tests/relay_selector.rs +++ b/mullvad-relay-selector/tests/relay_selector.rs @@ -1489,7 +1489,29 @@ fn test_daita() { assert!(!supports_daita(&exit), "exit relay must not support DAITA"); } wrong_relay => panic!( - "Relay selector should have picked a Wireguard relay, instead chose {wrong_relay:?}" + "Relay selector should have picked two Wireguard relays, instead chose {wrong_relay:?}" + ), + } + + // Should be able to connect to DAITA relay with use_anywhere + let query = RelayQueryBuilder::new() + .wireguard() + .daita() + .daita_use_anywhere(true) + .location(DAITA_RELAY_LOCATION.clone()) + .build(); + let relay = relay_selector + .get_relay_by_query(query) + .expect("Expected to find a relay with daita_use_anywhere"); + match relay { + GetRelay::Wireguard { + inner: WireguardConfig::Singlehop { exit }, + .. + } => { + assert!(supports_daita(&exit), "entry relay must support DAITA"); + } + wrong_relay => panic!( + "Relay selector should have picked a single Wireguard relay, instead chose {wrong_relay:?}" ), } |
