2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 12:37:54 +00:00
Commit Graph

2721 Commits

Author SHA1 Message Date
Daniel Hilst e364172b99 test(xcat-core): nothing checks that xcatd respawns the monitor at all
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>
2026-09-01 20:02:18 -03:00
Daniel Hilst 173ce5c6a3 test(xcat-core): the respawn test asserts xcatd's shape, not its behaviour
The pacing that keeps the install monitor alive is written inline in xcatd, and xcatd
cannot be run in a unit test: it needs the database, SSL, the plugin tree and
/var/run/xcat before it will start at all. So the test reached for the only thing left and
matched regular expressions against the script's source -- that a respawn branch exists,
that it mentions an interval, that it names a cap. Every one of those assertions passes
against pacing that is subtly wrong, and none of them would notice the retry budget
running out and never being refilled, which is the actual defect under review. Grepping
the implementation also pins its shape, so the code cannot be rearranged without editing
the test that is supposed to be guarding it.

State the pacing instead as an interface a test can execute: xCAT::RespawnUtils, pure
functions that take a state and a time and return the next state, with no clock, no
globals and no I/O of their own. Passing the time in is what lets the schedule be checked
over a virtual clock rather than in real seconds.

Drive it for the delay backing off to a ceiling and holding there, for the never-give-up
property (three hours into a continuous failure the daemon is still forking monitors), for
the reset (a monitor that stayed up long enough to serve clears the backoff when it later
dies), for the guards on a policy that could not back off, and for purity itself. Then
drive it for real against a genuinely held TCP port: fail several times, release the port,
and require that a respawned monitor binds it and stays up without the daemon being
restarted.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-01 20:02:18 -03:00
Daniel Hilst a55a7240b1 test(xcat-core): capture the install monitor giving up on xcatiport for good
The respawn added for the install monitor is paced by a retry budget, and once that
budget is spent the daemon stops trying. That reintroduces the failure the respawn
exists to remove: with no monitor alive there is nothing left to reset the counter, so
xcatiport stays dead until the whole daemon is restarted, and a port that becomes free
a minute later is never picked back up. Pacing the retries is necessary -- an unguarded
re-fork spins as fast as fork allows while the port is held, and keeps re-entering
do_installm_service's USR2 socket-takeover handshake -- but pacing must not decay into
giving up.

The property that matters is therefore behavioural, not structural: the monitor comes
back on its own, at a bounded rate, no matter how long it has been failing. Assert it by
driving xcatd's real pacing code rather than grepping for it -- extract the marked
mon-respawn-policy region from the script verbatim, the way build_ubunturepo_lock.t
drives build-ubunturepo's real lock, and run it. Over a virtual clock, check that the
delay backs off to a ceiling and holds there, that the daemon is still forking monitors
three hours into a failure, and that a monitor which stayed up long enough to serve
resets the pacing when it later dies. Then do it for real against a genuinely held TCP
port: fail several times, release the port, and require that a respawned monitor binds
it and stays up without the daemon being restarted.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-01 20:02:17 -03:00
Daniel Hilst 715fbed7a8 fix(xcat-core): respawn the xcatd install monitor when it dies
Re-fork the install monitor from the main service loop when $pid_MON has been cleared
and xcatiport is still configured, so a single death of that child no longer leaves
the port dead until the whole daemon is restarted. The forked child closes the SSL
listener and the UDP control socket before re-entering do_installm_service, so it
serves only the install monitor.

Rate limit the respawn. do_installm_service dies when it cannot bind the port after
its own retries, which is exactly the case where an unguarded re-fork would spin as
fast as fork allows and keep re-entering that function's USR2 socket-takeover
handshake against whatever still holds the socket. Consecutive attempts are separated
by XCATD_MON_RESPAWN_INTERVAL seconds (default 5) and capped at XCATD_MON_RESPAWN_MAX
(default 10), after which xcatd logs that it is giving up on the port rather than
retrying forever. A monitor that stayed up long enough to outlast the whole retry
budget resets the counter, so an unrelated death much later gets a full budget again.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-01 20:02:17 -03:00
Daniel Hilst b338ff6b7d test(xcat-core): capture xcatd never respawning its install monitor
The install monitor -- the child listening on xcatiport for node install-status
updates and the "next" boot-flip request -- is forked exactly once at daemon startup.
When it dies the SIGCHLD reaper only clears $pid_MON and nothing re-forks it, so a
single death of that child (a stray signal, or a lost socket takeover during an xcatd
restart) leaves xcatiport permanently dead while the main daemon keeps running.
Installing nodes can then no longer report booted or request the boot flip until the
whole daemon is restarted, which is disruptive to any concurrent operation.

A respawn must also be rate limited. do_installm_service dies when it cannot bind the
port after its own retries, so an unguarded re-fork in the main loop would spin as
fast as fork allows for as long as the port stays held, and would collide with that
same function's USR2 socket-takeover handshake.

