aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-01 00:51:48 +0000
committertv <tv@krebsco.de>2026-12-01 00:51:48 +0000
commit54f070ef0f905f867a24dece72f667be23f9f843 (patch)
tree6f6258ebfa3bb0532ad3abbbeefc5a550dc4d2cf /tests
parent683e2128a5d00bcadea7cc2f71a48253032632a5 (diff)
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/receptor.rs11
1 files changed, 11 insertions, 0 deletions
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!(