2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-04 20:17:55 +00:00
Commit Graph

27655 Commits

Author SHA1 Message Date
Vinícius Ferrão d96ddf1f89 test(ipmi): cover netmask validation 2026-08-31 15:26:26 -03:00
Vinícius Ferrão 0518b916b1 fix(ipmi): validate netmask values before writing them 2026-08-31 15:25:55 -03:00
Vinícius Ferrão 7fb2fac0fb test(ipmi): cover transaction-scoped IPv4 resolution 2026-08-31 13:56:41 -03:00
Vinícius Ferrão 5d4d293881 fix(ipmi): resolve IPv4 settings once per transaction 2026-08-31 13:54:25 -03:00
Vinícius Ferrão 96d682312c test(ipmi): cover ambiguous IPv4 literal rejection 2026-08-31 13:29:08 -03:00
Vinícius Ferrão 90317dad4d fix(ipmi): reject ambiguous IPv4 literals 2026-08-31 13:29:07 -03:00
Vinícius Ferrão 8e7d0dd7e4 test(ipmi): cover IPv4 command encoding 2026-08-31 12:35:38 -03:00
Vinícius Ferrão b28985f60c fix(ipmi): centralize IPv4 command encoding 2026-08-30 22:19:41 -03:00
Vinícius Ferrão a5ad2f7b26 Merge pull request #7779 from VersatusHPC/audit/cmdlog-test-boundary
refactor(xcatd): expose command log response handling
2026-08-29 20:49:57 -03:00
Vinícius Ferrão 87103dd1f3 test(xcatd): cover command response state reset 2026-08-29 17:41:03 -03:00
Vinícius Ferrão b7aa8eaa0f refactor(xcatd): keep command response state in CmdLog
Own collection, sensitivity, finalization, and reset as one request-scoped state object so xcatd only forwards callbacks and appends the finalized text.
2026-08-29 17:41:03 -03:00
Vinícius Ferrão 5d9d7403b7 test(xcatd): exercise command log response module 2026-08-29 17:15:23 -03:00
Vinícius Ferrão 916091bfec refactor(xcatd): expose command log response handling 2026-08-29 17:15:23 -03:00
Vinícius Ferrão 4c909bd24a test(xcatd): prepare command log module loading 2026-08-29 16:49:55 -03:00
Vinícius Ferrão 41a0a7c613 Merge pull request #7778 from VersatusHPC/fix/rpm-preserve-xcat-conf
fix(rpm): preserve local xcat.conf changes across upgrades
2026-08-29 16:46:09 -03:00
Vinícius Ferrão fc9a94edb6 Merge pull request #7765 from VersatusHPC/refactor/genimage-shared-os-version-parser
refactor(genimage): reuse shared OS version parser
2026-08-29 16:45:41 -03:00
Vinícius Ferrão c878dbf808 Merge pull request #7747 from VersatusHPC/fix/template-default-httpport
fix(template): omit the default HTTP port from installer URLs
2026-08-29 16:45:16 -03:00
Daniel Hilst 50257ff136 Merge pull request #7748 from VersatusHPC/fix/mellanox-mlx5-netdriver
fix(genimage): resolve Mellanox drivers from the target kernel
2026-08-28 18:11:29 -03:00
Daniel Hilst 4625505b8e Merge pull request #7771 from VersatusHPC/refactor/string-utils
refactor(utils): centralize policy string trimming
2026-08-28 17:42:03 -03:00
Daniel Hilst 3c209888df Merge pull request #7770 from VersatusHPC/refactor/test-file-writing
test: reuse File::Slurper for fixture files
2026-08-28 17:40:34 -03:00
Daniel Hilst 1ba53dc7f8 Merge pull request #7754 from VersatusHPC/fix/centos8-minor-version-detection
fix(anaconda): read the CentOS Linux minor version from the release package
2026-08-28 17:38:16 -03:00
Vinícius Ferrão 999f18eacd Merge pull request #7737 from VersatusHPC/fix/cmdlog-response-classifier
fix(xcatd): classify secret responses by the shared secret set
2026-08-28 17:34:56 -03:00
Daniel Hilst a9a2c1f74e Merge pull request #7732 from VersatusHPC/fix/noderange-preauth
fix(xcatd): refuse the noderange ^file operator on unauthenticated requests
2026-08-28 17:32:33 -03:00
Daniel Hilst ff06b9f9ae Merge pull request #7731 from VersatusHPC/fix/xcatver-mismatch
fix(xcatd): only call a same-release build difference a build difference
2026-08-28 17:28:30 -03:00
Daniel Hilst acc5b9de29 Merge pull request #7772 from VersatusHPC/refactor/package-postscript-utils
feat(postscripts): establish package utility loading
2026-08-28 17:00:21 -03:00
Vinícius Ferrão dffaa1e0c6 test(postscripts): require package utility loading 2026-08-28 16:22:54 -03:00
Vinícius Ferrão c00ed7c181 feat(postscripts): require package utility loading 2026-08-28 15:51:59 -03:00
Vinícius Ferrão 01766a6c66 docs(genimage): document InfiniBand driver defaults 2026-08-28 14:32:49 -03:00
Vinícius Ferrão ee18db925a test(genimage): cover Mellanox InfiniBand defaults 2026-08-28 14:32:48 -03:00
Vinícius Ferrão 801677d447 genimage: include available Mellanox InfiniBand drivers 2026-08-28 14:30:43 -03:00
Vinícius Ferrão 48faeeac5f docs(genimage): show the Mellanox drivers that genimage adds 2026-08-28 12:48:17 -03:00
Vinícius Ferrão ac293c66cb test(genimage): cover target-kernel Mellanox resolution 2026-08-28 12:48:17 -03:00
Vinícius Ferrão c6c7df99bd genimage: resolve Mellanox defaults from target kernel
Resolve optional Mellanox network drivers against the target image's selected kernel. Keep real mlx_en modules, fall back to mlx4_en, include available mlx5_core, and omit missing defaults without changing explicitly requested netdrivers.
2026-08-28 12:48:17 -03:00
Vinícius Ferrão ccf9152bd9 test(rpm): pin xcat.conf upgrade preservation
Cover the packaging rules that keep a locally modified xcat.conf across
an upgrade, for the management-node and service-node specs alike: both
active paths owned as %config(noreplace), the build-time selection of
the Apache 2.4 source into the active payload, %post no longer removing
or overwriting the active file, and the migration living in %pretrans,
returning early on a fresh install, accepting only a regular file, and
removing it only when its contents still match a saved template.

