diff options
| author | David Lönnhager <david.l@mullvad.net> | 2024-08-13 15:11:09 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2024-08-14 09:13:07 +0200 |
| commit | ce318dada13fb94763a988a06b90ef48bdcbd9bf (patch) | |
| tree | 44da5596cd586230bdf188bd6bdfd69718c8db2b | |
| parent | a2de5327b9241252b30f92bdc99ec9dd9efaa12a (diff) | |
| download | mullvadvpn-ce318dada13fb94763a988a06b90ef48bdcbd9bf.tar.xz mullvadvpn-ce318dada13fb94763a988a06b90ef48bdcbd9bf.zip | |
Remove test test_connecting_state_when_corrupted_state_cache
This is covered by unit tests now
| -rw-r--r-- | test/test-manager/src/tests/tunnel_state.rs | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/test/test-manager/src/tests/tunnel_state.rs b/test/test-manager/src/tests/tunnel_state.rs index 031a669db4..5fd81f3375 100644 --- a/test/test-manager/src/tests/tunnel_state.rs +++ b/test/test-manager/src/tests/tunnel_state.rs @@ -401,52 +401,3 @@ 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, - mullvad_client: MullvadProxyClient, -) -> Result<(), Error> { - // The test should start in a 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. - - // Stopping the app should write to the state target cache. - log::info!("Stopping the app"); - rpc.stop_mullvad_daemon().await?; - - // Intentionally corrupt the state cache. Note that we can not simply remove - // the cache, as this will put the app in the default target state which is - // 'unsecured'. - log::info!("Figuring out where state cache resides on test runner .."); - let state_cache = rpc - .find_mullvad_app_cache_dir() - .await? - .join("target-start-state.json"); - log::info!( - "Intentionally writing garbage to the state cache {file}", - file = state_cache.display() - ); - rpc.write_file(state_cache, "cookie was here".into()) - .await?; - - // 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. - log::info!("Starting the app back up again"); - rpc.start_mullvad_daemon().await?; - wait_for_tunnel_state(mullvad_client.clone(), |state| !state.is_disconnected()).await - .inspect_err(|_| { - log::error!("App did not start in an expected state. \ - App is not in either `Connecting` or `Connected` state after starting with corrupt state cache! \ - There is a possibility of leaks during app startup "); - })?; - log::info!("App successfully recovered from a corrupt tunnel state cache."); - - Ok(()) -} |
