diff options
| author | Markus Pettersson <markus.pettersson@mullvad.net> | 2023-11-17 15:37:13 +0100 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2023-12-06 14:37:06 +0100 |
| commit | 1b930b893fa3fcb06f5fee4affbfb62887d0e68a (patch) | |
| tree | 21b0836c5b5730f844950a2764aa652832f13849 /test/test-manager | |
| parent | ac3e222d031b0f599561c4c30504de5cd3f871a2 (diff) | |
| download | mullvadvpn-1b930b893fa3fcb06f5fee4affbfb62887d0e68a.tar.xz mullvadvpn-1b930b893fa3fcb06f5fee4affbfb62887d0e68a.zip | |
Implement RPC for reading & writing to app cache file
- Implement RPC for writing to a file in a test runner / guest VM.
- Implement RPC for getting app cache directory
- Implement RPC for restarting the app in a test runner / guest vm
- Implement RPC for starting the app in a test runner / guest vm
- Implement RPC for stopping the app in a test runner / guest vm
- Implement `find_cache_traces` on Window & macOS
Diffstat (limited to 'test/test-manager')
| -rw-r--r-- | test/test-manager/src/tests/tunnel_state.rs | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/test/test-manager/src/tests/tunnel_state.rs b/test/test-manager/src/tests/tunnel_state.rs index eb78828fd0..176127d7c5 100644 --- a/test/test-manager/src/tests/tunnel_state.rs +++ b/test/test-manager/src/tests/tunnel_state.rs @@ -1,6 +1,6 @@ use super::helpers::{ - self, connect_and_wait, get_tunnel_state, send_guest_probes, set_relay_settings, - unreachable_wireguard_tunnel, wait_for_tunnel_state, + self, connect_and_wait, disconnect_and_wait, get_tunnel_state, send_guest_probes, + set_relay_settings, unreachable_wireguard_tunnel, wait_for_tunnel_state, }; use super::{ui, Error, TestContext}; use crate::assert_tunnel_state; @@ -335,3 +335,33 @@ pub async fn test_connected_state( Ok(()) } + +/// Verify that the app defaults to the connecting state if it is started with a +/// corrupt state cache. +#[test_function] +pub async fn test_connecting_state_when_corrupted_state_cache( + _: TestContext, + rpc: ServiceClient, + mut mullvad_client: ManagementServiceClient, +) -> Result<(), Error> { + // Enter the disconnected state. Normally this would be preserved when + // restarting the app, i.e. the user would still be disconnected after a + // successfull restart. However, as we will intentionally corrupt the state + // target cache the user should end up in the connecting/connected state, + // *not in the disconnected state, upon restart. + disconnect_and_wait(&mut mullvad_client).await?; + + // Stopping the app should write to the state target cache. + log::info!("Stopping the app"); + rpc.restart_app().await?; + + // Intentionally corrupt the state cache + todo!("Intentionally corrupt the state cache"); + // Start a leak monitor + todo!("Start a leak monitor"); + // Start the app & make sure that we start in the 'connecting state'. The + // side-effect of this is that no network traffic is allowed to leak. + todo!("Start the app"); + assert_tunnel_state!(&mut mullvad_client, TunnelState::Connecting { .. }); + Ok(()) +} |
