eggress_testkit/oracle/
mod.rs1pub mod observations;
14pub mod probes;
15pub mod profile;
16pub mod report;
17pub mod scenario;
18pub mod schema;
19pub mod supervisor;
20
21use std::time::Duration;
22
23pub const ORACLE_GATE_VAR: &str = "EGRESS_PPROXY_CERTIFY";
25
26pub fn oracle_gate_enabled() -> bool {
28 std::env::var(ORACLE_GATE_VAR)
29 .map(|v| v == "1")
30 .unwrap_or(false)
31}
32
33pub fn require_oracle_gate() {
35 if !oracle_gate_enabled() {
36 panic!(
37 "oracle tests require {}=1 and pproxy=={}",
38 ORACLE_GATE_VAR,
39 crate::differential::PINNED_PPROXY_VERSION
40 );
41 }
42 if !pproxy_available() {
43 panic!(
44 "pproxy not available; install with: pip install pproxy=={}",
45 crate::differential::PINNED_PPROXY_VERSION
46 );
47 }
48}
49
50fn pproxy_available() -> bool {
51 let python = crate::differential::find_python_binary();
52 std::process::Command::new(&python)
53 .args(["-c", "import pproxy"])
54 .stdout(std::process::Stdio::null())
55 .stderr(std::process::Stdio::null())
56 .status()
57 .map(|s| s.success())
58 .unwrap_or(false)
59}
60
61pub const DEFAULT_SCENARIO_TIMEOUT: Duration = Duration::from_secs(15);
63
64pub const DEFAULT_STARTUP_TIMEOUT: Duration = Duration::from_secs(5);
66
67pub const DEFAULT_IO_TIMEOUT: Duration = Duration::from_secs(3);