Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax relay constraints in test_quantum_resistant_multihop_udp2tcp_tunnel #5337

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ impl From<&mullvad_types::relay_constraints::ObfuscationSettings> for proto::Obf
}
}

impl From<mullvad_types::relay_constraints::ObfuscationSettings> for proto::ObfuscationSettings {
fn from(settings: mullvad_types::relay_constraints::ObfuscationSettings) -> Self {
proto::ObfuscationSettings::from(&settings)
}
}

impl From<&mullvad_types::relay_constraints::Udp2TcpObfuscationSettings>
for proto::Udp2TcpObfuscationSettings
{
Expand Down
49 changes: 25 additions & 24 deletions test/test-manager/src/tests/tunnel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,38 +581,39 @@ pub async fn test_quantum_resistant_multihop_udp2tcp_tunnel(
rpc: ServiceClient,
mut mullvad_client: ManagementServiceClient,
) -> Result<(), Error> {
use mullvad_types::{
relay_constraints::{ObfuscationSettings, SelectedObfuscation, Udp2TcpObfuscationSettings},
wireguard::QuantumResistantState,
};
mullvad_client
.set_quantum_resistant_tunnel(types::QuantumResistantState {
state: i32::from(types::quantum_resistant_state::State::On),
})
.set_quantum_resistant_tunnel(types::QuantumResistantState::from(
QuantumResistantState::On,
))
.await
.expect("Failed to enable PQ tunnels");

mullvad_client
.set_obfuscation_settings(types::ObfuscationSettings {
selected_obfuscation: i32::from(
types::obfuscation_settings::SelectedObfuscation::Udp2tcp,
),
udp2tcp: Some(types::Udp2TcpObfuscationSettings { port: None }),
})
.set_obfuscation_settings(types::ObfuscationSettings::from(ObfuscationSettings {
selected_obfuscation: SelectedObfuscation::Udp2Tcp,
udp2tcp: Udp2TcpObfuscationSettings {
port: Constraint::Any,
},
}))
.await
.expect("Failed to enable obfuscation");

let relay_settings = RelaySettingsUpdate::Normal(RelayConstraintsUpdate {
location: Some(Constraint::Only(LocationConstraint::Location(
GeographicLocationConstraint::Country("se".to_string()),
))),
wireguard_constraints: Some(WireguardConstraints {
use_multihop: true,
entry_location: Constraint::Only(LocationConstraint::Location(
GeographicLocationConstraint::Country("se".to_string()),
)),
..Default::default()
}),
..Default::default()
});

update_relay_settings(&mut mullvad_client, relay_settings)
mullvad_client
.update_relay_settings(types::RelaySettingsUpdate::from(
RelaySettingsUpdate::Normal(RelayConstraintsUpdate {
wireguard_constraints: WireguardConstraints {
use_multihop: true,
..Default::default()
}
.into(),
tunnel_protocol: Constraint::Only(TunnelType::Wireguard).into(),
..Default::default()
}),
))
.await
.expect("Failed to update relay settings");

Expand Down
Loading