summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test-manager/src/tests/dns.rs2
-rw-r--r--test/test-manager/src/tests/helpers.rs27
-rw-r--r--test/test-manager/src/tests/relay_ip_overrides.rs7
-rw-r--r--test/test-manager/src/tests/tunnel.rs5
4 files changed, 15 insertions, 26 deletions
diff --git a/test/test-manager/src/tests/dns.rs b/test/test-manager/src/tests/dns.rs
index d7ea3d021d..69f98450ca 100644
--- a/test/test-manager/src/tests/dns.rs
+++ b/test/test-manager/src/tests/dns.rs
@@ -642,7 +642,7 @@ async fn connect_local_wg_relay(mullvad_client: &mut MullvadProxyClient) -> Resu
.set_quantum_resistant_tunnel(QuantumResistantState::Off)
.await?;
mullvad_client
- .set_daita_settings(DaitaSettings { enabled: false })
+ .set_daita_settings(DaitaSettings::default())
.await?;
let peer_addr: SocketAddr = SocketAddr::new(
diff --git a/test/test-manager/src/tests/helpers.rs b/test/test-manager/src/tests/helpers.rs
index 6c51b1f185..3eb0be0cc2 100644
--- a/test/test-manager/src/tests/helpers.rs
+++ b/test/test-manager/src/tests/helpers.rs
@@ -17,7 +17,6 @@ use mullvad_relay_selector::{
};
use mullvad_types::{
constraints::Constraint,
- location::Location,
relay_constraints::{
GeographicLocationConstraint, LocationConstraint, RelayConstraints, RelaySettings,
},
@@ -710,7 +709,7 @@ pub async fn constrain_to_relay(
..
}
| GetRelay::OpenVpn { exit, .. } => {
- let location = into_constraint(&exit)?;
+ let location = into_constraint(&exit);
let (mut relay_constraints, ..) = query.into_settings();
relay_constraints.location = location;
Ok((exit, relay_constraints))
@@ -736,22 +735,14 @@ pub async fn constrain_to_relay(
/// # Panics
///
/// The relay must have a location set.
-pub fn into_constraint(relay: &Relay) -> anyhow::Result<Constraint<LocationConstraint>> {
- relay
- .location
- .as_ref()
- .map(
- |Location {
- country_code,
- city_code,
- ..
- }| {
- GeographicLocationConstraint::hostname(country_code, city_code, &relay.hostname)
- },
- )
- .map(LocationConstraint::Location)
- .map(Constraint::Only)
- .ok_or(anyhow!("relay is missing location"))
+pub fn into_constraint(relay: &Relay) -> Constraint<LocationConstraint> {
+ let constraint = GeographicLocationConstraint::hostname(
+ relay.location.country_code.clone(),
+ relay.location.city_code.clone(),
+ &relay.hostname,
+ );
+
+ Constraint::Only(LocationConstraint::Location(constraint))
}
/// Ping monitoring made easy!
diff --git a/test/test-manager/src/tests/relay_ip_overrides.rs b/test/test-manager/src/tests/relay_ip_overrides.rs
index 48df8ff0e4..3805412ee9 100644
--- a/test/test-manager/src/tests/relay_ip_overrides.rs
+++ b/test/test-manager/src/tests/relay_ip_overrides.rs
@@ -298,12 +298,7 @@ async fn pick_a_relay(
let relay_ip = relay.ipv4_addr_in;
let hostname = relay.hostname.clone();
- let city = relay
- .location
- .as_ref()
- .ok_or(anyhow!("Got Relay with an unknown location"))?
- .city_code
- .clone();
+ let city = relay.location.city_code.clone();
log::info!("selected {hostname} ({relay_ip})");
let location = GeographicLocationConstraint::Hostname(country, city, hostname.clone()).into();
diff --git a/test/test-manager/src/tests/tunnel.rs b/test/test-manager/src/tests/tunnel.rs
index 575339c5a8..f5d8f6c959 100644
--- a/test/test-manager/src/tests/tunnel.rs
+++ b/test/test-manager/src/tests/tunnel.rs
@@ -410,7 +410,10 @@ pub async fn test_daita(
.await?;
mullvad_client
- .set_daita_settings(wireguard::DaitaSettings { enabled: true })
+ .set_daita_settings(wireguard::DaitaSettings {
+ enabled: true,
+ use_anywhere: false,
+ })
.await
.context("Failed to enable daita")?;