Assert that the main loop re-forks the monitor, that the child re-enters
do_installm_service, and that respawns are spaced, capped, and reported on exhaustion.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-01 20:02:17 -03:00
Daniel Hilst 0589bdbc70 Merge pull request #7782 from VersatusHPC/fix/template-install-device
fix(template): honour installnic when the kickstart names the install device
2026-09-01 18:35:45 -03:00
Vinícius Ferrão a065ecb136 test(template): verify kickstart behavior instead of source text 2026-09-01 11:09:00 -03:00
Vinícius Ferrão 286f0472a4 test(template): pin the shared install device resolution
Cover the order that names the install device: installnic, then primarynic,
then mac.mac. Either attribute may name an interface or carry an address, and
the keyword mac returns to mac.mac.

Cover the device the kickstart names for each of those inputs. A node that
sets neither attribute keeps the address it has today. Cover the defect the
change closes, where a mac.mac entry that holds several untagged addresses
resolves to the last of them.

Cover that Ubuntu keeps its own pair of a name and an address over the same
resolution, and that the unique local address still comes from the hardware
address.
2026-09-01 11:09:00 -03:00
Vinícius Ferrão abb3fb1633 test(build): cover the RISC-V Genesis recommendation 2026-09-01 10:50:25 -03:00
Vinícius Ferrão 7f1d9695a4 test(dhcp): cover Kea option flags in every scope 2026-09-01 10:50:25 -03:00
Vinícius Ferrão 4d0c96a78c test(netboot): cover the HTTP tftp alias 2026-09-01 10:50:25 -03:00
Vinícius Ferrão 36c5d6d434 test(build): exercise RPM architecture sets 2026-09-01 10:50:24 -03:00
Vinícius Ferrão 6671f258cd test(install): exercise RISC-V EFI fix-up 2026-09-01 10:50:24 -03:00
Vinícius Ferrão 41ac89cf1b test(netboot): exercise RISC-V install image policies 2026-09-01 10:50:24 -03:00
Vinícius Ferrão 6d32aa944c test(dhcp): exercise ISC client boot policy 2026-09-01 10:50:24 -03:00
Vinícius Ferrão 86108d2a33 test(riscv64): decouple helper coverage from source layout
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-01 10:50:23 -03:00
Vinícius Ferrão 4011a3415d test(xCAT-test): exercise real RISC-V helper implementations 2026-09-01 10:50:23 -03:00
Vinícius Ferrão aaa0068db7 test: reuse repository file helpers 2026-09-01 10:50:23 -03:00
Vinícius Ferrão aade148d49 test(xCAT-test): cover RISC-V UEFI HTTP boot in both DHCP backends 2026-09-01 10:50:22 -03:00
Vinícius Ferrão 609f6febef test(xCAT-test): cover the HTTP Genesis discovery payload 2026-09-01 10:50:22 -03:00
Vinícius Ferrão 600a87713e test(xCAT-test): cover the boot loader published by copycds 2026-09-01 10:50:22 -03:00
Vinícius Ferrão 4314781f73 test(xCAT-test): cover the disabled kdump add-on in the riscv64 templates 2026-09-01 10:50:21 -03:00
Vinícius Ferrão 30a773deeb test(xCAT-test): cover the riscv64 diskless crash kernel default 2026-09-01 10:50:21 -03:00
Vinícius Ferrão 4b20177f39 test(xCAT-test): cover the EL10 riscv64 install templates and boot entry fix-up 2026-09-01 10:50:21 -03:00
Vinícius Ferrão df712ee153 test(xCAT-test): cover suffixed mock targets in buildrpms.pl 2026-09-01 10:50:21 -03:00
Vinícius Ferrão 428e5fa0f3 test(xCAT-test): pin the weak perl-DB_File dependency 2026-09-01 10:50:20 -03:00
Vinícius Ferrão aa208918b8 test(xCAT-test): cover riscv64 rpm packaging and build scripts
Pin the riscv64 %ifarch blocks in the xCAT, xCATsn and genesis specs
(genesis token, ipmitool-xcat, no x86 PXE loaders) and the riscv64
entries in buildcore.sh, buildlocal.sh and the buildrpms.pl notes.
2026-09-01 10:50:20 -03:00
Vinícius Ferrão e7168fc137 test(xCAT-test): cover the EL10 riscv64 osimage profiles
Resolve the rocky10/rhels10 point releases through
imgutils::get_profile_def_filename with the OS search list emulated, and
assert the riscv64 files exist, win the lookup, match the x86_64 package
lists and point service images at the riscv64 dependency repository.
2026-09-01 10:50:20 -03:00
Vinícius Ferrão 16eea29daf test(xCAT-test): cover EL riscv64 install media and diskless defaults
Pin the riscv64 installer kernel lookup in anaconda.pm and
geninitrd.pm, and evaluate the rh/genimage default driver and resolver
library blocks for riscv64 and the existing architectures.

