Skip to content

Commit 228bb05

Browse files
committed
Add local SOCKS bridge test
1 parent 264134a commit 228bb05

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/test-manager/src/tests/tunnel.rs

+13-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use mullvad_types::relay_constraints::{
1212
};
1313
use mullvad_types::wireguard;
1414
use talpid_types::net::{
15-
proxy::{CustomProxy, Socks5Remote},
15+
proxy::{CustomProxy, Socks5Local, Socks5Remote},
1616
TransportProtocol, TunnelType,
1717
};
1818
use test_macro::test_function;
@@ -676,6 +676,11 @@ pub async fn test_local_socks_bridge(
676676
rpc: ServiceClient,
677677
mut mullvad_client: MullvadProxyClient,
678678
) -> Result<(), Error> {
679+
let socks_server = rpc
680+
.start_socks_server("127.0.0.1:0".parse().unwrap())
681+
.await
682+
.expect("failed to start SOCKS server");
683+
679684
mullvad_client
680685
.set_bridge_state(relay_constraints::BridgeState::On)
681686
.await
@@ -685,10 +690,13 @@ pub async fn test_local_socks_bridge(
685690
.set_bridge_settings(BridgeSettings {
686691
bridge_type: BridgeType::Custom,
687692
normal: BridgeConstraints::default(),
688-
custom: Some(CustomProxy::Socks5Remote(Socks5Remote::new((
689-
crate::vm::network::NON_TUN_GATEWAY,
690-
crate::vm::network::SOCKS5_PORT,
691-
)))),
693+
custom: Some(CustomProxy::Socks5Local(Socks5Local::new(
694+
(
695+
crate::vm::network::NON_TUN_GATEWAY,
696+
crate::vm::network::SOCKS5_PORT,
697+
),
698+
socks_server.bind_addr().port(),
699+
))),
692700
})
693701
.await
694702
.expect("failed to update bridge settings");

0 commit comments

Comments
 (0)