Skip to content
Snippets Groups Projects
Verified Commit e1e03f4c authored by David Runge's avatar David Runge :chipmunk:
Browse files

test: Split tests for retrieval of TLS public key


Split tests for retrieval of TLS public key, as using two separate
fixtures that provide a running container may lead to a blocking test
on faster machines.

Signed-off-by: default avatarDavid Runge <dvzrv@archlinux.org>
parent 048ca0b5
No related branches found
No related tags found
1 merge request!45Fix various issues in the nethsm library
......@@ -365,19 +365,28 @@ async fn cancel_update(
#[ignore = "requires Podman"]
#[rstest]
#[tokio::test]
async fn get_tls_public_key(
#[future] unprovisioned_nethsm: TestResult<(NetHsm, Container<NetHsmImage>)>,
async fn get_tls_public_key_of_provisioned_nethsm(
#[future] nethsm_with_users: TestResult<(NetHsm, Container<NetHsmImage>)>,
) -> TestResult {
let (unprovisioned_nethsm, _container) = unprovisioned_nethsm.await?;
let (nethsm, _container) = nethsm_with_users.await?;
println!("Get TLS certificate of unprovisioned device...");
assert!(unprovisioned_nethsm.get_tls_public_key().is_err());
println!("Get TLS certificate of provisioned device...");
println!("{}", nethsm.get_tls_public_key()?);
assert!(nethsm.get_tls_public_key().is_ok());
Ok(())
}
#[ignore = "requires Podman"]
#[rstest]
#[tokio::test]
async fn get_tls_public_key_of_unprovisioned_nethsm(
#[future] unprovisioned_nethsm: TestResult<(NetHsm, Container<NetHsmImage>)>,
) -> TestResult {
let (unprovisioned_nethsm, _container) = unprovisioned_nethsm.await?;
println!("Get TLS certificate of unprovisioned device...");
assert!(unprovisioned_nethsm.get_tls_public_key().is_err());
Ok(())
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment