2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-24 19:32:17 +00:00
Commit Graph

45 Commits

Author SHA1 Message Date
Daniel Hilst efb8e81cb3 Merge pull request #7996 from VersatusHPC/fix/xcattest-table-value-class
fix(xcattest): a [Table_*] value stops at its first colon or slash
2026-11-06 16:28:35 -03:00
Daniel Hilst 599cd8ac83 Merge pull request #7986 from VersatusHPC/fix/retry-install-transient-icmp
fix(xcat-test): a transient ICMP loss vetoes a node that answers SSH
2026-10-29 15:29:06 -03:00
Daniel Hilst 8a490a6b93 Merge branch 'master' into fix/xcattest-table-value-class
xCAT-test/autotest/testcase/commoncmd/vm_machine_type.sh conflicted:
this branch picks q35 for an x86_64 node with firmware:efi, and master
asks the vmhost libvirt for the machine type. The vmhost probe from
master is kept. vm_machine_type_alias now takes the vmothersetting and
returns q35 for firmware:efi, and q35 does not fall back to the libvirt
default, because the x86_64 default is i440fx.

xCAT-test/bats/vm_machine_type.bats conflicted where both sides added
tests before assert_round_trip. Both sets are kept, with the
assert_round_trip of this branch, plus one test for the q35 rule.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 14:56:49 -03:00
Daniel Hilst 9f4a296310 Merge branch 'master' into fix/xcattest-table-value-class
xCAT-server/lib/xcat/plugins/anaconda.pm conflicted in the module
imports: this branch adds "use xCAT::MediaPerms" and master adds
"use xCAT::SELinux" on the same line. Both imports are kept. The two
modules are used in different subs, and no other hunk conflicted.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 14:45:55 -03:00
Daniel Hilst 7f4c7dbda0 Merge pull request #7983 from VersatusHPC/fix/vm-machine-type-unsupported-on-host
fix(xcat-test): libvirt refuses the compute node machine type pseries-rhel7.6.0
2026-10-29 14:32:40 -03:00
Daniel Hilst 5260c899a2 Merge pull request #7987 from VersatusHPC/fix/diskless-mount-snapshot-kernel-mounts
fix(xcat-test): the diskless cases fail when the kernel mounts binfmt_misc
2026-10-29 14:32:18 -03:00
Daniel Hilst 65f4de2c6b fix(xcat-test): a path that only starts with an xCAT directory name is counted as xCAT
selinux_avc_classify matched the entries of XCAT_AVC_PATH as string prefixes,
with [^"]* before the alternation and no boundary after it. A directory name
is not a string prefix: /var/lib/xcat-cluster-test is not /var/lib/xcat, and
/installer is not /install.

The CI writes its regnotif notification hook to
/var/lib/xcat-cluster-test/event-notify.pl. xcatd executes it, the file
carries var_lib_t, and xcat_t has no execute_no_trans on it, so the audit log
holds the record. The classifier kept it on the strength of the prefix, the
count read XCAT_AVC=1, and selinux_cn_diskful_enforcing failed on a file the
product does not ship. The policy was confining xcat_t correctly.

The path half of the pattern now starts at the opening quote and ends at a /
or at the closing quote, so a listed directory matches itself and the files
under it, and nothing else. The subject half is unchanged: a denial by an
xCAT program is still kept whatever the path.

selinux_avc_check.bats covers it. Reverting the boundary group fails the
sibling-path test alone; requiring a trailing / fails the bare-directory test
alone.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 08:11:14 -03:00
Daniel Hilst 1e8a935ca3 fix(xcat-test): a transient ICMP loss vetoes a node that answers SSH
node_pingable asks ICMP up to PING_TRIES times and stops at the first answer,
so a few seconds of loss after a node boots no longer forces a second full
rinstall. A node that never answers still reports non-pingable, and the caller
still vetoes it: the signal is kept, not removed.

The probe is lifted into a function with a main-guard rather than left inline,
so a bats test can drive it without running a provisioning loop or needing an
xCAT database. Nothing sources this script -- all nine callers execute it -- so
the guard changes no caller.

The happy path is unchanged at one ask. A node that never answers now costs
PING_TRIES asks before the verdict, which is under a minute against the six
minutes of the reinstall it decides.

retry_install_transient_icmp.bats passes 5 of 5. Removing the bounded retry
fails assertions 2 and 4, which are the retry properties, and leaves assertion 3
passing -- a node that never answers is still not pingable. That assertion is
the discriminator: without it the change could not be told apart from deleting
the check, which would turn a flaky probe into one that cannot fail.

xCAT-test/bats is 596 passed, 19 failed. All 19 are
xcatroot_rootimg_checksum.bats, which reports 0 passed and 19 failed on
upstream master with none of this branch applied.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-24 21:00:30 -03:00
Daniel Hilst 91e6672110 fix(xcat-test): the diskless cases fail when the kernel mounts binfmt_misc
The diskless cases snapshot the mount table before genimage and after it and require the two to
be identical, ignoring only fusectl. The comparison is there to catch a bind mount genimage
leaves inside the root image, which is worth catching.

It also fails for mounts the kernel makes on its own. binfmt_misc is an autofs stub that becomes
a real mount the first time a process reads /proc/sys/fs/binfmt_misc, and tracefs appears under
/sys/kernel/debug the first time anything opens debugfs tracing. On openeuler22.03sp4 both
appeared during genimage and failed reg_linux_diskless_installation_flat four minutes into a
1168 second case, while the provisioning that followed succeeded and the node reached booted.
The single fusectl exclusion shows the same class was met once before and patched by name.

mount_snapshot.sh drops the mounts whose mount POINT is under /proc or /sys, which is where the
kernel keeps its on-demand mounts, and the three cases take their snapshots through it. Dropping
them by filesystem TYPE would hide the leak the comparison exists for, because a leaked genimage
bind is itself a proc or sysfs mount. fusectl needs no exclusion of its own any more.

mount_snapshot.bats covers both directions. Taking the filter out fails the two
ignore-the-kernel assertions and keeps both leak assertions; filtering by type instead of by
mount point fails only the leaked-bind assertion. A test-only commit would skip rather than fail,
because require_repo_file skips when the script is absent, so the proof is those two mutations.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-24 20:36:08 -03:00
Daniel Hilst b37793400d fix(xcat-test): libvirt refuses the compute node machine type pseries-rhel7.6.0
reg_linux_diskless_installation_flat fails on every ppc64le cell. rpower boot
leaves the compute node down and libvirt reports "unsupported configuration:
Emulator '/usr/bin/qemu-system-ppc64' does not support machine type
'pseries-rhel7.6.0'".

vm_machine_type_for_arch in vm_machine_type.sh answered machine:pseries-rhel7.6.0
for every ppc64 architecture. The ppc64le hypervisor runs AlmaLinux 10, whose
qemu-system-ppc64 declares pseries-5.0 to pseries-10.2 and no rhel machine type,
so the name the case writes cannot be defined there.

The function now reads the vmhost of the node and asks that host's libvirt. It
writes the plain alias when libvirt accepts it, that libvirt's own default when
it does not, and the alias when the vmhost cannot be asked. x86_64 keeps
machine:pc, which is an alias and stays valid.

xCAT-test/bats/vm_machine_type.bats covers it. Nine of its tests fail on the
previous commit, among them "the vmhost accepts the machine type that comes
back" and "the machine type is the alias the vmhost accepts".

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-24 05:38:14 -03:00
Daniel Hilst 1ab2f68a32 fix(xcattest): the diskless case takes a UEFI node to i440fx
reg_linux_diskless_installation_flat asks vm_machine_type.sh for a valid
machine type, and the helper answers machine:pc for every x86_64 node. A
node with firmware:efi then cannot boot: libvirt refuses a UEFI firmware
on i440fx, rpower boot fails and the case reports a provision failure
that has nothing to do with provisioning.

vm_machine_type_for_arch now reads the vmothersetting it saved and
answers machine:q35 for an x86_64 node that asks for a UEFI firmware. An
x86_64 node without one still gets machine:pc.

vm_machine_type.bats covers both, and a mutation that answers machine:pc
for a UEFI node turns the two new tests red.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 19:36:46 -03:00
Daniel Hilst cb4e7bc09b fix(xcat-test): a quiet audit window fails, and a control leaks into the next case
The SELinux cases marked their audit window with date "+%H:%M:%S" and
gave it to selinux_avc_check.sh. Two failures follow from the time
window. The body of selinux_mn_labels runs inside one second, so an el9
run reported SEARCHED=0 and the guard called a quiet node a usage error.
And ausearch -ts has one second of granularity, so the denials that the
positive control of selinux_mn_labels creates on purpose landed in the
window of selinux_restapi_avc, which failed with XCAT_AVC=2 on two
httpd_t getattr records it did not cause.

selinux_avc_check.sh takes a checkpoint file: --init consumes the
records written so far and prints BASELINE, --since reports the denials
after that point. A checkpoint is an offset, so an empty answer has one
meaning and two cases cannot read one record. Each case opens its own
checkpoint, and the positive control opens a second one, which also
removes the sleep 1 that the granularity needed.

The count refuses an answer that is neither a record nor '<no matches>',
so an ausearch error message cannot read as a clean window. The -ts form
stays for the keywords boot and today, and now asks for today's records
before it calls an empty window a usage error.

/xcatpost is reported and no longer asserted on a compute or service
node. The kickstart relabel runs in %post, the xCAT post scripts write
that tree at the first boot, and the node carries no xCAT-selinux, so a
clean restorecon -Rnv there is not what the design promises.

selinux_avc_check.bats fails 7 of its 15 checks without this change, on
rome01.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 19:35:31 -03:00
Daniel Hilst b5607a944c fix(xcat-test): every AVC check in the selinux cases searches an empty window
The cases marked the start of their window with date "+%x %T" and gave
it to ausearch. audit 4.0.3 takes a bare HH:MM:SS and rejects that
format: it prints nothing and exits 0. Measured on an enforcing
AlmaLinux 10.2 management node, with the raw log holding 4197 records:
"-ts 10/21/2026 20:59:08" returned 0 records, "-ts 20:59:08" returned
22 and "-ts today" returned 4006. So selinux_avc_check.sh searched
nothing and reported XCAT_AVC=0 whatever the node did.

The positive control of selinux_mn_labels is what found it. The case
mislabels /install/postscripts/xcatdsklspost, shows httpd answering 403
and requires the check to report XCAT_AVC=[1-9]; it reported
SEARCHED=0 AVC=0 XCAT_AVC=0 and the case failed on an enforcing el10
node.

The four cases now write date "+%H:%M:%S". selinux_avc_check.sh refuses
a window that holds no audit record at all, because that is not a
credible answer on a running node, and names the format in the message.
selinux_avc_check.bats fails its ninth check against the unguarded
script.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 18:00:10 -03:00
Daniel Hilst 89dee4de1e fix(xcat-core): the SELinux AVC checks assert no denial of any kind
Eight checks in the selinux testcases asserted ausearch output =~ "<no
matches>", which is zero denials of any kind in the window. A cluster
denies things xCAT has nothing to do with. On an idle enforcing
management node httpd asks the kernel for net_admin on itself every ten
seconds, and the base policy carries no dontaudit rule for that shape.
One node logged 1034 denials in a day, 817 of them that one shape. So
the assertion cannot pass once ausearch is called correctly, and before
--input-logs was added it could not fail.

selinux_avc_check.sh keeps the denials whose subject program or object
path belongs to xCAT and counts those. The cases assert XCAT_AVC=0.
selinux_mn_labels now also plants a denial on purpose: it mislabels
/install/postscripts/xcatdsklspost, shows httpd answering 403, and
requires the check to report XCAT_AVC=[1-9] before restoring the label.
A counting method with no positive control cannot be trusted to find
anything.

restorecon -RnvF reports a difference in the SELinux user as well as the
type, and the files xCAT writes carry unconfined_u. On one node -RnvF
printed 12 lines over /install where -Rnv printed 2. The checks use
-Rnv, which is the type they assert.

The six cases were in no bundle and in no pipeline conf, so none had
ever run, which is why the dead checks were not noticed.
selinux.bundle and selinux_mn.bundle name them, and selinux_bundle.t
fails when a case is in no bundle.

Tests: selinux_avc_check.bats drives the classifier with records
measured on an enforcing management node. Replacing the filter with one
that keeps every record fails 4 of its 8 checks; dropping the
object-path branch fails 2. selinux_bundle.t fails when selinux.bundle
is removed. selinux_kickstart_template.t asserted the relabel order with
a regex that matched wherever the relabel sat; it now compares line
positions, and moving #SELINUXRELABEL# above the xCAT post includes
fails it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 10:34:36 -03:00
Daniel Hilst dafe7a4aeb Merge pull request #7922 from VersatusHPC/fix/xcattest-vmothersetting-restore
fix(xcat-test): the installation cases corrupt a versioned machine type in vmothersetting
2026-10-14 11:04:30 -03:00
Daniel Hilst 0e1c3d0808 fix(xcat-test): vm_machine_type.sh overwrites its snapshot and saves a failed lsdef
vm_machine_type.sh invalid ignored the exit status of lsdef. When lsdef
failed, it saved an empty vmothersetting, and the next restore deleted
the configuration of the node. A second invalid replaced the saved
value with one that holds machine:invalid. The state file was a
predictable /tmp path that the script truncated and followed through a
symbolic link.

invalid now stops before it saves or changes anything when lsdef fails,
or when a saved value already exists. An empty value that lsdef read
is still saved. The script creates the state file with O_EXCL in a
directory that the current user owns with mode 0700. The default
directory is /tmp/xcattest-vmothersetting.<uid>. The script refuses a
symbolic link, a directory that other users can open, and a file it
does not own. When chdef fails in invalid, the script deletes the new
snapshot. A failed restore still keeps it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-12 10:59:20 -03:00
Daniel Hilst 3265574c1e fix(xcat-test): the installation cases corrupt a versioned machine type in vmothersetting
reg_linux_diskless_installation_flat adds a machine type to
vmothersetting and removes it again with a substring sed. When the node
already names a versioned machine type, the sed removes the first match
from the user's own value: cpumode:host-passthrough;machine:pc-q35-9.2
comes back as cpumode:host-passthrough-q35-9.2;machine:pc. The same
happens on riscv64 with machine:virt-9.2.

vm_machine_type.sh now saves the exact vmothersetting before it adds
machine:invalid, and restore writes that value back and deletes the
saved copy. An empty value clears the attribute. apply keeps a machine
type that the node already names and adds the architecture default only
when there is none. restore fails when no value was saved, and apply
fails for an architecture without a default.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-09 11:48:03 -03:00
Daniel Hilst e79ba14bcd refactor(xcat-test): move the vmothersetting machine type logic into a helper
reg_linux_diskless_installation_flat sets machine:invalid, a valid
machine type and then no machine type in vmothersetting with three long
inline commands. The bats test for them cut the commands out of the case
file with a regex.

Move the three commands unchanged into commoncmd/vm_machine_type.sh and
call it from the case. The bats test now sources the helper and runs the
case's three steps against a stubbed lsdef and chdef.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-09 11:46:47 -03:00
Daniel Hilst fd7e2ade84 fix(xcat-core): nic_cfg.sh backup hides a failed copy of a SUSE ifcfg file
The SUSE branch of nic_cfg.sh backup ran one cp over the ifcfg-* glob
with "|| :" and stderr sent to /dev/null. That form was needed so a
directory with no ifcfg file did not fail the backup, but it also made a
real copy failure return 0 with no message.

Copy each ifcfg file in a loop. A glob that matches nothing is skipped,
and a cp that fails stops the backup with a non-zero exit and the cp
error on stderr.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-07 13:46:28 -03:00
Daniel Hilst 39037f7f2e style(xcat-core): the new case comments explain more than the code needs
The comments added with these fixes carried the bug history, the failing case
names and the reproduction detail. A reader of the code cannot act on any of
it, and the commit message already holds it.

Each comment is reduced to the one fact the code does not show: the platform
difference, the invariant, or the reason the simpler form is wrong.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-07 13:45:45 -03:00
Daniel Hilst 0161c3ecd1 fix(xcat-core): nic_cfg.sh backup fails on a node with no network configuration
"nic_cfg.sh backup" returns 1 on a node that has just netbooted, so
confignetwork_static_installnic fails on its third command before it configures anything. The
identical call seven seconds later returns 0, once confignetwork has created the directory.

The backup arm ended in a cp over the backend's configuration directory, so the script exited
with that cp's status. A diskless Ubuntu node has no /etc/network/interfaces.d until
confignetwork writes one, the cp failed, and the caller read "nothing to back up" as a
failure.

Copy only when the source directory exists. A cp that fails with the directory present still
returns non-zero, and so does a backup that cannot create its own directory.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 3a682a130dffe2406a5048174e174ee693133cc4)
2026-10-07 13:45:26 -03:00
Daniel Hilst b9a477b86c test(xcat-core): capture the NIC backup that fails on a node with no network configuration
confignetwork_static_installnic fails on its third command, on every Ubuntu cell, because
"nic_cfg.sh backup" returns 1. nic_cfg_backup_absent_dir.bats drives the backup subcommand
for each backend with no configuration directory present, and four of its six tests fail
without the fix that follows.

