2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-08-04 00:16:59 +00:00
Commit Graph

2483 Commits

Author SHA1 Message Date
Vinícius Ferrão 3b6bcac8db test(dhcp): expose inconsistent Kea reservation state 2026-07-31 22:21:51 -03:00
Vinícius Ferrão 287ed79b62 Merge pull request #7706 from VersatusHPC/fix/kea-makedhcp-noip-reservation
fix(xcat-core): skip *NOIP* NICs when building Kea DHCP reservations
2026-07-31 20:15:43 -03:00
Daniel Hilst 52cdf7fe36 test(xcat-core): cover *NOIP* NICs in Kea DHCP reservation builders
Add a regression case to dhcp_kea_plugin_intent.t for a node whose mac
table entry uses the *NOIP* sentinel on a secondary NIC
("mac1|mac2!*NOIP*"). The mocked getipaddr resolves every name (including
the literal *NOIP*), so the only thing that can keep the node to a single
reservation is an explicit *NOIP* skip in kea_node_reservations() and
kea_node_reservations6(). The test asserts exactly one v4 and one v6
reservation, for the real NIC, with no reservation carrying *NOIP* as a
hostname -- covering both the "bogus second reservation" and the
"unresolved reservation aborts makedhcp" failure modes.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-31 19:22:51 -03:00
Daniel Hilst 2c9d0a3523 Merge pull request #7703 from VersatusHPC/fix/kea-preserve-reservations-on-makedhcp-n
fix(dhcp): preserve Kea reservations on makedhcp -n
2026-07-31 17:32:04 -03:00
Vinícius Ferrão 3bc24cf08f test(dhcp): cover Kea reservation regeneration 2026-07-31 15:22:27 -03:00
Vinícius Ferrão 40f05589f9 test(dhcp): cover unresolved Kea reservations 2026-07-31 15:14:54 -03:00
Daniel Hilst 5d9286cfb7 fix(xcat-core): fold release-alias finalize into merge_core_repos
merge_core_repos already assembles the multi-arch core and runs the full
finalize tail (index -> sign -> final metadata -> write_release_alias, in the
required order so the xCAT-release-latest alias lands AFTER metadata and stays
out of the repo index). The preceding commit restored a separate finalize_core
sub purely to satisfy xcat_release_package.t, which grepped for
'sub finalize_core { ... $dir ... }'. That left two overlapping entry points:
--finalize-core (finalize one pre-assembled dir) and --merge-core-repos
(assemble N per-arch dirs THEN finalize) -- the former a strict subset of the
latter, with no in-tree or CI caller.

