From 4219b70aa11dd20e6591fe8fc8be88bdaf0b4fe9 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Wed, 6 Mar 2024 15:48:19 +0100 Subject: [PATCH] Group platform split tunnel tests under one test --- test/test-manager/src/tests/split_tunnel.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/test/test-manager/src/tests/split_tunnel.rs b/test/test-manager/src/tests/split_tunnel.rs index cdb96a5dd2c1..9902dec231dd 100644 --- a/test/test-manager/src/tests/split_tunnel.rs +++ b/test/test-manager/src/tests/split_tunnel.rs @@ -1,11 +1,23 @@ use mullvad_management_interface::MullvadProxyClient; use std::str; use test_macro::test_function; -use test_rpc::{ExecResult, ServiceClient}; +use test_rpc::{meta::Os, ExecResult, ServiceClient}; -use super::{helpers, TestContext}; +use super::{config::TEST_CONFIG, helpers, TestContext}; + +#[test_function] +pub async fn test_split_tunnel( + ctx: TestContext, + rpc: ServiceClient, + mullvad_client: MullvadProxyClient, +) -> anyhow::Result<()> { + match TEST_CONFIG.os { + Os::Linux => test_split_tunnel_linux(ctx, rpc, mullvad_client).await, + Os::Windows => test_split_tunnel_windows(ctx, rpc, mullvad_client).await, + Os::Macos => todo!("MacOS"), + } +} -#[test_function(target_os = "windows")] pub async fn test_split_tunnel_windows( _: TestContext, rpc: ServiceClient, @@ -69,7 +81,6 @@ pub async fn test_split_tunnel_windows( Ok(()) } -#[test_function(target_os = "linux")] pub async fn test_split_tunnel_linux( _: TestContext, rpc: ServiceClient,