The two that pass in both states are the ones that hold the behaviour down: a backend whose
directory does exist still has its files copied, and a backup that cannot create its own
directory still reports failure.

nic_cfg.sh takes the backend and every directory from the environment so the test drives it
against a scratch tree. Nothing else reads those names, and the defaults are unchanged.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit d3589094c9056ade0006e82741916ae9d82ac9a2)
2026-10-07 13:45:24 -03:00
Daniel Hilst 86aaceb714 fix(xcat-core): read the NIC configuration from the file NetworkManager reports
confignetwork_secondarynic_nicextraparams_updatenode fails on EL8 because the dump
nic_cfg.sh prints carries no extra params, although configeth wrote CONNECTED_MODE and the
node has it.

nm_show resolves the connection's backend file by globbing
/etc/NetworkManager/system-connections for the UUID. The keyfile plugin keeps a connection
there, and on EL9 and EL10 it is the only plugin. On EL8 the ifcfg-rh plugin owns the
connection and keeps it under /etc/sysconfig/network-scripts, so the glob matches nothing and
no file is dumped. Every check that greps the dump for a value nm_show does not normalize
then sees nothing.

Ask NetworkManager for the path through the UUID,FILENAME fields and keep the glob as a
fallback. Read the MTU from either spelling, because a keyfile writes "mtu=" and an ifcfg
file "MTU=".

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-05 14:07:47 -03:00
Daniel Hilst 2228479cac test(xcat-core): capture the nicextraparams repair on an ifcfg profile
The persist test sourced only xcatlib.sh and never reached the gate in configeth that skipped an
ifcfg profile, so putting that gate back left every test green. Its refusal test also passed on a
127 from a missing function.

