2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-21 16:39:30 +00:00
Commit Graph

2897 Commits

Author SHA1 Message Date
Daniel Hilst e82af69caf test(xcat-core): a missing fixture in two POWER install tests stops the whole suite
debian_install_prescript.t and ubuntu_subiquity_storage.t called BAIL_OUT
at eight places where an extraction or a fixture was not what they
expected. prove stops every remaining file on a bail-out, so one changed
script hides the results of every test that would have run after it. die
is just as loud and costs only its own file.

Three comments also carried the incident rather than the constraint. The
prescript test header named a build number, a cell, a case and the ssh
error the node produced nine times; the boot-file test repeated the
nodeset message and the media table below it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-14 08:35:54 -03:00
Daniel Hilst 637d953d5a test(xcat-core): the storage harness counts two partitioning branches by hand
ubuntu_subiquity_storage.t rewrites every /tmp/partitionfile redirect in the
extracted block into a scratch tree, and bails out unless it rewrote exactly
two. The number is the count of firmware branches the script had when the
harness was written, so adding a branch stops the test rather than covering it.

The guard now counts the branches it found and requires one redirect each, and
fails separately if any path escaped the sandbox. It still bails out on a block
with fewer than two branches, which would mean the extraction stopped matching.

Still red on the PReP case of the previous commit: the block does not ask uname
for the machine architecture yet.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-14 07:27:58 -03:00
Daniel Hilst 4a8877618a test(xcat-core): the Ubuntu POWER diskful install loops in the installer
reg_linux_diskfull_installation_flat fails on ubuntu-22-ppc64le-devel and
ubuntu-24-ppc64le-devel in build #121 of xcat-core-devel-ubuntu-cd. The node
answers ping but the case ends on
"root@xcat25-cn: Permission denied (publickey,password)" and the node status
never leaves powering-on.

The serial console shows why: the Subiquity installer starts, runs the
early-commands, errors, tars /var/log/installer to port 8080 and reboots. Nine
cycles in 75 minutes. The installed system never exists, so the address belongs
to the live installer and it refuses the root key.

Two causes, both POWER-only.

mkinstall picks pre.ubuntu.subiquity, then overwrites that choice with
pre.ubuntu.ppc64 for every ppc64 node. That script writes a partman recipe;
the early-commands append it to /autoinstall.yaml, which Subiquity then cannot
parse.

pre.ubuntu.subiquity has a UEFI branch and a BIOS branch and nothing else, so a
ppc64el node takes the BIOS branch and is given a bios_grub partition. POWER
firmware boots from a PReP partition.

