aboutsummaryrefslogtreecommitdiffstats
path: root/src/simtest/policy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/simtest/policy.rs')
-rw-r--r--src/simtest/policy.rs28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/simtest/policy.rs b/src/simtest/policy.rs
index 8057660..0453c54 100644
--- a/src/simtest/policy.rs
+++ b/src/simtest/policy.rs
@@ -337,11 +337,16 @@ async fn a_strict_swarm() {
let mallory = crate::access::registry::entry("alice", 1, &crate::access::registry::all_caps());
forge(&c, "alice", "_continuum/users/mallory", mallory).await;
forge(&c, "alice", "config", json!({"mode": "forged"})).await;
+ // By whichever node judges them first: c, told, drops them before the other may.
+ sim.wait_until("the plain writes are refused", SOON, || async {
+ refused(&a).await + refused(&b).await > 0
+ })
+ .await;
+ sim.wait_until("c drops them", SOON, || async {
+ plain(&c, "_continuum/users/mallory").await.is_none()
+ })
+ .await;
for node in [&a, &b] {
- sim.wait_until("the plain writes are refused", SOON, move || async move {
- refused(node).await > 0
- })
- .await;
assert!(plain(node, "_continuum/users/mallory").await.is_none());
assert_eq!(plain(node, "config").await, Some(json!({"mode": "slow"})));
}
@@ -414,13 +419,16 @@ async fn sealed_values() {
let stray = sealed_for(&[alice_key, PublicKey([22; 32])]);
forge(&c, "alice", "secrets/web", json!(stray)).await;
forge(&c, "alice", "secrets/api", json!("hunter2")).await;
+ // By whichever node judges them first: c, told, drops them before the other may.
+ sim.wait_until("the badly sealed writes are refused", SOON, || async {
+ refused(&a).await + refused(&b).await > 0
+ })
+ .await;
+ sim.wait_until("c drops them", SOON, || async {
+ !holds(&c, "secrets/web").await
+ })
+ .await;
for node in [&a, &b] {
- sim.wait_until(
- "the badly sealed writes are refused",
- SOON,
- move || async move { refused(node).await > 0 },
- )
- .await;
assert!(!holds(node, "secrets/web").await);
assert!(!holds(node, "secrets/api").await);
}