Skip to content

Commit

Permalink
Improve shamir_setup_create::ok test
Browse files Browse the repository at this point in the history
  • Loading branch information
vxgmichel committed Nov 8, 2024
1 parent 09d8178 commit 7082f3d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion libparsec/crates/client/tests/unit/client/shamir_setup_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use libparsec_types::prelude::*;

use super::utils::client_factory;

#[parsec_test(testbed = "coolorg")]
#[parsec_test(testbed = "coolorg", with_server)]
async fn ok(env: &TestbedEnv) {
let alice = env.local_device("alice@dev1");
let client = client_factory(&env.discriminant_dir, alice.clone()).await;
Expand All @@ -18,4 +18,18 @@ async fn ok(env: &TestbedEnv) {
.shamir_setup_create(share_recipients, 1)
.await
.unwrap();

// The `shamir_setup_create` already polls the server for new certificates,
// But we do it once more to check its idempotent behavior
client.poll_server_for_new_certificates().await.unwrap();

// Also check that Bob can successfully retrieve the new certificates
let bob = env.local_device("bob@dev1");
let client = client_factory(&env.discriminant_dir, bob.clone()).await;
client.poll_server_for_new_certificates().await.unwrap();

// Also check that Mallory is unaffected
let mallory = env.local_device("mallory@dev1");
let client = client_factory(&env.discriminant_dir, mallory.clone()).await;
client.poll_server_for_new_certificates().await.unwrap();
}

0 comments on commit 7082f3d

Please sign in to comment.