The test now calls the repair through xcat_nm_persist_nic_extra_params with nmcli stubbed to
report an ifcfg file and a keyfile. It also captures three faults of xcat_persist_nic_extra_param:
it keeps an old value, it joins the key to a last line with no newline, and it appends a keyfile
key after a section that follows [user].

nic_cfg.bats captures that nm_show prints no profile when NM reports an ifcfg file, so the xcattest
case cannot match CONNECTED_MODE=yes there. nic_cfg.sh returns before its dispatch when sourced.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-05 14:07:36 -03:00
Daniel Hilst 1aa05e8304 fix(xcat-core): two branches word the same guard two ways
fix/service-node-el fixed the management-node guard as commit 0f708b96a, with the same
correction this branch made: the log must hold lines, not gain them. The two differ
only in the comment and in the error message, so the file no longer merges as one
change.

The wording here now matches fix/service-node-el. The remaining difference in this file
is the doubled-slash path filter, which that branch does not carry.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-30 13:16:01 -03:00
Daniel Hilst 23e6debaad fix(xcat-core): the provisioning-source check reads the host log beside the test one
local_logs added XCAT_HTTPD_ACCESS_LOG to the list of candidate logs and then
read the system paths as well. On a build host that runs apache, the check
counted the host's own /var/log/apache2/access.log beside the file the test
pointed at, so a test could not control what it measured. The empty-log case
read 64 lines it did not write.

