feat: add local doctor checks

This commit is contained in:
Eric Wendland 2026-07-05 22:39:15 +02:00
commit 12e6815f8d
7 changed files with 409 additions and 7 deletions

View file

@ -462,6 +462,25 @@ fn wait_daemon_reports_json_timeout_without_daemon() {
assert!(report["attempts"].as_u64().expect("attempts") >= 1);
}
#[test]
fn doctor_reports_json_failures_without_daemon() {
let home = tempfile::tempdir().expect("tempdir");
let output = run_geth(home.path(), &["--json", "doctor"]);
assert!(!output.status.success());
let report =
serde_json::from_slice::<serde_json::Value>(&output.stdout).expect("decode doctor report");
assert_eq!(report["type"], "doctor");
assert_eq!(report["ok"], false);
let codes = report["checks"]
.as_array()
.expect("checks")
.iter()
.map(|check| check["code"].as_str().expect("code"))
.collect::<Vec<_>>();
assert!(codes.contains(&"daemon-not-running"));
assert!(codes.contains(&"store-missing"));
}
#[test]
fn peer_ping_uses_daemon_owned_iroh_endpoint() {
if skip_iroh_integration_tests() {