Consolidate on the single assemble+finalize path: inline the finalize tail into
merge_core_repos, drop sub finalize_core and the --finalize-core getopt/dispatch,
and update xcat_release_package.t to assert the stable alias is created after the
final metadata pass inside merge_core_repos ($out). Behaviour is unchanged (merge
already wrote the alias); only the redundant finalize_core interface is removed.
xcat_release_package.t 26/26; perl -c clean.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-30 13:07:06 -03:00
Daniel Hilst c811f2b1bd Merge pull request #7677 from VersatusHPC/fix/xcat-core-matrix-build
fix(xcat-core) Fixes to get internal CI green
2026-07-28 16:33:08 -03:00
Vinícius Ferrão 036bb24c87 fix(packaging): preserve xcatd init state on Debian (#7615)
* refactor(packaging): share precise systemd state detection

* test(packaging): cover precise systemd state detection

* test(packaging): allow explicit Debian init mode

* fix(packaging): honor explicit Debian init targets

* test(packaging): cover Debian init target detection

* fix(packaging): add Debian xcatd init state helper

* test(packaging): cover Debian xcatd init state helper

* test(packaging): allow delegated SysV registration

* fix(packaging): preserve Debian xcatd conffile lifecycle

* test(packaging): mirror explicit Debian init mode

* test(packaging): cover Debian xcatd conffile lifecycle

* fix(packaging): contain init state file umask

* test(packaging): cover init state permissions

* fix(packaging): contain preinstall context umask

* test(packaging): cover preinstall umask containment

* fix(packaging): detect all systemd enablement links

* test(packaging): cover all systemd enablement links

* test(packaging): allow shared purge state path

* refactor(packaging): reuse Debian init state path

* fix(packaging): detect runtime systemd masks

* test(packaging): cover runtime systemd masks

* test(packaging): model Debian SysV registration

* refactor(packaging): reuse shared init state detection

* test(packaging): enforce shared Debian state probes

* test(packaging): allow explicit unregistered masks

* fix(packaging): preserve Debian SysV registration state

* test(packaging): cover Debian SysV registration states

* fix(packaging): clean failed Debian state writes

* test(packaging): cover failed Debian state writes

* fix(packaging): retain unregistered systemd provenance

* test(packaging): cover unregistered systemd upgrades

* fix(packaging): fail closed on shared state errors

* test(packaging): cover shared state detector failures

* test(packaging): mirror native xcatd runlevels

* fix(packaging): recover rejected SysV layouts

* test(packaging): cover rejected SysV layouts

* test(packaging): cover SysV rebuild retries

* refactor(packaging): reuse systemctl readiness guard

* test(packaging): enforce shared systemctl guard
2026-07-28 19:31:36 +00:00
Daniel Hilst 9e7b281519 Merge pull request #7640 from VersatusHPC/refactor/openbmc-reuse-retry-after
refactor(openbmc): reuse retry scheduler for 503 responses
2026-07-28 15:53:10 -03:00
Daniel Hilst 18ef026fc5 Merge pull request #7638 from VersatusHPC/harvest/apache-security-hardening
fix(httpd): harden the xCAT Apache configuration
2026-07-28 11:05:42 -03:00
Daniel Hilst cf159d31aa Merge pull request #7691 from VersatusHPC/harvest/pxelinux
fix(xnba): warn instead of failing when pxelinux.0 is unavailable
2026-07-28 11:03:39 -03:00
Daniel Hilst b4a5a86b4b Merge pull request #7665 from VersatusHPC/harvest/genesis-ib-support
fix(genesis): find the boot NIC over InfiniBand (IPoIB)
2026-07-28 11:01:51 -03:00
Vinícius Ferrão 951562a45a test(httpd): require SLES service unit 2026-07-27 17:19:27 -03:00
Vinícius Ferrão f8267cb8f3 test(httpd): cover package activation across distros 2026-07-27 17:19:27 -03:00
Vinícius Ferrão 06eced0951 test(httpd): verify security response headers
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-07-27 17:18:57 -03:00
Daniel Hilst eb76ddfbb6 Merge pull request #7673 from VersatusHPC/refactor/network-address-accumulation
refactor(network): centralize address accumulation
2026-07-27 15:32:09 -03:00
Vinícius Ferrão 1f56331435 test(xnba): cover conditional pxelinux warnings
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-07-27 15:22:12 -03:00
Daniel Hilst 7ebb7ffc9a Merge pull request #7678 from VersatusHPC/refactor/ipmi-sha1-fallback
refactor(ipmi): centralize RMCP+ SHA1 fallback
2026-07-27 15:22:01 -03:00
Vinícius Ferrão 1d6ed6a4eb test(genesis): cover InfiniBand module packaging
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-07-27 15:19:33 -03:00
Daniel Hilst d4d9d5c859 Merge pull request #7690 from VersatusHPC/harvest/port80
fix(netboot): omit the default HTTP port from generated boot URLs
2026-07-27 15:15:18 -03:00
Daniel Hilst e2c57c636d Merge pull request #7647 from VersatusHPC/refactor/probe-netplan-command-capture
refactor(probe): reuse command capture for netplan
2026-07-27 12:27:36 -03:00
Daniel Hilst f28ad8587e Merge pull request #7694 from VersatusHPC/harvest/grub2-protocol-regex
fix(grub2): anchor the netboot protocol validation regex
2026-07-27 11:24:20 -03:00
Vinícius Ferrão 39f721713e fix(netboot): omit the default HTTP port from generated boot URLs
Boot URLs handed to nodes always carried an explicit :80 even when the HTTP
server listens on the default port. grub2.pm already omits the port when it is
80; make the xNBA, genesis and DHCP boot URLs consistent with it.

$portsuffix is empty when site.httpport is unset or 80 and ":<port>" otherwise,
so a non-default port is unchanged. Covers the ISC and Kea paths in dhcp.pm,
xnba.pm, mknb.pm, and the Kea xNBA client classes in BootPolicy.pm.

dhcp_boot_policy.t and mknb_xcatd_address.t follow the new URLs and gain cases
for a non-default and an unset port. The floating-address guard in
mknb_xcatd_address.t also drops :80 so that it keeps matching.

Recovered from the unmerged lenovobuild branch (cd61fd9d, a2f77ea9, 1035841b,
b7db0e2, 792fe6d).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-26 03:14:50 -03:00
Vinícius Ferrão cb6a139286 fix(grub2): anchor the netboot protocol validation regex
noderes.netboot is parsed as grub2-<protocol> and validated with
/^http|tftp$/, which reads as (^http)|(tftp$) and so also accepts values
such as https, httpx and xtftp.

A value that passes but is not exactly "http" then falls through to
set root=$grub2protocol,$serverip, which drops site.httpport, so the mistake
surfaces as a confusing grub2 failure at boot instead of the "Invalid netboot
method" error this check exists to give. grub2-https cannot work in any case,
since only "insmod http" is emitted.

Supported values are unchanged: grub2, grub2-http and grub2-tftp.
2026-07-25 17:28:27 -03:00
Vinícius Ferrão 1034752080 test(kea): harden live Control Agent smoke 2026-07-25 01:26:46 -03:00
Vinícius Ferrão d155509345 test(kea): preserve named configuration group selection 2026-07-25 01:26:46 -03:00
Vinícius Ferrão 5c3bb1d9fa test(dhcp): cover Kea control socket paths 2026-07-25 01:26:45 -03:00
Daniel Hilst 3191b874a3 Merge pull request #7629 from VersatusHPC/harvest/template-xcatroot-fallback
fix(template): fall back to $::XCATROOT when XCATROOT is not in %ENV
2026-07-24 18:45:55 -03:00
Daniel Hilst 929aa3292e Merge pull request #7630 from VersatusHPC/harvest/networks-exclude-all-linklocal
fix(networks): make IPv6 route filtering in donets() robust
2026-07-24 18:44:17 -03:00
Daniel Hilst 137508bc06 Merge pull request #7632 from VersatusHPC/harvest/nodech-comma-groups
fix(nodech): support comma-delimited values in the ,= and ^= operators
2026-07-24 18:41:53 -03:00
Daniel Hilst 851284067d fix(xcat-core): retry_install waits 20 min per provision attempt, not 30
wait_for_provision caps how long retry_install polls for a node to reach
'booted' after each rinstall. Measured healthy provisions in devel-cd #22 boot
well inside this window (diskless ~6-8 min, diskfull ~8-16 min), so 30 min was
mostly slack that only lengthened the give-up time on a genuinely failing node.

Drop it to 20 min: still above the ~16-min diskfull install, while shrinking each
failed attempt's cost (6 min fixed sleep + 20 poll = 26 min vs 36). Combined with
the 3->2 attempt default, a fully-failing case's retry stack drops substantially.
Trade-off noted: the margin over a slow-under-load diskfull install is now tighter.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-24 16:19:58 -03:00
Daniel Hilst b9336448f7 fix(xcat-core): retry_install defaults to 2 provision attempts, not 3
retry_install.sh retries a node provision $times (default 3) x 30 min. The flat
diskless/diskfull cases each call it multiple times, so when a node genuinely
fails to come up the retries stack to ~3.5-4 h per case (measured: a single
contention-flaked el8-x86 diskless burned 14181s in devel-cd #22), which both
balloons the CD wall-clock and delays the red verdict.

Two attempts still absorbs a one-off transient (a single slow/failed netboot)
while halving the worst-case retry time (3->2 tries per call). Callers that pass
an explicit count (e.g. the negative-provision check that passes 1) are
unaffected -- only the default changes.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-24 16:15:15 -03:00
Vinícius Ferrão 3aff408657 fix(test): load the installed networks plugin 2026-07-24 13:35:35 -03:00
Vinícius Ferrão a64b6c647e fix(template): preserve explicit XCATROOT values 2026-07-24 13:07:51 -03:00
Vinícius Ferrão f8548ceeb9 fix(networks): validate IPv6 route filtering 2026-07-24 13:07:37 -03:00
Vinícius Ferrão 25c9fb3836 test(nodech): cover comma-delimited group updates 2026-07-24 13:07:17 -03:00
Daniel Hilst 2d26dca480 Merge pull request #7614 from VersatusHPC/fix/xcatd-rpm-init-state
fix(packaging): preserve xcatd init state across RPM transactions
2026-07-24 12:25:28 -03:00
Daniel Hilst 4652a023c1 Merge pull request #7606 from VersatusHPC/refactor/dbobjutils-only-if-matcher
refactor(dbobjutils): reuse only-if matcher for table routing
2026-07-24 12:24:19 -03:00
Daniel Hilst bee8c529ea Merge pull request #7602 from VersatusHPC/fix/dhcp-ubuntu-backend-release
fix(dhcp): use complete Ubuntu release for backend selection
2026-07-24 11:24:18 -03:00
Daniel Hilst e469aff826 Merge pull request #7604 from VersatusHPC/refactor/dhcp-shared-mac-normalization
refactor(dhcp): reuse Kea MAC normalization
2026-07-24 11:24:08 -03:00
Vinícius Ferrão a42430efc3 test(ipmi): characterize RMCP+ SHA1 fallback 2026-07-23 22:06:18 -03:00
Vinícius Ferrão dbc820780a test(network): characterize address accumulation 2026-07-23 21:17:13 -03:00
Vinícius Ferrão 5bfbc8edf6 Merge pull request #7627 from VersatusHPC/fix/ddns-net-dns-version-comparison
refactor(ddns): centralize Net::DNS version policy
2026-07-23 17:44:30 -03:00
Daniel Hilst 764e667e0a fix(xcat-core): assert the integration case actually ran its tests
The case gated only on rc==0, but prove exits 0 both when tests pass and
when every test skips, so the case could report green having run nothing
at all. That is not hypothetical: all three tests carry environment
guards, and on the pull request run the harness discards a passing
case's output, so there was no way to tell from the log whether anything
had executed.

Add check:output=~Files=3, which proves prove found all three files. It
still tolerates a legitimate skip on a node without Kea, and it catches
a packaging regression or a rename. A missing directory was already
caught, since prove -r on a nonexistent path exits 2.

The count has to be maintained by hand when tests are added here, which
the README now says.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 11:47:15 -03:00
Daniel Hilst de17401338 fix(xcat-core): run the integration testcase on pull requests too
The integration testcase was added without the ci_test label on the
grounds that the pull request workflow has no management node. That was
wrong: github_action_xcat_test.pl builds xCAT, installs it, runs
setup-local-client.sh and chtab, and leaves xcatd running, which makes
the runner a single node management node. Running the ci_test cases
against it is exactly what the fast regression stage already does.

Label the case ci_test so the integration tests get pull request
coverage as well. This also unlocks a test that had been skipping for a
fixable reason: each case is invoked through sudo, and
dhcp_kea_config_validation.t skips only because /etc/kea is not writable
by the unprivileged runner user, so as root it validates instead of
skipping.

Running the integration suite as root and the unit suite unprivileged is
the right way round. Integration tests legitimately need to write to
places like /etc/kea, whereas running the unit tests as root would let
permission-related assertions pass for the wrong reason.

Correct both READMEs, which carried the mistaken claim that the
integration tests do not run in CI.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 11:11:31 -03:00
Daniel Hilst 6ab9aca0b7 fix(xcat-core): split the source-only unit tests from the MN integration tests
Three of the files under xCAT-test/unit are not unit tests. They need an
installed management node rather than a checkout: copycds_packages_integrity.t
wants an /install populated by a real copycds, dhcp_kea_config_validation.t
wants a kea-dhcp4 binary that can read the config it generates, and
dhcp_kea_control_agent_smoke.t wants live kea-dhcp4 and kea-ctrl-agent
daemons running as root.

On a GitHub runner none of that exists, so all three plan skip_all. They were
the only three files skipping in the pull request run, which is not a
coincidence -- the skip is the symptom of them being filed in the wrong place.
A skipped test reports neither pass nor fail, so leaving them mixed in with
the unit tests trains the reader to scroll past skips in a directory where a
skip should mean something is wrong.

Move them to xCAT-test/integration, ship that directory alongside unit in
both the rpm and the deb, and drive it from a new xcattest testcase that
proves the installed copy on an MN. The case is deliberately not labelled
ci_test: the pull request workflow has no management node and must not pick
it up. check:rc==0 is the right gate for it -- prove exits non-zero on a real
failure, exits 0 when a test legitimately skips on a node without Kea, and
exits 2 if the directory is missing entirely, so a packaging regression still
fails the case.

Add a README.md to each directory recording which side of the line a new test
belongs on and how each suite is run.

xCAT-test/unit is now 44 files and 802 assertions with no skips at all; the
assertion count is unchanged, confirming the three moved files were
contributing nothing but skips.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 11:06:10 -03:00
Daniel Hilst a0d2322b71 fix(xcat-core): run every xCAT-test unit test in the GitHub CI
The 47 test files under xCAT-test/unit/ were shipped but almost never
executed on a pull request. Only three hand-written xcattest cases
reached them -- dhcp_unit, ipmi_unit and xcatprobe_unit -- and each
proved a single glob against the installed copy, so the majority of the
suite had never run at all. Real drift went unnoticed as a result:
ubuntu_subiquity_template.t still asserted the pre-86e77bcd7 shape of
compute.subiquity.tmpl and failed against the current template.

Run `prove xCAT-test/unit/*.t` directly from github_action_xcat_test.pl.
The tests resolve xCAT modules and fixture files relative to the repo
root through FindBin, so they must be proved from the checkout and not
from /opt/xcat/share/xcat/tools/autotest/unit; install_xcat() chdir's
away, hence the getcwd() captured up front. The step runs after the
install because the suite needs the perl dependencies xCAT pulls in
(Net::DNS, XML::Simple) and a usable xCAT database.

Drop the three prove testcases so their tests do not run twice, and
refresh the two stale ubuntu_subiquity_template.t assertions: the
identity section is now intentional (86e77bcd7) and the MAC
normalization gained cut filters ahead of the tr (c6e38483f), which the
loosened regex plus a new assertion for the suffix stripping now cover.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 09:14:03 -03:00
Vinícius Ferrão 5257d73bdc test(probe): characterize netplan command output 2026-07-22 23:40:15 -03:00
Vinícius Ferrão e7717efa52 test(openbmc): characterize 503 retry scheduling
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-07-22 20:07:30 -03:00