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

Write e2e tests for split tunneling #5906

Merged
merged 10 commits into from
Mar 20, 2024
9 changes: 0 additions & 9 deletions mullvad-management-interface/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use mullvad_types::{
version::AppVersionInfo,
wireguard::{PublicKey, QuantumResistantState, RotationInterval},
};
#[cfg(target_os = "windows")]
use std::path::Path;
use std::str::FromStr;
#[cfg(target_os = "windows")]
Expand Down Expand Up @@ -592,7 +591,6 @@ impl MullvadProxyClient {
.map(drop)
}

#[cfg(target_os = "linux")]
pub async fn get_split_tunnel_processes(&mut self) -> Result<Vec<i32>> {
use futures::TryStreamExt;

Expand All @@ -605,7 +603,6 @@ impl MullvadProxyClient {
procs.try_collect().await.map_err(Error::Rpc)
}

#[cfg(target_os = "linux")]
pub async fn add_split_tunnel_process(&mut self, pid: i32) -> Result<()> {
self.0
.add_split_tunnel_process(pid)
Expand All @@ -614,7 +611,6 @@ impl MullvadProxyClient {
Ok(())
}

#[cfg(target_os = "linux")]
pub async fn remove_split_tunnel_process(&mut self, pid: i32) -> Result<()> {
self.0
.remove_split_tunnel_process(pid)
Expand All @@ -623,7 +619,6 @@ impl MullvadProxyClient {
Ok(())
}

#[cfg(target_os = "linux")]
pub async fn clear_split_tunnel_processes(&mut self) -> Result<()> {
self.0
.clear_split_tunnel_processes(())
Expand All @@ -632,7 +627,6 @@ impl MullvadProxyClient {
Ok(())
}

#[cfg(target_os = "windows")]
pub async fn add_split_tunnel_app<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
let path = path.as_ref().to_str().ok_or(Error::PathMustBeUtf8)?;
self.0
Expand All @@ -642,7 +636,6 @@ impl MullvadProxyClient {
Ok(())
}

#[cfg(target_os = "windows")]
pub async fn remove_split_tunnel_app<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
let path = path.as_ref().to_str().ok_or(Error::PathMustBeUtf8)?;
self.0
Expand All @@ -652,7 +645,6 @@ impl MullvadProxyClient {
Ok(())
}

#[cfg(target_os = "windows")]
pub async fn clear_split_tunnel_apps(&mut self) -> Result<()> {
self.0
.clear_split_tunnel_apps(())
Expand All @@ -661,7 +653,6 @@ impl MullvadProxyClient {
Ok(())
}

#[cfg(target_os = "windows")]
pub async fn set_split_tunnel_state(&mut self, state: bool) -> Result<()> {
self.0
.set_split_tunnel_state(state)
Expand Down
184 changes: 179 additions & 5 deletions test/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ rust-version = "1.75.0"

[workspace]
resolver = "2"
members = ["test-manager", "test-runner", "test-rpc", "socks-server"]
members = [
"test-manager",
"test-runner",
"test-rpc",
"socks-server",
"connection-checker",
]

[workspace.lints.rust]
rust_2018_idioms = "deny"
Expand Down
Loading
Loading