The assertions pin the ordering of those guards instead of searching for
isolated tokens, so moving the migration back to %pre or letting it
delete a customised file fails the test.
2026-08-27 02:34:56 -03:00
Vinícius Ferrão 2487faa678 fix(rpm): preserve local xcat.conf changes across upgrades
xcat.conf was installed as an ordinary payload file and then deleted and
recreated from the Apache-version template in %post. rpm therefore held
no record of what was on disk, and an upgrade replaced an edited file
silently, leaving neither .rpmnew nor .rpmsave. A site that had added
Indexes to the /install block lost it on upgrade and directory listings
began returning 403.

Select the Apache 2.2 or 2.4 configuration at build time, using the same
distribution macros the rest of the spec already relies on, and mark
both /etc/httpd/conf.d/xcat.conf and /etc/apache2/conf.d/xcat.conf as
%config(noreplace). rpm then keeps a modified file and installs the new
vendor version alongside it as xcat.conf.rpmnew.

The old payload recorded the 2.2 file while %post wrote the 2.4 one, so
rpm cannot distinguish a stock file from an edited one across the
transition. A migration compares the active file with the templates the
outgoing package saved under conf.orig and removes it only when it is a
regular file still byte-for-byte identical to one of them. A stock
upgrade then completes without an unnecessary .rpmnew, and anything that
differs is left untouched.

That migration runs in %pretrans, not %pre. rpm fixes each config file's
fate before %pre, so removing the active file there can happen after rpm
has already resolved to write only xcat.conf.rpmnew, leaving the system
with no active configuration at all. %pretrans runs before that decision.
It is an embedded Lua scriptlet because a pre-transaction scriptlet
cannot rely on any dependency being unpacked yet, which also means the
comparison needs no external tool.

