1pub mod attacks;
2pub mod corpus;
3pub mod differential;
4pub mod mutators;
5pub mod report;
6pub mod subprocess;
7pub mod suite;
8
9pub use report::{AttackResult, AttackStatus, SimReport};
10pub use suite::{run_suite, SuiteConfig, SuiteTier, TimeBudget};
11
12#[cfg(test)]
13mod tests {
14 use super::*;
15 use std::path::PathBuf;
16
17 #[test]
18 fn test_quick_suite() {
19 let cfg = SuiteConfig {
20 tier: SuiteTier::Quick,
21 target_bundle: PathBuf::from("placeholder"), seed: 42,
23 verify_limits: None,
24 };
25
26 let report = run_suite(cfg).expect("Suite failed to run");
27
28 if report.summary.bypassed > 0 {
30 println!("{}", serde_json::to_string_pretty(&report).unwrap());
31 }
32
33 assert_eq!(
36 report.summary.bypassed, 0,
37 "SECURITY: {} attacks bypassed verification",
38 report.summary.bypassed
39 );
40 assert!(
42 report.summary.blocked >= 1,
43 "SANITY: no attacks were blocked — suite may not have run"
44 );
45 let differential_ran = report
47 .results
48 .iter()
49 .any(|r| r.name == "differential.invariants");
50 assert!(
51 report.summary.passed >= 1 || differential_ran,
52 "SANITY: no checks passed and differential did not run — suite may not have run"
53 );
54 for r in &report.results {
59 let is_chaos_io = r.name.starts_with("chaos.io_fault.");
60 match r.status {
61 AttackStatus::Blocked | AttackStatus::Passed => {} AttackStatus::Error if is_chaos_io => {} _ => panic!(
64 "Unexpected status {:?} for '{}': {:?}",
65 r.status, r.name, r.message
66 ),
67 }
68 }
69 }
70}