From 54f070ef0f905f867a24dece72f667be23f9f843 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 00:51:48 +0000 Subject: enstate: --apply starts the unit that runs --migrate again if it failed The setting unit names it (the module: enstate.service). After a boot without state it failed; an accepted --apply starts it (--no-block, with the lock released), so it serves the views and is no longer failed. --- tests/receptor.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/receptor.rs b/tests/receptor.rs index 656ed1f..8bbadf4 100644 --- a/tests/receptor.rs +++ b/tests/receptor.rs @@ -536,6 +536,17 @@ fn command_line() { assert_eq!(code, Some(0), "{stderr}"); let plan: Value = serde_json::from_str(&stdout).unwrap(); assert_eq!(plan["accepted"], json!(true)); + // With the unit that runs --migrate named: started again if it failed (the fake + // systemctl says it did). + assert!(!host.reactions().contains("is-failed")); + let (code, _, stderr) = enstate(&["--apply", good.to_str().unwrap(), "--unit=enstate.service"]); + assert_eq!(code, Some(0), "{stderr}"); + assert!( + host.reactions() + .contains("is-failed --quiet enstate.service\nstart --no-block enstate.service\n"), + "{}", + host.reactions() + ); let (code, stdout, _) = enstate(&["--status"]); assert_eq!(code, Some(0)); assert!( -- cgit v1.3.1