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

166 Commits

Author SHA1 Message Date
Kilian Cavalotti daef2d7bae Distinguish SNMP failures from absent objects in genpdu
A missing object is exception text under v2c/v3 and an error under v1,
and genpdu treated both the same. Add pdu2_get, returning a value and an
ok, absent or failed status. A failed signed minimum read now skips the
sensor, and rinv no longer prints "No Such Instance currently exists at
this OID" for a nameplate field the model does not populate.

Read the signed minimum per entity: the MIB indexes it that way, and it
decides which value column is read.

In the session probe, fall back to the PDU2 nameplate rather than
sysDescr, so a credential that cannot read PDU2 is rejected, return
early when the pduCount read fails at the transport level, and warn once
per PDU.

Signed-off-by: Kilian Cavalotti <kilian@stanford.edu>
2026-08-24 16:32:41 -07:00
Kilian Cavalotti 30dc723b6d Fix genpdu sensor value column and connection detection
genpdu read negative-capable sensors from the unsigned value column,
which the MIB leaves undefined for them: a PX4 answers it with 0 for
inlet reactive power and carries the reading in the signed column. Use
SensorSignedMinimum to pick the column, as the MIB specifies. The
unsigned column is still needed for active energy, whose range exceeds
Integer32 and reads 0 in the signed one.

An unreachable PDU or a wrong credential looked like a PDU without
switched outlets, since the switching probe was the first exchange with
the device. Probe pduCount first (implemented by every PDU2 agent,
verified on PX2, PX3 and PX4) and return no session when it fails, so
callers print "Couldn't connect to <pdu>". Warn when pduCount is not 1
rather than refusing: a linked primary still answers for its own
outlets.

Add unit tests for the genpdu sensor, session and inventory paths.

Signed-off-by: Kilian Cavalotti <kilian@stanford.edu>
2026-08-24 16:32:41 -07:00
Vinícius Ferrão bae92ffc47 fix(credentials): audit delegated certificate signing 2026-08-20 17:37:19 -03:00
Vinícius Ferrão 1f68e97f9e test(credentials): cover service node certificate delegation 2026-08-20 16:50:31 -03:00
Daniel Hilst c6549352b9 Merge pull request #7724 from VersatusHPC/feat/mknb-exported-genesis
feat(mknb): install exported Genesis images
2026-08-20 13:00:24 -03:00
Vinícius Ferrão be020834f4 Merge pull request #7736 from VersatusHPC/fix/ci-apt-network-timeout
fix(ci): bound the apt network steps with timeouts and retries
2026-08-19 16:35:50 -03:00
Vinícius Ferrão 32b99b9d64 test(ci): require the bounded noninteractive apt install form
The guard held the exact unbounded apt-get install text, so the new
timeout wrapper failed it. Require the timeout command and allow the
apt transfer options, so an unbounded install now fails the guard.
2026-08-19 16:04:05 -03:00
Daniel Hilst d7d71b2c5e Merge pull request #7735 from VersatusHPC/fix/redact-command-log-arguments
fix(xcatd): redact command-log arguments per element
2026-08-19 15:44:02 -03:00
Vinícius Ferrão 0d8d1e60ff test(xcatd): cover per-element command-log redaction
Extract the secret set, the command maps and the redaction routines from
xcatd.pm. Drive the real routines, because the module needs daemon
dependencies that the test host does not have.