An explicit XCAT_HTTPD_ACCESS_LOG now replaces the search instead of extending
it. Production behaviour is unchanged: nothing sets that variable there.

Without this change the bats case for an empty management-node log fails on a
host that serves apache, and passes on one that does not.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit bcb4a77f1a)
2026-09-30 13:15:36 -03:00
Daniel Hilst d54ee26911 fix(xcat-core): the baseline error names the service node and a log path together
check_provisioning_source.sh --baseline wrote one message for two conditions:
"no access log to baseline on ${MN_BASE:+$SN}${MN_BASE:-$MN}". When the management
node has a log and the service node does not, the second expansion returns the
management node's baseline spec, not a host name. On xcat42 the message read "no
access log to baseline on nosuchnode-xyz/var/log/httpd/access_log:881". That is the
message an operator reads when xdsh cannot reach the service node, so it has to name
the host that has no log.

Each condition now has its own test and its own message.

check_provisioning_source.bats covers the service-node condition. The case also
asserts the management node's log path is absent from the message, because the node
name alone matches the old text as a substring.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 89ac4558a0)
2026-09-30 13:15:32 -03:00
Daniel Hilst 6382bf81e2 fix(xcat-core): the provisioning-source check fails a correct hierarchical run
On the Ubuntu 24.04 hierarchy cell the check reported the right counts and then
failed: "xcat22-sn served xcat22-cn 277 boot-payload request(s)", "xcat22-mn-dhilst
served xcat22-cn 0", and then "no httpd access log with new entries could be read on
xcat22-mn-dhilst". The guard required the management node log to gain lines after the
baseline. It does not: the management node provisions the service node in
SN_setup_case, before the baseline the hierarchy case takes, and it is then idle. Its
silence is the result the check exists to find.

