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

2425 Commits

Author SHA1 Message Date
Daniel Hilst c65d4c8aef 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>
(cherry picked from commit b9336448f7)
2026-07-28 19:33:22 +00:00
Vinícius Ferrão c4fbbf32b4 test(dhcp): cover detected Ubuntu backend selection
(cherry picked from commit a53853d919)
2026-07-27 15:48:22 -03:00
Vinícius Ferrão acfe765ea8 test(dhcp): isolate EL9 backend selection fixture
(cherry picked from commit a80e1e7cfa)
2026-07-27 15:44:25 -03:00
Vinícius Ferrão a8ddda0efa test(kea): harden live Control Agent smoke
(cherry picked from commit 1034752080)
2026-07-26 11:34:15 +00:00
Vinícius Ferrão 135f14d1a3 test(kea): preserve named configuration group selection
(cherry picked from commit d155509345)
2026-07-26 11:34:15 +00:00
Vinícius Ferrão 2e56a4ca91 test(dhcp): cover Kea control socket paths
(cherry picked from commit 5c3bb1d9fa)
2026-07-26 11:34:15 +00:00
Vinícius Ferrão ea71e73ada Merge pull request #7686 from VersatusHPC/backport-7650-to-2.18
[Backport 2.18] fix(xcat-core): run every *.t test in the GitHub CI
2026-07-25 01:19:20 -03:00
xcat2-backport-automation[bot] 9a2fa44087 Merge pull request #7689 from xcat2/backport-7629-to-2.18
[Backport 2.18] fix(template): fall back to $::XCATROOT when XCATROOT is not in %ENV
2026-07-24 22:04:18 +00:00
xcat2-backport-automation[bot] 233344ad7b Merge pull request #7688 from xcat2/backport-7630-to-2.18
[Backport 2.18] fix(networks): make IPv6 route filtering in donets() robust
2026-07-24 22:02:10 +00:00
Vinícius Ferrão 37588da046 fix(template): preserve explicit XCATROOT values
(cherry picked from commit a64b6c647e)
2026-07-24 21:46:13 +00:00
Vinícius Ferrão 83c8a56855 fix(test): load the installed networks plugin
(cherry picked from commit 3aff408657)
2026-07-24 21:44:32 +00:00
Vinícius Ferrão 2097bec822 fix(networks): validate IPv6 route filtering
(cherry picked from commit f8548ceeb9)
2026-07-24 21:44:32 +00:00
Vinícius Ferrão eed45bee6b test(nodech): cover comma-delimited group updates
(cherry picked from commit 25c9fb3836)
2026-07-24 21:42:07 +00:00
Daniel Hilst 6257cfd653 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>
(cherry picked from commit 764e667e0a)
2026-07-24 12:56:58 -03:00
Daniel Hilst a12b6cad45 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>
(cherry picked from commit de17401338)
2026-07-24 12:56:58 -03:00
Daniel Hilst fbc8fad78d 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>
(cherry picked from commit 6ab9aca0b7)
2026-07-24 12:56:57 -03:00
Daniel Hilst 7fe2244d9d 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>
(cherry picked from commit a0d2322b71)
2026-07-24 12:56:39 -03:00
xcat2-backport-automation[bot] 36823339b3 Merge pull request #7685 from xcat2/backport-7614-to-2.18
[Backport 2.18] fix(packaging): preserve xcatd init state across RPM transactions
2026-07-24 15:43:33 +00:00
Vinícius Ferrão 0c5cad78cf test(packaging): cover shared systemctl guard
(cherry picked from commit 6c26a10863)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão f644b39581 test(packaging): cover fresh legacy defaults
(cherry picked from commit 3505c24040)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão d19bd15beb test(packaging): prepare fresh legacy defaults
(cherry picked from commit 0826a6b1ad)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão 18f32cf648 test(packaging): cover custom SysV runlevels
(cherry picked from commit 9091b3f598)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão a6873779ee test(packaging): cover legacy upgrade edge cases
(cherry picked from commit 7f44bd51bf)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão 4ae36a4d5c test(packaging): prepare legacy state resolution
(cherry picked from commit 9bff441795)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão 3f45307350 test(packaging): cover managed xcatd init scripts
(cherry picked from commit 4efcd5132b)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão 096d9284c3 test(packaging): prepare managed init ownership
(cherry picked from commit 11709a2221)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão 5a4826ecc0 test(packaging): cover RPM init transitions
(cherry picked from commit 11f9cada05)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão 6e4f920b30 test(packaging): cover shared init management
(cherry picked from commit 5a9c32e885)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão 1198dec568 test(packaging): allow shared init state detection
(cherry picked from commit 6d7de3a927)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão c21b860059 test(packaging): cover hybrid init targets
(cherry picked from commit 002634ef6b)
2026-07-24 15:25:45 +00:00
Vinícius Ferrão c876bbf790 test(dbobjutils): cover literal only-if routing
(cherry picked from commit 8a4fe18cbf)
2026-07-24 15:24:33 +00:00
Vinícius Ferrão da2824f842 test(dhcp): cover Kea MAC normalization
(cherry picked from commit 138f3327b2)
2026-07-24 14:24:23 +00:00
Vinícius Ferrão bcbc4c9c25 test(dhcp): cover shared version comparison
(cherry picked from commit 0ddc19e74b)
2026-07-19 20:07:15 +00:00
Vinícius Ferrão 9d1628f577 test(packaging): verify systemd omits SysV init script
(cherry picked from commit 185af5a3aa)
2026-07-19 12:20:06 -03:00
Vinícius Ferrão 9910390e99 test(xcatprobe): run listener checks in CI
(cherry picked from commit c135abe679)
2026-07-19 12:19:52 -03:00
Vinícius Ferrão 886c08e9aa build(xcatprobe): declare listener tool dependency
(cherry picked from commit 6d59e60331)
2026-07-19 12:19:52 -03:00
Vinícius Ferrão dd0b123346 fix(xcatprobe): report listener inspection errors
(cherry picked from commit 73b9368ff3)
2026-07-19 12:19:52 -03:00
Vinícius Ferrão c50384945f test(xcatprobe): cover command output capture
(cherry picked from commit b46d28ae1d)
2026-07-19 12:19:52 -03:00
Vinícius Ferrão 23d11276f4 test(xcatprobe): cover TCP listener detection
(cherry picked from commit b4ce09e132)
2026-07-19 12:19:51 -03:00
Vinícius Ferrão 1c35fc6cef fix(packaging): avoid SysV init paths in modern DEBs
(cherry picked from commit 6a3f71bf68)
2026-07-19 12:19:51 -03:00
Vinícius Ferrão 27e932b7f8 fix(packaging): avoid SysV init paths in modern RPMs
(cherry picked from commit c34db2c55f)
2026-07-19 12:19:51 -03:00
Vinícius Ferrão 420c46297a fix(packaging): make xcatd callers init-agnostic
(cherry picked from commit d829be9e94)
2026-07-19 12:19:50 -03:00
Vinícius Ferrão 401a6ff372 fix(mknb): avoid transient discovery addresses
(cherry picked from commit 3cd74bbab0)
2026-07-19 12:19:50 -03:00
Vinícius Ferrão 944219aa92 fix(makehosts): index host lookups
(cherry picked from commit 009150823f)
2026-07-19 12:19:50 -03:00
Vinícius Ferrão 65b8d37532 fix(copycds): keep SLE 15 source media separate
(cherry picked from commit 4918dfa9b7)
2026-07-19 12:19:50 -03:00
Vinícius Ferrão 29c1747cbe fix(xcat-server): retry suite 3 on zero RAKP2 HMAC
(cherry picked from commit 695dd485cf)
2026-07-19 12:19:50 -03:00
Vinícius Ferrão 28ed4e6331 fix(xcat-client): make profile probe safe under errexit
(cherry picked from commit 1c6c256065)
2026-07-19 12:19:49 -03:00
Daniel Hilst 432ae0fd53 fix(buildrpms): stage xCAT-probe helper modules before target builds
xcatprobe subcommands (xcatmn, discovery, osdeploy) and hierarchy.pm load
xCAT:: perl modules but only add $XCATROOT/probe/lib/perl to @INC, not the
main $XCATROOT/lib/perl where perl-xCAT ships them. The RPM builder stopped
embedding those helpers, so /opt/xcat/probe/lib/perl/xCAT/ was absent on
installed systems and the subcommands were reported "Unsupported sub command".