debian_install_prescript.t drives the script choice, which mkinstall keeps
inline, so it bails out. ubuntu_subiquity_storage.t gains a PReP case; its
extracted block asks uname for the machine architecture, which the block does
not do yet.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-14 07:27:58 -03:00
Daniel Hilst 7aeb4ee189 test(xcat-core): nodeset refuses an Ubuntu POWER live image it can boot
reg_linux_diskfull_installation_flat fails on every ppc64le cell of
xcat-core-devel-ubuntu-cd. nodeset stops before it writes a grub2 entry
(build #119, ubuntu-24-ppc64le-devel):

    xcat25-cn: The network boot initrd.gz is not found in
    /install/ubuntu24.04.4/ppc64el/install/netboot.

The Ubuntu ppc64el live-server ISO carries no netboot tree. It keeps the
installer kernel and initrd under casper: 22.04 and 24.04 ship hwe-vmlinux and
hwe-initrd beside vmlinux and initrd, 26.04 ships the release pair only.
%INSTALL_BOOT_FILES describes that layout for x86 and not for POWER, and
mkinstall carries a second, POWER-only precondition on
install/netboot/initrd.gz that no live image satisfies.

The new cases resolve the POWER casper layouts, and ask a single routine
whether media is bootable. They fail now.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-11 15:09:27 -03:00
Daniel Hilst aaedeb8655 Merge pull request #7829 from VersatusHPC/feat/subiquity-pkglist
feat(ubuntu): install the osimage pkglist during the Subiquity autoinstall
2026-09-11 12:53:13 -03:00
Vinícius Ferrão 65232ac215 test(xCAT-test): pin one time daemon per Subiquity install
The compute pkglist of each Subiquity release and architecture is
resolved as mkinstall resolves it, its packages read as ospkgs reads
them, and joined with the template's fixed set: chrony must be there, ntp
must not, and the union must carry exactly one time daemon. 16.04 must
still resolve the shared list with ntp. Against the previous tree the
20.04, 22.04 and 24.04 cases fail.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-11 11:38:16 -03:00
Vinícius Ferrão bf2f453151 test(xCAT-test): stop pinning the shared list for the 24.04 compute profile
The install compute profile gets a 24.04 pkglist of its own next, so the
assertion that it resolves the shared list with ntp is removed ahead of
it. The service, kvm and netboot cases keep that pin.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-11 11:38:16 -03:00
Vinícius Ferrão 8d4fd845ed test(xCAT-test): pin the autoinstall token in the Subiquity template
The packages list must carry the token and keep openssh-server and wget,
which xCAT and the template's own commands need. Against the previous
template the token assertion fails.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-11 11:38:16 -03:00
Vinícius Ferrão d266a6ef7b test(xCAT-test): cover the autoinstall package list rendering
The entry filter is called directly, and a template with the token is
rendered through subvars against a pkglist with a comment, a removal, a
group and an include. The rendered list must carry one item per package
at the token's indentation, and no token line without a pkglist. Against
the previous module the helper does not exist.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-11 11:38:15 -03:00
Vinícius Ferrão c96d879367 test(xCAT-test): cover the pkgdir mirrors in the Subiquity apt configuration
The source specs are derived from a pkgdir value alone, and the apt
configuration is rendered with only the database readers stubbed, online
and offline, Deb822 and legacy, with and without otherpkgs repositories.
Against the previous module the spec helper does not exist.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-11 11:38:15 -03:00
Daniel Hilst 804dcdd3c7 Merge pull request #7825 from VersatusHPC/fix/ubuntu-dependency-declarations
fix(debian): declare the perl modules and tools the Ubuntu packages need
2026-09-11 06:54:41 -03:00
Daniel Hilst e3286b517b Merge pull request #7826 from VersatusHPC/fix/ospkgs-apt-force-yes
fix(postscripts): stop passing the deprecated apt --force-yes flag
2026-09-11 06:51:09 -03:00
Vinícius Ferrão f995c8dcb3 test(xCAT-test): pin the otherpkgs source form per release
The online configuration is rendered with an otherpkgs repository on a
classic release and on a Deb822 release: the first must carry the
one-line trusted source, the second a Deb822 stanza with Trusted: yes and
no one-line form. Against the previous module the Deb822 case renders the
one-line form.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-10 17:36:06 -03:00
Vinícius Ferrão b8ab7be46e test(xCAT-test): cover the detect_dhcpd capture lifecycle
Inside the private network namespace the fake tcpdump records its parent,
its output file and the TERM it receives, ps records any use, and a second
fake tcpdump fails at once. Both copies must start tcpdump directly, write
under TMPDIR, stop it by pid, leave no file behind, and exit 1 when the
capture fails. The block skips where no namespace is available.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-10 12:02:09 -03:00
Vinícius Ferrão 58828b7a0e test(xCAT-test): cover the cuda install status of ospkgs
The ospkgs apt block runs with a shadowed apt-get that fails only for the
cuda install, and RETURNVAL must carry that status. Against the previous
script the test fails with RETURNVAL=0.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-09 20:29:09 -03:00
Vinícius Ferrão c7b442598e test(xCAT-test): cover the apt calls of ospkgs and otherpkgs
xcat_apt_get is sourced from xcatpkgutils.sh and called with a shadowed
apt-get that records its environment and arguments. The apt block of
ospkgs and the two apt commands of otherpkgs are extracted from the
scripts and executed the same way, since neither script can be sourced.
Against the previous scripts 6 of the 7 tests fail: the helper does not
exist, and the recorded calls carry --force-yes.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-09 20:17:58 -03:00
Vinícius Ferrão 17126c74a9 Merge pull request #7823 from VersatusHPC/feat/bats-shell-tests
test(xcat-core): Introduce BATS & convert shell scripting tests to it
2026-09-09 19:48:49 -03:00
Vinícius Ferrão c486387bd4 test(xCAT-test): pin the Debian dependency declarations
The control files are parsed the way dpkg reads them, one stanza per binary
package, and the declarations of perl-xcat, xcat-client, xcat-server, xcat
and xcatsn are held to the modules and tools their files use, with the
ipmitool-xcat floor. 25 of 26 assertions fail against the previous
control files.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-09 13:18:53 -03:00
Vinícius Ferrão 166da7c1b6 test(xCAT-test): cover the install architectures debian.pm accepts
The plugin is loaded and install_darch is called for the architectures
xCAT installs Ubuntu on and two it does not. Against the previous plugin the
test fails on the missing function: the mapping was inline in mkinstall.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:34 -03:00
Vinícius Ferrão 5a541814df test(xCAT-test): pin what a riscv64 management node installs and serves
The grub-common assertion fails against the previous metapackage. The rest pins
what must NOT change: a riscv64 management node still recommends the x86 boot
payload and the Genesis images of the other architectures, because it serves
them to the nodes it provisions.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:33 -03:00
Vinícius Ferrão f0c7803595 test(xCAT-test): cover the declaration of the loader build tool
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:33 -03:00
Vinícius Ferrão 9f35a4b8cb test(xCAT-test): build the riscv64 loader from real Ubuntu media
The stubbed test proves the decisions copycd makes; this one proves the
artifact. It runs the real grub-mkimage over the grub2 package of copied media
and checks the image against the validation nodeset depends on, so a package
layout change or a grub-mkimage that stops accepting these inputs is caught
where it happens.

It needs media and the grub2 tools, so it skips without
XCAT_TEST_UBUNTU_RISCV64_MEDIA. Run on a management node against the 24.04 and
26.04 riscv64 trees.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:32 -03:00
Vinícius Ferrão 56910729ce test(xCAT-test): drive the mirror choice with the osarch value genimage reads
The mirror assertions passed a Debian architecture straight in and so never
exercised the conversion genimage performs first. They now start from the xCAT
osarch value, which is what let the 32-bit x86 token reach the wrong archive.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:32 -03:00
Vinícius Ferrão 828d0d2fdf test(xCAT-test): capture a riscv64 build depending on the x86 Genesis scripts
Four assertions fail against the previous debian/control: the dependency has no
architecture restriction, and dpkg's own parser still reports it for riscv64.
The last assertion pins that the restriction drops nothing else.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:31 -03:00
Vinícius Ferrão f9baf6e05b test(xCAT-test): follow the riscv64 netboot values naming Ubuntu
The assertion pinned the EL-only text and failed once the documented values
named Ubuntu as well.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:31 -03:00
Vinícius Ferrão 33eba52b96 test(xCAT-test): cover the packages go-xcat installs on riscv64
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:28 -03:00
Vinícius Ferrão 44f125b63d test(xCAT-test): cover the install mirror the template renders
Calls the selection the template performs. Covers the ports archive for
ppc64el and both spellings of ppc64, the main archive for every x86
spelling, an unknown architecture keeping the previous default, and
site.ubuntu_apt_mirror overriding both without an empty value blanking the
mirror.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:27 -03:00
Vinícius Ferrão 5c4b83b853 test(xCAT-test): cover the grub2 kernel command line quoting
Calls the escaping the plugin performs. Covers the Ubuntu installer seed
keeping the arguments after it, every separator grub2 recognizes, a command
line without one staying byte for byte the same, escaped and quoted values
surviving unchanged, a separator beside a quoted span in the same word, and
a variable reference being left alone so BOOTIF still expands.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:27 -03:00
Vinícius Ferrão 7fed9001e8 test(xCAT-test): cover the riscv64 Ubuntu network drivers
Reads the list imgutils returns. Covers the drivers a node needs to reach
its root filesystem, the overlay module, the architectures that already
worked keeping theirs, and an unknown architecture still getting an empty
list.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:26 -03:00
Vinícius Ferrão 9812d14928 test(xCAT-test): cover the netboot mirror genimage defaults to
Evaluates the selection genimage performs, so the test tracks the script.
Covers the ports archive for ppc64el and riscv64, the main archive for
amd64 and i386, and site.ubuntu_apt_mirror overriding both without an
empty value blanking the mirror.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 17:02:04 -03:00
Vinícius Ferrão b0bf36d27a test(xCAT-test): cover the riscv64 Ubuntu management node packaging
Extends the builder tests with the per-package architecture lists and the
architectures a release declares, and adds the generated mklocalrepo.sh
mapping a riscv64 host to its own repository. Also checks that xcat and
xcatsn declare riscv64 without losing amd64 or ppc64el.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 17:02:03 -03:00
Vinícius Ferrão 459ec2a8c3 test(xCAT-test): cover the loader copycd builds from Ubuntu media
Drives the build with dpkg-deb and grub-mkimage shadowed by stubs, so the
assertions read the arguments that decide whether the image can boot over
the network: the firmware format, the prefix nodeset writes into, the
module directory, and the network modules. Also covers the warning a node
without a loader gets, an interrupted build leaving nothing behind, a real
riscv64 loader being kept, text, a truncated image, another architecture's
loader, images with nothing to execute and an image built for another boot
path all being replaced, and a rejected loader being gone when the media
cannot replace it.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 17:02:03 -03:00
Vinícius Ferrão fc73cd91f1 test(xCAT-test): cover the riscv64 Ubuntu package lists
Pin that both releases carry a riscv64 list, that it holds what the x86_64 list
holds, and that it keeps the kernel and the NFS client a diskless node needs.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 17:02:03 -03:00
Vinícius Ferrão 7a2499fbfb test(xCAT-test): cover the resolver libraries the netboot image takes
Build a root filesystem for each architecture and run genimage's selection over
it, so the riscv64 libraries are taken from their own directory and the other
architectures keep the files they take today.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 17:02:03 -03:00
Vinícius Ferrão d09452c0b9 test(xCAT-test): cover riscv64 Ubuntu media
Pin the kernel and initrd the riscv64 live image carries, that the kernel name
the other live images use is not accepted for it, and that the architecture the
media reports maps to riscv64 in both directions.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 17:02:02 -03:00
Daniel Hilst a8e770c42e fix(xcat-core): Prevent BATS checks from missing failures
Negative checks could pass when a later command succeeded. The diskless test also read host state and wrote to the host wget log.

The SSH fallback test did not prove that the restart waited for the killed process.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-08 15:28:04 -03:00
Daniel Hilst cd4d903879 Merge pull request #7820 from VersatusHPC/fix/ubuntu-install-pkglists
Make ospkgs and detect_dhcpd work on current Ubuntu releases
2026-09-08 14:13:17 -03:00
Daniel Hilst cc36d25c35 test(xcat-core): Keep xcatdsklspost download local
xcatdsklspost can run before xcatlib.sh is available beside it in stateless and statelite image contexts. Moving download_postscripts into xcatlib.sh could leave the legacy postscript without its callee when it is copied by itself into the image.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-08 13:10:13 -03:00
Daniel Hilst 58c030a8f3 test(xcat-core): Move BATS tests beside unit tests
Shell unit tests were introduced under xCAT-test/autotest/bats, but the existing source-tree unit suite already lives directly under xCAT-test/unit. Keeping the BATS suite under xCAT-test/bats makes the unit-test layout consistent and keeps autotest reserved for xcattest-driven functional cases.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-08 13:03:34 -03:00
Daniel Hilst 3e302e7f19 test(xcat-core): Introduce BATS & convert shell scripting tests to it
The go-xcat shell behavior tests were written as Perl harnesses, which made the shell assertions harder to read and kept shell-specific setup outside a native shell test framework.

Add BATS to the GitHub Actions dependency set, run BATS tests from the same preserved source tree as the Perl unit suite, and move the go-xcat repository checks into xCAT-test/autotest/bats.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-08 12:57:16 -03:00
Daniel Hilst 796103c300 Merge pull request #7822 from VersatusHPC/fix/go-xcat-el10-repos
fix(go-xcat): check the EPEL and CRB repositories on EL10 as well
2026-09-08 12:02:19 -03:00
Vinícius Ferrão 107f7b14ec test(xCAT-test): drive detect_dhcpd with tcpdump on PATH
Both scripts run for real with PATH holding one directory that carries a
tcpdump stand-in, which records the path and arguments it was started with.
The plain run stops at the interface step, before any socket or capture. The
capture runs inside a private network and mount namespace, where the loopback
interface is the only one, its default route keeps the DHCP discover on the
host, a tmpfs over /tmp holds the dump file, and /usr/sbin/tcpdump is hidden
so the previous guard fails there on every host. Hosts that cannot create the
namespace skip that part.
2026-09-08 11:43:00 -03:00
Vinícius Ferrão 8e4fc335fc test(xCAT-test): pin the shared Ubuntu package lists
The lists are resolved through get_pkglist_file_name, the resolver that picks
one for an osimage, and read through get_pkglist_tex, the parser that
produces OSPKGS. 59 of 94 assertions fail against the previous lists: the dead
names, the missing 26.04 lists, unixodbc, qemu-utils and libvirt packages,
and every kvm osimage resolving to the shared list with the old emulator.
2026-09-08 11:43:00 -03:00
Daniel Hilst 8a77a645af Merge pull request #7816 from VersatusHPC/fix/sudoer-postscript-password
fix(sudoer): take the password from the passwd table
2026-09-08 10:29:50 -03:00
Vinícius Ferrão 394be3d5b2 test(xCAT-test): cover the EPEL and CRB check on EL9 and EL10
The check functions and the installer functions that call them are taken
from the shipped script and run against a dnf stand-in that records its
probes. 27 of 40 assertions fail against the previous
script: EL10 and CentOS Stream were not checked, the probe went through dnf
list, a failed query read as a missing repository, and the CRB message
carried a repository file with signature checks disabled.
2026-09-07 13:40:22 -03:00
Vinícius Ferrão 0302670320 test(genesis): update integration test count 2026-09-06 11:09:27 -03:00
Vinícius Ferrão 3ad1ef888a test(genesis): cover absent s390x guest UUID 2026-09-06 04:02:40 -03:00
Vinícius Ferrão d2e20fb08c test(genesis): distinguish s390x guest identity 2026-09-06 03:35:19 -03:00
Vinícius Ferrão 18b36f02ba test(genesis): cover repository KAS paths 2026-09-06 03:33:24 -03:00
Vinícius Ferrão 947ac1c565 test(genesis): cover local KAS paths 2026-09-06 02:11:20 -03:00