summaryrefslogtreecommitdiffhomepage
path: root/test/test-manager/src/tests/settings.rs
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2024-01-08 15:20:24 +0100
committerMarkus Pettersson <markus.pettersson@mullvad.net>2024-01-15 08:13:40 +0100
commit87a76504844905eaec9d3d7b705f5c3b2fa612ae (patch)
tree15ff7f4711f3d76ec6c0d66fcf6c6d195f5aaf88 /test/test-manager/src/tests/settings.rs
parentc4157b3d961f71f64eb218c32b5c49ffb33baff1 (diff)
downloadmullvadvpn-87a76504844905eaec9d3d7b705f5c3b2fa612ae.tar.xz
mullvadvpn-87a76504844905eaec9d3d7b705f5c3b2fa612ae.zip
Use type safe Mullvad protobuf client over generated dito
Re-write some code in the test framework to prefer the type safe wrapper around the Mullvad app gRPC client instead of its auto-generated dito. `ManagementServiceClient` is automatically generated from the protobuf definitions found in `management_interface.proto`, and contains some very crude types. The `MullvadProxyClient` is a type-safe wrapper around `ManagementServiceClient` which performs conversions & validation of the data types from the gRPC server (the daemon) to their respective mappings in the `talpid-*` and `mullvad-*` crates. These types are more ergonomic to work with, and since we already have the conversions in place we should prefer those.
Diffstat (limited to 'test/test-manager/src/tests/settings.rs')
-rw-r--r--test/test-manager/src/tests/settings.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test-manager/src/tests/settings.rs b/test/test-manager/src/tests/settings.rs
index d2bde57fcc..5fdd298de1 100644
--- a/test/test-manager/src/tests/settings.rs
+++ b/test/test-manager/src/tests/settings.rs
@@ -1,10 +1,10 @@
use super::helpers;
-use super::helpers::{connect_and_wait, get_tunnel_state, send_guest_probes};
+use super::helpers::{connect_and_wait, send_guest_probes};
use super::{Error, TestContext};
use crate::assert_tunnel_state;
use crate::vm::network::DUMMY_LAN_INTERFACE_IP;
-use mullvad_management_interface::ManagementServiceClient;
+use mullvad_management_interface::MullvadProxyClient;
use mullvad_types::states::TunnelState;
use std::net::{IpAddr, SocketAddr};
use test_macro::test_function;
@@ -19,7 +19,7 @@ use test_rpc::ServiceClient;
pub async fn test_lan(
_: TestContext,
rpc: ServiceClient,
- mut mullvad_client: ManagementServiceClient,
+ mut mullvad_client: MullvadProxyClient,
) -> Result<(), Error> {
let lan_destination = SocketAddr::new(IpAddr::V4(DUMMY_LAN_INTERFACE_IP), 1234);
@@ -101,7 +101,7 @@ pub async fn test_lan(
pub async fn test_lockdown(
_: TestContext,
rpc: ServiceClient,
- mut mullvad_client: ManagementServiceClient,
+ mut mullvad_client: MullvadProxyClient,
) -> Result<(), Error> {
let lan_destination: SocketAddr = SocketAddr::new(IpAddr::V4(DUMMY_LAN_INTERFACE_IP), 1337);
let inet_destination: SocketAddr = "1.1.1.1:1337".parse().unwrap();