[control] Design review: Caddy differences per host in fallback_ready, active apply kind, hosts and watch end, capped device end date, CSR fingerprint for signing by hand, crash points exit without SIGABRT

This commit is contained in:
2026-11-08 11:21:43 +01:00
parent 3bf5fa0e1a
commit b24ffdf9db
9 changed files with 106 additions and 17 deletions
+6 -3
View File
@@ -3,7 +3,10 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! Crash points for the crash-safety tests: with `IANITOR_TEST_CRASH_AT=<stage>` in its
//! environment, control aborts (no cleanup, like a kill -9) when an apply reaches that stage.
//! environment, control exits at once with status 134 (no cleanup in Ianitor's code, like a
//! kill -9) when an apply reaches that stage. It does not raise SIGABRT: a signal would make
//! the kernel log a register dump per crash test and could hand the process to the host's
//! core-dump handler, and the tests must not reach into the host's systemd.
//!
//! `IANITOR_TEST_FAIL_WRITE=<file name>` makes every write of a state file with that name
//! fail, as on a full disk (fault injection for the same tests).
@@ -31,8 +34,8 @@ pub const ENABLED: bool = cfg!(feature = "test-hooks");
#[cfg(feature = "test-hooks")]
pub fn point(stage: &str) {
if std::env::var("IANITOR_TEST_CRASH_AT").as_deref() == Ok(stage) {
log::error!(target: "ianitor::crash", "IANITOR_TEST_CRASH_AT={stage}: aborting on purpose");
std::process::abort();
log::error!(target: "ianitor::crash", "IANITOR_TEST_CRASH_AT={stage}: exiting on purpose");
std::process::exit(134);
}
}