Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/write-tests-for-split-tunneling-…
Browse files Browse the repository at this point in the history
…des-276'
  • Loading branch information
dlon committed Mar 20, 2024
2 parents 7e62d03 + 6594c6d commit a3a5c67
Show file tree
Hide file tree
Showing 27 changed files with 1,261 additions and 169 deletions.
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

0 comments on commit a3a5c67

Please sign in to comment.