Add an autotest nodeset case with bogus riscv64 grub2 nodes and a
rhels10.99 riscv64 osimage, checking the per-node grub2 files, the
grub2.riscv64 loader link and the hex-ip/mac links.
2026-09-01 10:50:19 -03:00
Vinícius Ferrão ee3df5c3e6 test(xCAT-test): cover the riscv64 mknb discovery configuration
Drive mknb riscv64 --configfileonly through the existing stubs and
assert the grub2 network configuration: name, cpu guard, kernel, initrd,
xcatd endpoint, serial console, lzma preference, no PXELINUX/xNBA/
petitboot output, removal without artifacts and for :noboot interfaces.
Also install a riscv64 Genesis export and reject it for another
architecture.
2026-09-01 10:50:19 -03:00
Vinícius Ferrão 360beccb73 test(xCAT-test): cover the nodediscover default netboot ladder
Exercise _default_netboot() with the database-backed modules stubbed:
riscv64 defaults to grub2 and keeps any grub2 variant, the x86, PowerNV,
ppc, onie and aarch64 outcomes are unchanged, and undefined inputs do
not warn.
2026-09-01 10:50:19 -03:00
Vinícius Ferrão d64366a30a test(xCAT-test): cover the riscv64 DHCP boot policy
Assert the Kea xcat-riscv64 class (architecture 0x001b only, grub2
boot file, present with and without xNBA loaders) and pin the ISC
subnet block so the riscv64 branch stays ahead of the /yaboot
fallback that would otherwise shadow it.
2026-09-01 10:50:19 -03:00
Vinícius Ferrão be44015c3f test(xCAT-test): cover riscv64 netboot method lookup
Pin lookupNetboot, the profiled-node netboot rule table and the schema
descriptions for riscv64 without loading the database-backed modules:
the shipped subroutines are extracted from the source and evaluated
directly, so the test runs without DBI.
2026-09-01 10:50:18 -03:00
Vinícius Ferrão a26a00c471 test(build): stage the source-only helper in the makerpm fixture 2026-08-31 21:06:59 -03:00
Daniel Hilst 4a0d9e0bb0 Merge pull request #7801 from VersatusHPC/refactor/dhcp-omapi-key-rendering
refactor(dhcp): share OMAPI key configuration
2026-08-31 20:39:06 -03:00
Daniel Hilst 66fb895359 Merge pull request #7774 from VersatusHPC/feat/makerpm-source-only-build
feat(build): add a source-only build mode
2026-08-31 20:37:31 -03:00
Daniel Hilst aa447fe247 Merge pull request #7780 from VersatusHPC/feat/confluent-switch-topology
feat(confluent): export the switch topology of each node
2026-08-31 17:43:52 -03:00
Vinícius Ferrão ab80f09385 test(dhcp): cover shared OMAPI key configuration 2026-08-31 16:10:14 -03:00
Daniel Hilst 0a93aba2b0 Merge pull request #7786 from VersatusHPC/feat/policy-user-groups
feat(policy): allow Unix group rules
2026-08-31 15:55:34 -03:00
Daniel Hilst efdb06f641 Merge pull request #7789 from VersatusHPC/refactor/package-manager-discovery
refactor(postscripts): share RPM package manager discovery
2026-08-31 15:33:17 -03:00
Daniel Hilst e872fd20cf Merge pull request #7775 from VersatusHPC/fix/anaconda-driver-disk-kernel-arg
fix(anaconda): load the driver disk that is added to the initrd
2026-08-31 12:12:09 -03:00
Daniel Hilst b0a0893cb3 Merge pull request #7798 from VersatusHPC/refactor/xcatdsklspost-mypostscript-fetch
refactor(xcatdsklspost): share mypostscript fetch pipeline
2026-08-31 12:05:59 -03:00
Daniel Hilst bee09454f7 Merge pull request #7777 from VersatusHPC/fix/dhcp-infiniband-twin-entry
fix(dhcp): register the InfiniBand identity of a node that boots over IPoIB
2026-08-31 11:46:30 -03:00
Daniel Hilst 443a776fd6 Merge pull request #7783 from VersatusHPC/refactor/package-modular-predicate
refactor(postscripts): share modular package directory predicate
2026-08-31 11:43:37 -03:00
Daniel Hilst e82e52f03f Merge pull request #7784 from VersatusHPC/fix/debian-html-form-dependency
fix(debian): declare HTML::Form runtime dependency
2026-08-31 11:42:04 -03:00
Daniel Hilst 43203535ef Merge pull request #7787 from VersatusHPC/fix/rflash-fpc-usage
fix(rflash): show NeXtScale FPC URL syntax
2026-08-31 11:37:46 -03:00
Daniel Hilst 3d8e647ee9 Merge pull request #7788 from VersatusHPC/refactor/apache-config-sources
build(httpd): centralize Apache configuration sources
2026-08-31 11:36:33 -03:00
Daniel Hilst 9780d56a36 Merge pull request #7790 from VersatusHPC/fix/genesis-secondary-dhcp
fix(genesis): configure eligible secondary NICs with DHCP
2026-08-31 11:28:44 -03:00
Daniel Hilst 2abe22e203 Merge pull request #7791 from VersatusHPC/refactor/nfs-export-workflow
refactor(svrutils): centralize NFS export setup
2026-08-31 11:27:41 -03:00
Daniel Hilst ed537cd88f Merge pull request #7793 from VersatusHPC/refactor/nm-autoconnect
refactor(netboot): share NetworkManager autoconnect setup
2026-08-31 11:26:25 -03:00