summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test-manager/src/tests/helpers.rs9
-rw-r--r--test/test-manager/src/tests/mod.rs3
2 files changed, 8 insertions, 4 deletions
diff --git a/test/test-manager/src/tests/helpers.rs b/test/test-manager/src/tests/helpers.rs
index 30f89267cc..3956aa2c15 100644
--- a/test/test-manager/src/tests/helpers.rs
+++ b/test/test-manager/src/tests/helpers.rs
@@ -191,8 +191,9 @@ pub async fn ping_with_timeout(
/// Try to connect to a Mullvad Tunnel.
///
-/// If that fails for whatever reason, the Mullvad daemon ends up in the
-/// [`TunnelState::Error`] state & [`Error::DaemonError`] is returned.
+/// If that fails to begin to connect, [`Error::DaemonError`] is returned. If it fails to connect
+/// after that, the daemon ends up in the [`TunnelState::Error`] state, and
+/// [`Error::UnexpectedErrorState`] is returned.
pub async fn connect_and_wait(mullvad_client: &mut MullvadProxyClient) -> Result<(), Error> {
log::info!("Connecting");
@@ -209,8 +210,8 @@ pub async fn connect_and_wait(mullvad_client: &mut MullvadProxyClient) -> Result
})
.await?;
- if matches!(new_state, TunnelState::Error(..)) {
- return Err(Error::Daemon("daemon entered error state".to_string()));
+ if let TunnelState::Error(error_state) = new_state {
+ return Err(Error::UnexpectedErrorState(error_state));
}
log::info!("Connected");
diff --git a/test/test-manager/src/tests/mod.rs b/test/test-manager/src/tests/mod.rs
index 8bebfe13df..c79c0318e0 100644
--- a/test/test-manager/src/tests/mod.rs
+++ b/test/test-manager/src/tests/mod.rs
@@ -58,6 +58,9 @@ pub enum Error {
#[error(display = "The daemon returned an error: {}", _0)]
Daemon(String),
+ #[error(display = "The daemon ended up in the error state")]
+ UnexpectedErrorState(talpid_types::tunnel::ErrorState),
+
#[error(display = "The gRPC client ran into an error: {}", _0)]
ManagementInterface(#[source] mullvad_management_interface::Error),