Skip to content

Commit

Permalink
Merge branch 'test/fix-relay-assumptions'
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Pettersson <[email protected]>
  • Loading branch information
MarkusPettersson98 committed Oct 20, 2023
2 parents b2a9781 + 20dd36b commit 12167d2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
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

0 comments on commit 12167d2

Please sign in to comment.