Cover a multi-word value, a quoted value, spaces around the operator,
the "+=", ",=", "^=", "!=", "=~" and "!~" operators, the community
strings, a secret embedded in a compound argument with and without
quotes, each Getopt::Long password option form with bundles, the "?"
help letter, abbreviations, "+" prefixes and two-dash letters, values
that hold another secret letter, non-secret compact values that a value
option absorbs, long names that start with a secret letter, the mkvm
case forms and compact values, the chvm positional passwords, the mkvm
clone pw= operand, the vCenter cluster passwords, the snmpc site value
through chdef and tabch with compound selectors, the authentication
tokens, and the product keys. Assert that validate() redacts the
argument vector, that the joined result runs through redact_password,
and that the dispatch trace builds its text from redacted arguments.
Keep every attribute and column pair from Schema.pm, so a removed
table-qualified mapping fails the test.
2026-08-19 13:43:24 -03:00
Daniel Hilst 73fbf10e6b Merge pull request #7716 from VersatusHPC/fix/syncfiles-explicit-root-identity
fix(syncfiles): name root explicitly on the xdcp subrequest
2026-08-19 07:19:11 -03:00
Daniel Hilst 11c55ae8ad Merge pull request #7717 from VersatusHPC/fix/makedhcp-restrict-sn-dispatch
fix(dhcp): only dispatch makedhcp to the service nodes serving the nodes
2026-08-19 07:05:03 -03:00
Daniel Hilst 33a400d37d Merge pull request #7715 from VersatusHPC/cleanup/deprecated-provisioning-deadcode
fix(xcat-server): remove the unreachable deprecated provisioning paths
2026-08-19 06:58:48 -03:00
Daniel Hilst 4e0c0f384c Merge pull request #7714 from VersatusHPC/fix/confluent-explicit-nodes
fix(confluent): configure nodes named explicitly without a console method
2026-08-19 06:52:16 -03:00
Daniel Hilst a5953cbc3d Merge pull request #7713 from VersatusHPC/fix/destiny-boot-sticky
fix(destiny): keep a node on boot when its destiny is advanced again
2026-08-19 06:49:26 -03:00
Daniel Hilst c913af608f Merge pull request #7711 from VersatusHPC/fix/otherpkgs-upgrade-scope
fix(otherpkgs): restrict the package upgrade to the xCAT repositories
2026-08-19 06:47:33 -03:00
Vinícius Ferrão e9c8aaefbb test(xcatd): cover commands.log response redaction
Extracts the three command-log response subs and drives them. It checks the
request classification, the redaction of a bare passwd value, a secret split
across callbacks in either order, the password-content fallback, that a benign
response is kept, and that the finalizer preserves an earlier command's response
on a shared connection. It fails hard if a sub cannot be extracted.
2026-08-18 17:01:26 -03:00
Daniel Hilst 91505a2141 Merge pull request #7719 from VersatusHPC/fix/redact-password-attributes
fix(xcatd): redact node passwords from the command logs
2026-08-18 16:35:46 -03:00
Vinícius Ferrão dd930681a5 test(xcatd): cover the noderange ^ file operator
The test runs the real NodeRange code. It sends a ^ range that a
two-argument open would run as a command and checks the command does not
run. It also reads a real comment-only file to show the operator still
works.

The command assertion fails against the previous behavior.
2026-08-17 12:24:20 -03:00
Vinícius Ferrão bdfe7a4a2c build(server): cover s390x Digest::SHA 2026-08-11 20:45:20 -03:00
Vinícius Ferrão 8f2c508950 fix(mknb): reject incomplete exports 2026-08-11 20:18:27 -03:00
Vinícius Ferrão 9f64387291 test(mknb): cover export manifest validation 2026-08-11 20:13:26 -03:00
Vinícius Ferrão bc12f78a77 test(mknb): prepare export manifest fixture 2026-08-11 20:12:45 -03:00
Vinícius Ferrão c0de6337da test(server): check Digest::SHA dependencies 2026-08-11 20:11:01 -03:00
Vinícius Ferrão 57360b89ff test(mknb): cover exported Genesis images 2026-08-11 20:10:22 -03:00
Vinícius Ferrão 875a6ef40d Merge pull request #7723 from VersatusHPC/fix/kea-xnba-network-fallback 2026-08-11 12:49:44 -03:00
Vinícius Ferrão be51b428a3 Merge pull request #7720 from VersatusHPC/fix/ci-noninteractive-install
fix(ci): make package validation noninteractive
2026-08-11 03:27:56 -03:00
Vinícius Ferrão d8464db7ac Merge pull request #7712 from VersatusHPC/fix/52-ubunturepo-builddir
fix(build-ubunturepo): scope the build lock + scratch under an option…
2026-08-11 03:25:48 -03:00
Vinícius Ferrão c211fdb3bb test(dhcp): cover Kea xNBA network fallback 2026-08-10 17:12:37 -03:00
Vinícius Ferrão 0b8c44b283 test(mknb): cover Genesis boot paths 2026-08-10 15:08:28 -03:00
Daniel Hilst edfe6a8840 fix(build-ubunturepo): scope the build lock per checkout so parallel-lane builds don't fail
build-ubunturepo guarded builds with a single host-global, fail-fast lock at
/var/lock/xcatbld.lock (`flock -n`). Two builds on one host -- e.g. the devel and
stable Ubuntu CD lanes on xcat-master-ub -- therefore collided on that one lock and
the loser exited 1 with "Can't get lock ...", failing the whole pipeline, even though
each lane builds from its own checkout into its own DEST and they share nothing.

build-ubunturepo builds its packages in-place in its own source checkout (it rewrites
debian/changelog and debian/control, drops *.orig.tar.gz at the checkout root and runs
dpkg-buildpackage inside the package dirs), so the resource two concurrent builds
actually contend for is the checkout, not the host. Key the lock on the checkout path
($curdir): builds of the SAME checkout still fail-fast (they would corrupt each other
in-place), while builds of DISTINCT checkouts get distinct locks and run in parallel.
The lock file stays on the local /var/lock (reliable flock, unlike the NFS/virtiofs
checkout) and the source tree is left byte-pristine.