The guard now asks that the log hold at least one line, which is what makes a count of
0 mean something, and no longer asks for activity in the measured window.

The path filter also missed a doubled leading slash. The compute node fetches the root
image with wget as //install/netboot/<os>/<arch>/compute/rootimg.cpio.gz, which the
service node logged and the filter did not count.

check_provisioning_source.bats covers both. The four cases added in the commit before
this one fail without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-30 12:41:05 -03:00
Daniel Hilst d6f25640b1 fix(xcat-core): the provisioning-source check reads requests from earlier runs
check_provisioning_source.sh counted every request the compute node had ever
made, for any path. Both directions were wrong. A flat run left
management-node requests for the same address, so a later hierarchical run
read them as its own and failed. A service-node entry from an earlier run, or
a 404 for /favicon.ico, satisfied the positive check without any boot payload
being served.

The script now takes a baseline. --baseline records how many lines each access
log holds on the management node and on the service node, before provisioning,
and the check counts only lines after that point. It counts only requests
under /install or /tftpboot, which are the trees httpd serves a boot payload
from. A log shorter than its baseline was rotated, so it is read from its
first line. Without a baseline the check refuses to answer instead of reading
the whole log. The three hierarchy cases call --baseline before nodeset.

check_provisioning_source.bats covers both regressions: a management-node
request before the baseline no longer fails the run, a service-node request
before the baseline no longer satisfies it, and a request that carries no boot
payload does neither. Removing the baseline comparison fails the first two.
Removing the path filter fails the other two.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-30 11:07:01 -03:00
Daniel Hilst 95005ad836 test(xcat-test): the hierarchy cases cannot tell a hierarchical provision from a flat one
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-29 17:18:03 -03:00
Daniel Hilst a6f77a9732 fix(xcat-core): complete the Ubuntu Subiquity diskful install
Boot the live installer correctly. Add boot=casper so casper actually processes
netboot=nfs instead of scanning local disks and panicking, resolve the install server
to a literal IP because casper mounts the live filesystem with klibc's nfsmount which
has no resolver, and add toram so casper copies the squashfs into RAM and unmounts the
NFS source. That last one is what lets the node reboot at all: with the NFS root still
mounted, systemd-shutdown waits forever on an lvm/pvscan wedged in uninterruptible I/O
on it and the node never power-cycles into the disk it just installed. casper has no
cmdline knob for NFS mount options -- it parses only nfsroot= and takes the whole value
as the path -- so toram is its supported way to avoid a network root.

