Integrate independent signed Windows clocks with native Linux lease guards
Rust development slice / linux (push) Failing after 6s
Rust development slice / linux (push) Failing after 6s
This commit is contained in:
@@ -1010,6 +1010,44 @@ fn clean_ready_shared_lock_and_reopen_start_closed() {
|
||||
assert!(!sync.can_start(&f.db, &f.guard, 1, &f.clock, &f.boot));
|
||||
}
|
||||
#[test]
|
||||
fn system_helper_lease_denies_interval_upper_at_or_after_deadline() {
|
||||
struct IntervalClock {
|
||||
wall: DateTime<Utc>,
|
||||
upper: DateTime<Utc>,
|
||||
}
|
||||
impl Clock for IntervalClock {
|
||||
fn now(&self) -> anyhow::Result<DateTime<Utc>> {
|
||||
Ok(self.wall)
|
||||
}
|
||||
fn reading(&self) -> anyhow::Result<rmm_agent_core::reconcile::ClockReading> {
|
||||
Ok(rmm_agent_core::reconcile::ClockReading {
|
||||
own_wall: self.wall,
|
||||
upper: self.upper,
|
||||
})
|
||||
}
|
||||
}
|
||||
for overshoot in [Duration::zero(), Duration::nanoseconds(1)] {
|
||||
let mut f = Fixture::new();
|
||||
f.identity = HelperIdentity::System;
|
||||
let mut sync = f.sync();
|
||||
let snapshot = f.snapshot(&mut sync, 1);
|
||||
let raw = f.request(&snapshot);
|
||||
let decision = f.decision(&snapshot, &raw, 1, true);
|
||||
assert!(f.apply(&mut sync, &decision, &raw).unwrap().ready);
|
||||
let wall = decision.valid_until - Duration::milliseconds(10);
|
||||
let point = TestClock {
|
||||
now: wall,
|
||||
trusted: true,
|
||||
};
|
||||
assert!(sync.can_start(&f.db, &f.guard, 1, &point, &f.boot));
|
||||
let bounded = IntervalClock {
|
||||
wall,
|
||||
upper: decision.valid_until + overshoot,
|
||||
};
|
||||
assert!(!sync.can_start(&f.db, &f.guard, 1, &bounded, &f.boot));
|
||||
}
|
||||
}
|
||||
#[test]
|
||||
fn exact_signatures_fake_key_wrong_domain_and_all_identity_bindings() {
|
||||
let mut f = Fixture::new();
|
||||
let mut sync = f.sync();
|
||||
|
||||
Reference in New Issue
Block a user