diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/test-manager/src/tests/tunnel.rs | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/test/test-manager/src/tests/tunnel.rs b/test/test-manager/src/tests/tunnel.rs index ecae2604c3..4f5d1d7cbb 100644 --- a/test/test-manager/src/tests/tunnel.rs +++ b/test/test-manager/src/tests/tunnel.rs @@ -5,10 +5,10 @@ use super::{ }; use crate::{ network_monitor::{MonitorOptions, start_packet_monitor}, - tests::helpers::{login_with_retries, update_relay_constraints}, + tests::helpers::{geoip_lookup_with_retries, login_with_retries, update_relay_constraints}, }; -use anyhow::Context; +use anyhow::{Context, ensure}; use mullvad_management_interface::MullvadProxyClient; use mullvad_relay_selector::query::builder::RelayQueryBuilder; use mullvad_types::{ @@ -199,6 +199,36 @@ pub async fn test_wireguard_over_shadowsocks( Ok(()) } +/// Use QUIC obfuscation. This tests whether the daemon can establish a QUIC connection. +/// Note that this doesn't verify that the outgoing traffic looks like http traffic (even though it +/// doesn't sound too difficult to do?). +#[test_function] +pub async fn test_wireguard_over_quic( + _: TestContext, + rpc: ServiceClient, + mut mullvad_client: MullvadProxyClient, +) -> anyhow::Result<()> { + log::info!("Enable QUIC as obfuscation method"); + let query = RelayQueryBuilder::wireguard().quic().build(); + apply_settings_from_relay_query(&mut mullvad_client, query).await?; + + log::info!("Connect to WireGuard via QUIC endpoint"); + connect_and_wait(&mut mullvad_client).await?; + + // Verify that the device has a Mullvad exit IP + let conncheck = geoip_lookup_with_retries(&rpc).await; + let mullvad_exit_ip = conncheck + .as_ref() + .is_ok_and(|am_i_mullvad| am_i_mullvad.mullvad_exit_ip); + ensure!( + mullvad_exit_ip, + "Device is either blocked ❌ or leaking 💦 - {:?}", + conncheck, + ); + + Ok(()) +} + /// Test whether bridge mode works. This fails if: /// * No outgoing traffic to the bridge/entry relay is observed from the SUT. /// * The conncheck reports an unexpected exit relay. |
