diff options
Diffstat (limited to 'test/test-manager')
| -rw-r--r-- | test/test-manager/src/tests/helpers.rs | 3 | ||||
| -rw-r--r-- | test/test-manager/src/tests/install.rs | 4 | ||||
| -rw-r--r-- | test/test-manager/src/tests/tunnel.rs | 50 | ||||
| -rw-r--r-- | test/test-manager/src/tests/tunnel_state.rs | 8 |
4 files changed, 33 insertions, 32 deletions
diff --git a/test/test-manager/src/tests/helpers.rs b/test/test-manager/src/tests/helpers.rs index 3c645268c4..3ef42751b2 100644 --- a/test/test-manager/src/tests/helpers.rs +++ b/test/test-manager/src/tests/helpers.rs @@ -5,9 +5,10 @@ use crate::network_monitor::{ use futures::StreamExt; use mullvad_management_interface::{client::DaemonEvent, MullvadProxyClient}; use mullvad_types::{ + constraints::Constraint, location::Location, relay_constraints::{ - BridgeSettings, Constraint, GeographicLocationConstraint, LocationConstraint, RelaySettings, + BridgeSettings, GeographicLocationConstraint, LocationConstraint, RelaySettings, }, relay_list::{Relay, RelayList}, states::TunnelState, diff --git a/test/test-manager/src/tests/install.rs b/test/test-manager/src/tests/install.rs index 8676d99b77..7dbf092f5c 100644 --- a/test/test-manager/src/tests/install.rs +++ b/test/test-manager/src/tests/install.rs @@ -5,7 +5,7 @@ use super::helpers::{ use super::{Error, TestContext}; use mullvad_management_interface::MullvadProxyClient; -use mullvad_types::relay_constraints; +use mullvad_types::{constraints::Constraint, relay_constraints}; use test_macro::test_function; use test_rpc::meta::Os; use test_rpc::{mullvad_daemon::ServiceStatus, ServiceClient}; @@ -141,7 +141,7 @@ pub async fn test_upgrade_app(ctx: TestContext, rpc: ServiceClient) -> Result<() let relay_location_was_preserved = match &settings.relay_settings { relay_constraints::RelaySettings::Normal(relay_constraints::RelayConstraints { location: - relay_constraints::Constraint::Only(relay_constraints::LocationConstraint::Location( + Constraint::Only(relay_constraints::LocationConstraint::Location( relay_constraints::GeographicLocationConstraint::Country(country), )), .. diff --git a/test/test-manager/src/tests/tunnel.rs b/test/test-manager/src/tests/tunnel.rs index e4802d20c5..e4bf35bc7a 100644 --- a/test/test-manager/src/tests/tunnel.rs +++ b/test/test-manager/src/tests/tunnel.rs @@ -6,12 +6,16 @@ use crate::network_monitor::{start_packet_monitor, MonitorOptions}; use crate::tests::helpers::login_with_retries; use mullvad_management_interface::MullvadProxyClient; -use mullvad_types::relay_constraints::{ - self, BridgeConstraints, BridgeSettings, BridgeType, Constraint, OpenVpnConstraints, - RelayConstraints, RelaySettings, SelectedObfuscation, TransportPort, - Udp2TcpObfuscationSettings, WireguardConstraints, +use mullvad_relay_selector::query::builder::RelayQueryBuilder; +use mullvad_types::{ + constraints::Constraint, + relay_constraints::{ + self, BridgeConstraints, BridgeSettings, BridgeType, OpenVpnConstraints, RelayConstraints, + RelaySettings, SelectedObfuscation, TransportPort, Udp2TcpObfuscationSettings, + WireguardConstraints, + }, + wireguard, }; -use mullvad_types::wireguard; use std::net::SocketAddr; use talpid_types::net::{ proxy::{CustomProxy, Socks5Local, Socks5Remote}, @@ -295,19 +299,17 @@ pub async fn test_multihop( rpc: ServiceClient, mut mullvad_client: MullvadProxyClient, ) -> Result<(), Error> { - let wireguard_constraints = WireguardConstraints { - use_multihop: true, - ..Default::default() - }; - - let relay_settings = RelaySettings::Normal(RelayConstraints { - wireguard_constraints, - ..Default::default() - }); + let relay_constraints = RelayQueryBuilder::new() + .wireguard() + .multihop() + .into_constraint(); - set_relay_settings(&mut mullvad_client, relay_settings) - .await - .expect("failed to update relay settings"); + set_relay_settings( + &mut mullvad_client, + RelaySettings::Normal(relay_constraints), + ) + .await + .expect("failed to update relay settings"); // // Connect @@ -556,15 +558,13 @@ pub async fn test_quantum_resistant_multihop_udp2tcp_tunnel( .await .expect("Failed to enable obfuscation"); + let relay_constraints = RelayQueryBuilder::new() + .wireguard() + .multihop() + .into_constraint(); + mullvad_client - .set_relay_settings(relay_constraints::RelaySettings::Normal(RelayConstraints { - wireguard_constraints: WireguardConstraints { - use_multihop: true, - ..Default::default() - }, - tunnel_protocol: Constraint::Only(TunnelType::Wireguard), - ..Default::default() - })) + .set_relay_settings(RelaySettings::Normal(relay_constraints)) .await .expect("Failed to update relay settings"); diff --git a/test/test-manager/src/tests/tunnel_state.rs b/test/test-manager/src/tests/tunnel_state.rs index 96f75557af..5e69b33b7a 100644 --- a/test/test-manager/src/tests/tunnel_state.rs +++ b/test/test-manager/src/tests/tunnel_state.rs @@ -12,9 +12,9 @@ use crate::{ use mullvad_management_interface::MullvadProxyClient; use mullvad_types::{ + constraints::Constraint, relay_constraints::{ - Constraint, GeographicLocationConstraint, LocationConstraint, RelayConstraints, - RelaySettings, + GeographicLocationConstraint, LocationConstraint, RelayConstraints, RelaySettings, }, relay_list::{Relay, RelayEndpointData}, states::TunnelState, @@ -275,8 +275,8 @@ pub async fn test_error_state( log::info!("Enter error state"); let relay_settings = RelaySettings::Normal(RelayConstraints { - location: Constraint::Only(LocationConstraint::Location( - GeographicLocationConstraint::Country("xx".to_string()), + location: Constraint::Only(LocationConstraint::from( + GeographicLocationConstraint::country("xx"), )), ..Default::default() }); |
