Skip to content

Commit

Permalink
Print detected tested guest OS version
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed Apr 8, 2024
1 parent 7f4ad14 commit 5eb50dd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/test-manager/src/run_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ pub async fn run(
let mullvad_client =
mullvad_daemon::new_rpc_client(connection_handle, mullvad_daemon_transport);

print_os_version(&client).await;

let mut tests: Vec<_> = inventory::iter::<tests::TestMetadata>()
.filter(|test| test.should_run_on_os(TEST_CONFIG.os))
.collect();
Expand Down Expand Up @@ -220,3 +222,14 @@ where
result,
}
}

async fn print_os_version(client: &ServiceClient) {
match client.get_os_version().await {
Ok(version) => {
log::debug!("Guest OS version: {version}");
}
Err(error) => {
log::debug!("Failed to obtain guest OS version: {error}");
}
}
}
10 changes: 10 additions & 0 deletions test/test-rpc/src/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ pub enum OsVersion {
Windows(WindowsVersion),
}

impl std::fmt::Display for OsVersion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
OsVersion::Linux => f.write_str("Linux"),
OsVersion::Macos(version) => write!(f, "macOS {}", version.major),
OsVersion::Windows(version) => write!(f, "Windows {}", version.major),
}
}
}

#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
pub struct MacosVersion {
pub major: u32,
Expand Down

0 comments on commit 5eb50dd

Please sign in to comment.