bc was needed only by the version check the service-node package no
longer performs.

The Apache directives are unchanged. Document a later-loading conf.d
file as the place for site rules, since that survives upgrades without a
merge.
2026-08-27 01:46:17 -03:00
Vinícius Ferrão 5cb3e6ab52 test(genimage): cover EL version parsing
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-26 18:30:44 -03:00
Vinícius Ferrão e685d7e0ec refactor(genimage): reuse shared OS version parser
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-26 16:42:51 -03:00
Vinícius Ferrão be8e033cbe test: reuse File::Slurper for fixture files 2026-08-26 15:17:52 -03:00
Vinícius Ferrão 88007e77c7 test(template): pin the installer HTTP port suffix
Add a unit test for the routine that makes the port part of a URL. The test
lifts the routine out of the module source, because the module needs a
database to load.

The test shows that the default port gives no text, that another port gives
a colon and the port, and that a port that is not set gives no text. It also
shows that the four places that write a URL read the port through the
routine.
2026-08-26 14:53:34 -03:00
Vinícius Ferrão 5fb762f2b6 test(xcatd): cover the secret set response classification
Extract secret_in_request, secret_in_response and the secret sets from
xcatd.pm, because the classifier and the finalizer consult them. Cover
the authentication key, the privacy key and the snmpc site value reads
as sensitive, the token, prodkey and site table dumps as sensitive, the
nodels expansion of a secret table as sensitive, the lsvm directory
listing as sensitive, and the implicit lsdef attribute listing as
redacted. Keep a plain site value, a benign table,
a benign object listing and a group named like a table as not
sensitive. Assert that the daemon redacts each request segment alone.
2026-08-26 14:53:34 -03:00
Vinícius Ferrão bd55c0bf1e test(anaconda): pin the CentOS Linux minor version from the media
Build a medium for each CentOS Linux 8 release from the package names that
the release gives, and make sure that copycds finds the minor version.

Pin the behaviour when the medium gives no release package, and make sure
that a package with the same centos-release prefix, or a package for a
different major version, does not give a version. Pin that a medium that
names two minor versions keeps the unversioned name. Pin that CentOS Stream,
Rocky Linux, AlmaLinux, Red Hat Enterprise Linux and Oracle Linux keep
their own branches.
2026-08-26 14:23:19 -03:00
Vinícius Ferrão ae06a1edcb fix(anaconda): read the CentOS Linux minor version from the release package
Every CentOS Linux 8 medium gives the same description, "CentOS Linux 8".
The description gives no minor version. The .treeinfo file on the medium
gives no minor version. Thus copycds gave the name centos8 to all of these
media. Two CentOS Linux 8 media then wrote into the same /install/centos8
directory and made osimage definitions with the same names.

The discinfo identifier table gives the minor version, but it contains
only 8.1 and 8.5. The identifiers of an expanded tree are also different
from the identifiers of the DVD. The release package in BaseOS/Packages is
the only other record of the minor version on the medium.

Read the version from the name of that package. CentOS changed the name of
the package to centos-linux-release in 8.3, thus accept the two names.
Accept only a major.minor version, because other packages start with the
same centos-release prefix. Accept only the major version that the
description gives, because a package for a different major version does not
describe this medium. Accept the minor version only when the medium names
one, because a medium that names more than one does not pin a minor version.

Keep the version from the description in the other conditions. A medium that
names no minor version keeps the name centos8, which is the behaviour before
this change and the correct name for media that do not pin a minor version.

CentOS Stream, Rocky Linux, AlmaLinux and Red Hat Enterprise Linux keep
their own branches. CentOS Linux 7 gives a different description and has
no BaseOS directory, thus it does not use this path.