Write the installer's resolv.conf nameserver as an IP. glibc's resolver discards a
hostname given on a nameserver line, so the xcatmaster name left the installer, and
the in-target apt that inherits the file, with no DNS at all.

Add the online archive through apt `sources:` on classic-sources releases, where
Subiquity renders the target sources.list from the install media alone and in-target
apt cannot find packages the ISO does not carry. Deb822 releases are excluded: their
primary mirror already lands in ubuntu.sources, so legacy .list files would configure
the same suites twice.

Flip the node to local-disk boot from the live installer over bash's /dev/tcp instead
of relying on updateflag.awk, which needs gawk's |& coprocess while Ubuntu's
/usr/bin/awk is mawk. The exchange is checked, and a failure is recorded in the
install log rather than silently PXE-looping into another install.

Defer syncfiles to the postbootscripts on the diskful install path, so it runs on the
booted node with sshd up rather than inside the in-target chroot where the MN cannot
reach it.

Make the test harness's provision wait overridable through WAIT_FOR_PROVISION; the
default stays short so a boot loop still fails fast.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-24 15:41:32 -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
Daniel Hilst 638f0d75c4 Fix xCAT 2.18 EL10 x86_64 package build issues
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-06-20 18:48:14 -03:00
Mark Gurevich c3289c01e1 Add openbmc Python installation test on SN 2022-04-19 10:35:35 -04:00
Mark Gurevich d43dfe0469 Shorten provision wait time 2021-04-21 13:40:30 -04:00
Mark Gurevich 3196739848 Retry rinstall if first one fails 2020-08-12 09:58:25 -04:00
Mark Gurevich 1fdbbe65eb More clear default 2020-04-20 18:18:07 -04:00
Mark Gurevich a5e02ed06f Change retry_install default for number of attempts 2020-04-20 16:04:31 -04:00
Mark Gurevich f58645bcb9 go-xcat testcase enhancements 2020-03-06 13:37:24 -05:00
Mark Gurevich 4ed604ffb0 Install repoquery for go-xcat testcases 2020-02-28 09:59:07 -05:00
Mark Gurevich 457c1d6ca1 Improve install script and testcases 2020-02-27 13:27:42 -05:00
litingt 09edffb750 update cases to let rinstall try several times 2019-01-23 01:37:03 -05:00
litingt 7dbe381b5a update script to add repeat times 2019-01-11 03:25:47 -05:00
litingt e2939f6605 implement a script to achieve retry mechanism against rinstall 2019-01-11 02:53:29 -05:00