mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-05 04:27:55 +00:00
test(xcat-core): a failed monitor respawn strands xcatiport for the rest of the bundle
The new xcatd_install_monitor_respawns case kills the install monitor to prove it comes back. When it does not come back, the case simply ends there, and the MN is left running a daemon whose xcatiport is dead. xcattest does not stop a case at the first failed check -- the only "last" statements are inside the check loops, so every remaining cmd still runs -- but it has no teardown either, and the next case in the bundle that provisions a node would then fail because nothing is listening for install status, not because of anything it did. One real failure would read as a cascade of unrelated ones. Restore the daemon at the end of the case, and only if the monitor is actually missing, so a passing run stays a no-op rather than restarting xcatd for nothing. Verified against a live MN: with the monitor present the step exits 0 and leaves the running pid untouched. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
@@ -212,4 +212,9 @@ cmd:pgrep -f "^xcatd: SSL listener$" | diff -q - /tmp/xcatd_monitor_respawn/list
|
||||
check:rc==0
|
||||
cmd:rm -rf /tmp/xcatd_monitor_respawn
|
||||
check:rc==0
|
||||
#if the respawn did not happen, this MN is left with a dead xcatiport, and every later case
|
||||
#in the bundle that provisions a node would fail for that reason instead of its own. a failed
|
||||
#check does not stop the remaining cmds of a case, so restore the daemon unconditionally here
|
||||
cmd:pgrep -f "^xcatd: install monitor$" >/dev/null || { if [ -d /run/systemd/system ] && command -v systemctl >/dev/null 2>&1; then XCATBYPASS=YES systemctl restart xcatd; else XCATBYPASS=YES service xcatd restart; fi; sleep 5; }
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user