mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-05 04:27:55 +00:00
b7c786b429
The unit tests drive xCAT::RespawnUtils, which is where the pacing lives, but nothing connects that to the daemon. Replacing the respawn condition in xcatd's service loop with "if (0)" -- so a dead install monitor is never re-forked -- leaves the whole suite green. The behaviour the PR exists to deliver is unverified. That gap cannot be closed in a unit test: xcatd needs the database, SSL, the plugin tree and /var/run/xcat before it will start, which is why the pacing was extracted in the first place. It belongs in xCAT-test, where there is a running daemon to kill things in. Add a case that kills the install monitor and requires that a new one appears, that it reclaims xcatiport rather than merely existing, and that the SSL listener keeps its pid throughout -- surviving without a restart being the entire point. The process titles are matched anchored. An unanchored "pgrep -f xcatd: install monitor" also matches the running test's own command line, and the kill would then take out the test; that was observed on a live MN, not guessed. Two smaller test defects go with it. The fork test kept every pid it forked in @spawned and had its END block signal all of them, including ones it had already reaped -- verified as 3 of 3 -- so a recycled pid would take a signal meant for a process that no longer exists, and the suite runs as root in CI. Reaped pids now leave the list. And the tunables reach policy() straight from %ENV, where they can be empty or misspelt; assert that none of those shapes produces a Perl warning, since xcatd runs under use warnings and would put one in the daemon log on every start. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>