Add xCAT-test/unit/build_ubunturepo_lock.t, which extracts the lock block from the
script verbatim and asserts: the lock path is /var/lock/xcatbld-<hash-of-checkout>.lock
and deterministic per checkout; a second build of the same checkout fails fast; two
distinct checkouts acquire their locks concurrently.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-10 10:26:03 -03:00
Vinícius Ferrão fca07665fe test(xcatd): cover password redaction in the logged commands
Run redact_password rather than inspecting its source, so that a secret which
survives is a failure here rather than something the shape of the code hides.
Each supported way of writing an assignment is exercised, including the table
qualified form and spaces around the equals sign, together with the positional
flag that the per-command table handles.

The expected set is derived from Schema.pm rather than repeated, so an attribute
added there with a secret column fails this test instead of quietly reaching the
logs, and the test bails if that mapping cannot be parsed so it cannot pass
vacuously. Detail that is not secret is asserted to survive, since redacting it
would cost the log its usefulness without protecting anything.
2026-08-09 14:01:11 -03:00
Vinícius Ferrão edd1ca040e test(ci): check syntax exclusions 2026-08-09 13:16:38 -03:00
Vinícius Ferrão de8f81d674 test(ci): check dependency install 2026-08-09 13:09:54 -03:00
Vinícius Ferrão e3d9a633b5 test(ci): cover noninteractive installs 2026-08-09 12:15:04 -03:00
Vinícius Ferrão 158c16a138 test(dhcp): cover the service node dispatch scope for makedhcp
Assert that a node-targeted makedhcp maps its nodes to their service nodes and
skips the ones serving none of them, that regenerating the networks with -n stays
exempt because a dynamic range is not tied to a node, and that an unmapped
noderange still reaches every service node instead of none.

Also pin the two conditions the loop already had, so restricting the fan-out does
not quietly drop the self dispatch guards.
2026-08-08 23:56:27 -03:00
Vinícius Ferrão 97773d9817 test(syncfiles): cover the identity on the xdcp subrequest
Assert that the xdcp subrequest names a username and that it is the arrayref
form, since the consumers index it as ->[0] and a bare string does not survive
that on the non-hierarchical path.

Also pin the two things this depends on: that xdsh still derives
DSH_FROM_USERID from the request username, and that updatenode still passes a
username on its own xdcp call, so the two callers cannot drift apart again.
2026-08-08 20:47:05 -03:00
Vinícius Ferrão 354213e53d test(packimage): guard against the deprecated paths coming back
Scan destiny.pm and packimage.pm for statements sitting after an unconditional
return, which is how the deprecated provisioning paths stayed in the tree after
they stopped running.

Also assert the behavior that has to survive the removal: the deprecated
nodeset states are still rejected, packimage still rejects -o, -p and -a, and a
missing image name is now reported as such rather than as a missing option that
would be rejected anyway.
2026-08-08 01:08:52 -03:00
Vinícius Ferrão bce7657324 test(confluent): cover explicitly named nodes without a console method
Exercise the node-selection block from preprocess_request and the lookup
adjustment from makeconfluentcfg directly, both extracted from the shipped
plugin, with a stand-in nodehm table.

Assert that an explicitly named node is configured whether it has no console
attributes or no nodehm row at all, that neither lookup can emit an empty node
name, and that the full table scan still skips console-less nodes so an entire
cluster is not swept into confluent. That last group is what separates this
from simply removing the skip, and it fails if the skip is dropped outright.
2026-08-07 22:32:43 -03:00
Vinícius Ferrão 66ba9ad79b test(destiny): cover advancing a chain that has run down to boot
Exercise the chain-advance block from nextdestiny directly, extracted from the
shipped plugin so the test cannot drift away from the code it covers.

Assert that repeatedly advancing a node whose remaining step is 'boot' leaves
it on 'boot' and is idempotent, and that the paths which must not change still
behave as before: an exhausted non-boot chain falls to 'standby', a chain with
steps left advances normally, and an empty currchain starts from the default.
2026-08-06 23:30:26 -03:00
Vinícius Ferrão 5f18cc3b78 test(otherpkgs): cover the package upgrade repository scope
Assert that the yum/dnf upgrade is restricted to the xcat-otherpkgs*
repositories in both the verbose echo and the command actually executed, and
that no unscoped upgrade remains.

Also pin the two facts the fix depends on: that the postscript still names its
repositories xcat-otherpkgs<index>, so the enablerepo glob keeps matching, and
that the install path stays unscoped, so package dependencies still resolve
against the full repository set.

The assertions count matches instead of using unlike(), so a failure reports a
count rather than dumping the whole postscript into the test output.
2026-08-06 23:27:51 -03:00
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
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