Stage GlobalDef.pm, NetworkUtils.pm and ServiceNodeUtils.pm into a temporary
xCAT-probe tree and build its source tarball once, before the parallel target
builds fork, so workers only read a complete archive. Add package-payload
regression tests. Adopts the approach from upstream PR #7581.

The remaining buildrpms.pl changes are deployment-compliance refactoring
(signed, self-contained core repo output).

Closes #7579

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 0c3c44f28b)
2026-07-19 12:19:49 -03:00
Daniel Hilst 2bfd004058 fix(xcat-core): drop RHEL-only perl build deps on SUSE
The perl-xCAT component specs BuildRequire perl-Pod-Html and (in
xCAT-client) perl-generators, neither of which exists on openSUSE/SLES,
so rpmbuild aborts at dependency resolution before the build can start.
perl-generators is a RHEL/Fedora-only helper that emits perl dependency
metadata; SUSE's rpm generates those itself. Pod::Html ships inside the
core perl package on SUSE, with no separate perl-Pod-Html subpackage to
require. Guard both BuildRequires with %if !0%{?suse_version} so the SUSE
build resolves while EL/Fedora builds are unchanged.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 4b24558835)
2026-07-19 12:19:47 -03:00
Daniel Hilst 1833a43e04 fix(xcat-test): run testcase commands under bash, not /bin/sh
xcattest's runcmd ran each RUN: command via Perl backticks, i.e. /bin/sh.
On Ubuntu /bin/sh is dash, so testcases using bashisms ([ x == y ],
[[ ... ]]) error with "unexpected operator": the [ exits non-zero, the
enclosing if is taken as false, and the case's distro-specific branch is
silently skipped while the case still reports Passed -- a false pass. Run
the command through bash via list-form open() so no intervening /bin/sh
re-parses or re-expands the command's embedded quotes and backticks. EL
is unaffected (its /bin/sh is already bash).

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit c0731a5e33)
2026-07-19 12:19:46 -03:00