Recovered from the lenovobuild branch. Reimplemented against master: the
original reads only centos-release, which CentOS renamed in 8.3, and its
expression is not anchored.
2026-08-26 12:15:59 -03:00
Vinícius Ferrão 866302c88a fix(template): omit the default HTTP port from installer URLs
The template renderer writes the HTTP port into the URLs of a kickstart
file, an autoyast profile and a preseed file. It writes the port always, so
a URL gets the text ":80" when the site keeps the default port.

A URL that gives no port already goes to port 80. Write the port only when
the site sets a port that is not 80. The netboot plugins xnba, dhcp and mknb
already do this.

The module gave the port in three different ways. One place wrote the port
always. One place wrote the port only when the port was not 80. One place
wrote the port always from the environment. Put the rule in one routine and
let the four places use that routine.

The routine also accepts a port that is set to nothing. Before, an empty
value made a URL that ends with a colon.
2026-08-26 12:15:26 -03:00
Vinícius Ferrão 031ad68a41 fix(xcatd): classify secret responses by the shared secret set
The commands.log response classifier used a "passw" text match on the
request arguments. A secret whose name has no such text passed the
check, so a read of an authentication key, a privacy key or the snmpc
site value logged its bare value in the response. A command that
expands an argument also passed the check: nodels with a table name
returns every column of the table, and lsdef returns attributes that
the request never names. The daemon also ran redact_password over the
whole connection log on each request, so the redactor split at the
first request of the connection and the change signal swept the text of
earlier requests and responses.

Add secret_in_request. The routine reports a request that names a
secret attribute, selects a secret site key, or dumps a table that owns
a secret column through tabdump or nodels, from the same secret set
that the argument redaction uses. The response classifier calls it, so
the response of such a request logs as redacted.

Add secret_in_response. The routine reports response text that holds
"passw" or a secret attribute name in assignment or column form. The
response finalizer calls it in place of the bare text match, so an
expanded listing that carries an authentication key or a product key
logs as redacted even when the request never names it. The lsvm
response is the directory entry, whose passwords are positional, so
the classifier marks the command itself.

Build each request segment alone, redact the segment, and then append
it to the connection log. The redactor now always sees the current
command, and the change signal covers only the current request.
2026-08-26 12:14:21 -03:00
Vinícius Ferrão b2ad18137b Merge pull request #7766 from VersatusHPC/refactor/routeop-helper-reuse
refactor(routeop): reuse route classification helpers
2026-08-26 11:11:44 -03:00
Daniel Hilst b4c7936cc6 Merge pull request #7764 from VersatusHPC/refactor/dhcp-shared-os-version-parsing
refactor(dhcp): reuse shared OS version parsing
2026-08-26 11:09:02 -03:00
Daniel Hilst e8b0620345 Merge pull request #7757 from VersatusHPC/refactor/template-shared-ubuntu-version-comparison
refactor(template): use shared Ubuntu version comparison
2026-08-26 11:06:31 -03:00
Vinícius Ferrão 2dc4afd903 Merge pull request #7741 from stanford-rc/genpdu
feat: add `genpdu` pdutype for generic SNMP PDUs (PDU2-MIB)
2026-08-26 00:14:25 -03:00
Kilian Cavalotti 0b4695eef2 Accept MIB labels for genpdu enumerated values
With PDU2-MIB loaded, SNMP.pm returns an enumerated INTEGER as its label
rather than its number: a PX4 answers inletSensorUnits with "amp" rather
than "2". That failed the numeric test, fell back to none(-1) and
dropped the unit suffix from every rvitals reading.

Add pdu2_enum, which accepts the number, the label, or the label(value)
form Net-SNMP produces with quick printing off, and use it for the
sensor units and for outletSwitchingState.

Also stop requiring the switching probe to read on or off. An outlet can
be in any SensorStateEnumeration state, and pdu2_get has already ruled
out an absent instance, so any answer proves the outlet is switchable.

Signed-off-by: Kilian Cavalotti <kilian@stanford.edu>
2026-08-25 17:44:23 -07:00
Daniel Hilst ab7813e3e6 Merge pull request #7746 from VersatusHPC/fix/blade-findme-chassis-filter
fix(blade): let a discovery request reach the findme handler
2026-08-25 20:26:47 -03:00