2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-21 01:42:15 +00:00
Commit Graph

168 Commits

Author SHA1 Message Date
Daniel Hilst a695723541 Merge pull request #8006 from VersatusHPC/fix/el-kickstart-pre-log
fix(install): copy the kickstart pre-install log from the installer
2026-11-07 00:54:01 -03:00
Vinícius Ferrão 568db90972 test(install): cover the kickstart pre-install log handoff
Run the rendered %post --nochroot blocks of each kickstart template
whose %pre writes /tmp/pre-install.log the way anaconda runs them: in
the installer, with its own /tmp and the installed system at
/mnt/sysimage. Each run must append the log to a new or an existing
xcat.log. The riscv64 profile test now keeps the installer's /tmp out
of the installed root too. Both fail on the old templates, whose chroot
%post reads a /tmp that does not hold the log.

Run the new test in the profile artifact job.
2026-11-06 23:10:32 -03:00
Vinícius Ferrão e1d9900b3e test(install): keep custom partition files out of the install log
Render the rhels9 and rhels10 kickstarts with no partitionfile, a custom
partitionfile and a custom partition script, each with xcatdebugmode 0,
1 and 2, and run %pre in a sandbox. The custom input holds credentials
in the =, separated, quoted, escaped and split option forms, a boot
loader password and a root password. The pre-install log must show the
generated partition scheme, or a notice for custom input, with neither a
credential nor a traced decoded byte of the custom input, and anaconda
must still get the custom partition definitions.

Run the new test in the profile artifact job.
2026-11-06 23:10:32 -03:00
Vinícius Ferrão d198efde01 test(install): run riscv64 %post --nochroot blocks outside the chroot
The riscv64 profile test runs every rendered %post block as if it ran in
the installed system. Anaconda runs a --nochroot block in the installer,
with the installed system at /mnt/sysimage, so give such a block that
view.
2026-11-06 23:10:31 -03:00
Vinícius Ferrão 25793a41f0 test(netboot): hand the NetworkManager lease of the initrd to diskless roots
The stateless xcatroot of dracut_047, run in a chroot with NetworkManager
leases of the dhclient and internal clients in the initrd, must copy
both into the root under their own names. CI now runs the xcatroot test
as root.
2026-11-06 23:10:30 -03:00
Daniel Hilst 1b91c188ce Merge pull request #8018 from VersatusHPC/fix/ubuntu-genimage-boot-files
fix(genimage): publish the kernel and ramdisks together
2026-11-06 17:17:10 -03:00
Daniel Hilst e4f6b4be5d Merge pull request #8017 from VersatusHPC/test/native-shell-script-tests
test(native): run shell script tests outside the unit runner
2026-11-06 15:56:14 -03:00
Daniel Hilst bc1a419f7e Merge pull request #8007 from VersatusHPC/fix/template-missing-root-password
fix(install): stop nodeset when a template has no root password
2026-11-06 15:54:05 -03:00
Vinícius Ferrão 9df65310a8 test(genimage): cover the image lock of EL geninitrd 2026-11-06 15:32:09 -03:00
Vinícius Ferrão cb75045114 test(genimage): stop checking that EL geninitrd runs without the lock 2026-11-06 15:31:38 -03:00
Vinícius Ferrão 6b2c183246 test(genimage): cover the staged publication of EL boot files 2026-11-06 15:08:51 -03:00
Vinícius Ferrão 1f6f56e559 test(genimage): drop the checks of the per-ramdisk publication
imgutils_staged_boot_files.t covers the publication of boot files. The
remaining checks of the unit test openeuler_genimage_bootfiles.t cover
disable_vendor_repositories, so the file now has that name.

The native EL cases checked that genimage keeps copying the kernel into
place before dracut runs, which the next change removes.
2026-11-06 14:56:31 -03:00
Vinícius Ferrão 2aa3863881 test(probe): move the detect_dhcpd test to the native tests
The test runs both detect_dhcpd scripts with a fake tcpdump, and its
capture cases need private mount and network namespaces. It now lives in
xCAT-test/native with the other namespace tests, and the pull-request
workflow runs it in its own step. The capture cases keep their own unshare
call, because they add a default route on the loopback interface.
2026-11-03 18:08:30 -03:00
Vinícius Ferrão d4c0b34393 test(debian): run the xcatd init state test in a sandbox
The unit test ran the Debian init helpers in the host shell, with fake
ucf, update-rc.d, systemctl and mv first in the host PATH. It now runs them
with sandbox_run in xCAT-test/native, with the compatibility root apart from
the /etc of the sandbox, and the Debian package lifecycle step runs it.
2026-11-03 18:08:18 -03:00
Vinícius Ferrão 1c2a71d250 test(scriptlib): run the NetworkManager autoconnect test in a sandbox
The unit test sourced scriptlib in the host Bash, with a fake nmcli first
in the host PATH. It now runs the helper with sandbox_run in
xCAT-test/native, and the pull-request workflow runs it in its own step.
2026-11-03 18:08:11 -03:00
Vinícius Ferrão 75c874ebad test(ubuntu): cover a partitionfile layout on the partitionfile disk
A layout without a match that follows a disk file gets a match on the
disk the file selects, resolved when it is a link, and a use_gap layout
that follows a disk file stops the install. A layout with its own match
and a layout without a disk entry are kept as written.
2026-11-03 17:53:20 -03:00
Vinícius Ferrão 1d378818dd test(ubuntu): cover a failed partitionfile entry on Subiquity installs
A disk script or layout script that fails, or that writes no disk or
layout, and a disk file or layout file that holds only blank lines,
comments or an empty storage section each stop the pre-install script and
leave no storage config for Subiquity. A layout file that starts a YAML
document still leaves autoinstall.yaml one document.
2026-11-03 17:53:20 -03:00
Vinícius Ferrão ff870a0723 test(template): cover partitionfile entries read with their own s: prefix
A layout file followed by a disk script and a layout script followed by a
disk file each replace the default storage config with the administrator
layout. A layout file after a layout script and a disk file after a disk
script are read as files, on Subiquity and in the debian-installer recipe
step.
2026-11-03 17:53:20 -03:00
Vinícius Ferrão 94fb370ee4 test(ubuntu): cover partitionfile entries on Subiquity installs
Render the node's pre-install script through the Template entry point and
run its partitioning under dash. Without a partitionfile the storage config
keeps the disk getinstdisk chose. A disk file puts its first disk there,
resolved when it is a link, a disk script puts the disk it writes there,
and a layout file or layout script replaces the default storage config.
2026-11-03 17:53:19 -03:00
Daniel Hilst 557a39dd0c Merge pull request #8013 from VersatusHPC/feat/openeuler-riscv64
feat(openeuler): support riscv64 compute nodes
2026-11-03 13:17:33 -03:00
Vinícius Ferrão fd8e60c21e test(install): start kdump on openEuler nodes only with dump memory
The rendered compute and service %post, run in a sandbox through the
downloaded postscript, must leave the kdump.service drop-in that stateless
images get. A system without kdump.service must get none.
2026-11-02 19:55:57 -03:00
Vinícius Ferrão 7a57007465 test(netboot): start kdump on stateless nodes only with dump memory
An image with kdump.service must get the dump-memory drop-in, once, next
to any site drop-in, and an image without it must get none. systemd itself
must start kdump.service with crashkernel= or fadump= on the command line,
and skip it with neither.
2026-11-02 19:55:56 -03:00
Vinícius Ferrão 2b2c6970c6 test(install): cover templates without a root password row
The EL10 kickstart must not render without the passwd row, and must
carry the hash of the configured password when the row exists. The
Ubuntu autoinstall must still lock a password that has no row. The
first case fails with the earlier code, which rendered an empty rootpw.
2026-10-30 17:43:41 -03:00
Vinícius Ferrão a09bc8eb07 test(install): cover riscv64 boot entries on other disks
The EL10 fix-up must keep the boot entry of a system on another disk,
and must remove nothing when lsblk reports no ESP partition GUID. Both
cases fail with the earlier code, which removed every matching entry.
2026-10-30 15:55:21 -03:00
Vinícius Ferrão 0f978df984 test(install): give the riscv64 EFI fixtures partition GUIDs
The efibootmgr fixture printed HD(1,GPT,...) without a partition GUID or
the tab that ends an entry label, and the lsblk fixture could not answer
a PARTUUID query, so no test could tell which partition a boot entry
points at. The fixtures now print real GUIDs and labels, and lsblk
reports the ESP partition GUID.
2026-10-30 15:54:47 -03:00
Daniel Hilst c0698fa253 Merge pull request #7995 from VersatusHPC/fix/opensuse-mn-package-requires
fix(xcat-core): xCAT cannot be installed on an openSUSE management node
2026-10-30 09:57:51 -03:00
Daniel Hilst ac0ec70821 Merge pull request #7979 from VersatusHPC/refactor/debian-profile-lookup
refactor(netboot): share profile asset selection
2026-10-29 14:58:18 -03:00
Daniel Hilst 001edc1a9f fix(xcat-core): package_relations.t expects perl-DB_File on openSUSE
xCAT-server now asks for the perl(DB_File) capability on openSUSE,
because no openSUSE release ships a package named perl-DB_File. The
native package relation test still counted perl-DB_File in the SLES12
and SLES15 requirements, so both checks failed in xcat_pr_test.

Expect perl(DB_File) on the SLES platforms and keep perl-DB_File for
the others. The test fails against the upstream master spec and
passes with this branch.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 14:36:35 -03:00
Vinícius Ferrão a2eaa50a7c docs(netboot): explain standalone Debian source copies 2026-10-26 18:29:45 -03:00
Vinícius Ferrão c35fabe185 test(netboot): cover copied profile helper layouts 2026-10-26 18:29:45 -03:00
Vinícius Ferrão 4d5fc2b1b6 test(netboot): support copied profile payload fixtures 2026-10-26 18:00:28 -03:00
Daniel Hilst ca5587a73b Merge pull request #7976 from VersatusHPC/fix/debian-package-lifecycle
fix(debian): preserve upgrade context and skip chroot service actions
2026-10-26 14:41:46 -03:00
Daniel Hilst d28b9c31ca Merge pull request #7981 from VersatusHPC/fix/release-source-only-signing
fix(build): preserve binaries in source-only runs
2026-10-26 11:44:23 -03:00
Daniel Hilst c768025739 Merge upstream/master into feat/selinux-netboot
Twelve conflicts, all from xcat-core/#7970 landing.

Eleven are the one sed line in the netboot postinstall profiles, where #7970 and
this branch replaced the same line with different patterns. Master's wins: it
anchors on optional leading blanks and preserves a trailing comment, which this
branch's `s/^SELINUX=.*$/SELINUX=disabled/` would have eaten. This branch's own
postinstall_selinux_config.bats asserts "the comment that names permissive keeps
its text", so the better pattern is the one its test already wanted -- 6 of 6
pass on master's version. What master's pattern does not catch is a value
outside enforcing|permissive, which nothing here tests and no stock config
ships.

The twelfth is .github/workflows/xcat_test.yml: master added a step to the
existing job and this branch adds a whole selinux_policy_test job after it.
Resolved as the union, with master's step where it put it; the file still parses
and names three jobs.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-23 14:42:37 -03:00
Daniel Hilst f4f89c0b49 Merge pull request #7970 from VersatusHPC/fix/netboot-profile-shell-selinux
fix(netboot): correct SELinux settings and firewalld cleanup
2026-10-23 14:39:55 -03:00
Daniel Hilst f095318154 Merge pull request #7975 from VersatusHPC/fix/postscript-route-syslog
fix(postscripts): scope IPv6 gateways and create the syslog directory
2026-10-23 14:36:53 -03:00
Vinícius Ferrão a289434ae8 test(build): cover source-only repository preservation
Run the real finalization command with empty, unsigned and differently signed binary repositories, including absent and retained aliases.

Check binary bytes, modes and timestamps across unsigned and repeated signed runs. Verify source package checksums and signatures with a separate source key.
2026-10-23 11:50:49 -03:00
Vinícius Ferrão 8866046a4b test(netboot): preserve profile asset lookup contracts
Compare Debian and shared lookup priorities through their production
entry points and real files. Exercise Debian genimage consumers in
isolated filesystems, including custom-directory precedence and
unchanged postinstall paths.
2026-10-23 01:39:54 -03:00
Daniel Hilst 7d66afe2f3 test(xcat-core): no case runs the documented repair as one sequence
selinux_image_repair.t measured a moved publication directory and an image root
with a rootimg component in the middle in separate fixtures, and it called the
mappings of a scenario a repair without running the restorecon the page puts
between them. Neither condition reaches the ordering defect on its own, and the
relabel the procedure runs itself was never measured.

The case now gives each scenario the relabel, so the scenario places it where
the page does. It reads the guest labels straight after the procedure, because a
label the procedure overwrote cannot be recovered by a mapping added afterwards.
It then asserts the mapping and the label of each path after a recursive relabel
and after a reinstall of the module.

A third scenario runs the four documented steps on the layout that needs all of
them: site.installdir is /srv/xcat-images, so no mapping covers the tree until
the procedure adds one, and the image root carries a rootimg component in the
middle, so the guest exclusion matches the published artifacts too.

selinux_docs.t gains three checks on the order of the page: the guest exclusions
come before the artifact mappings, the relabel comes after the last mapping, and
there is one relabel. All three fail against the page at 78f6d65a7.

With the command order of that page, the full sequence fails 47 of 381 checks:
16 guest labels, which go from shadow_t, etc_t and bin_t to var_t, and 15
artifact mappings, which resolve <<none>> for the five expressions that carry a
wildcard.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-23 00:56:41 -03:00
Daniel Hilst 576370bdf9 test(xcat-core): no case measures the documented repair of a published artifact
The SELinux page documents a recursive chcon to repair a published artifact
that carries the wrong type. No case runs that procedure, so nothing measures
what it does to the guest trees of the image root, and nothing measures whether
the repair survives a later relabel.

selinux_image_repair.t starts with default_t on every published artifact of an
image root and with valid types in both rootimg and rootimg-statelite. It runs
the repair, then reads the labels back after a recursive relabel and after a
reinstall of the module. It covers the standard publication directory and one
that site.installdir moved, because the packaged mappings name /install.

semanage writes to the policy store of the host, so the case refuses to run
where SELinux is enabled and removes every mapping it adds. restorecon is a
no-op where SELinux is disabled, so the case applies the mappings with setfiles
and asserts that the merged file_contexts answers what the store answers for
each path.

selinux_docs.t gains the checks that keep the page and the xcat.fc comment from
describing a chcon repair. 7 of its 26 checks fail on this commit.

With the chcon of the page in place of the documented procedure,
selinux_image_repair.t fails 101 of its 170 checks, 36 of them guest labels that
the recursive chcon overwrote.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-22 18:25:22 -03:00
Vinícius Ferrão 11e6e642c4 test(debian): cover interrupted management package transactions 2026-10-22 18:01:36 -03:00
Vinícius Ferrão a7d7b85c7c test(build): limit the upgrade log allocation fault 2026-10-22 17:33:44 -03:00
Vinícius Ferrão b6f9294a79 test(debian): exercise service callers in proc-mounted chroots 2026-10-22 17:33:44 -03:00
Vinícius Ferrão ea4738a5ce test(syslog): verify directory setup and native log delivery
Execute the complete postscript and check the daemon UID before real UDP
log delivery. Cover fresh and repeated MN/SN setup, restricted directories,
legacy ownership and modes, and a blocked directory path. Keep the upgrade
wrapper and forwarding cases as compatibility controls.

Select older configuration branches through their version-report boundary;
use the installed daemon, without claiming old-daemon qualification.
Run the isolated native cases in CI.
2026-10-22 15:07:00 -03:00
Daniel Hilst 6f578741af fix(xcat-core): the comment says an unlabeled kernel stops netboot, and it does not
The file contexts leave the published kernel of a middle-rootimg image
root out of the relabel. The comment and the SELinux page read that as
the kernel being unlabeled, httpd refusing to serve it, and that osimage
losing netboot, with restorecon as the repair. Three of those four
claims are wrong.

Measured. An entry of <<none>> keeps the label a path has: restorecon
-R, restorecon -RF and setfiles -F all left a kernel at default_t, while
the same setfiles call relabeled a path that has a rule. A new file
inherits the type of its directory, so a kernel that genimage writes
into an image root already made public_content_t is public_content_t. In
the policy with the xcat module loaded, httpd_t holds one allow rule to
read public_content_t and none for default_t. So the ordinary case
serves and netboot works, and restorecon is not the repair for the case
that does not: chcon -R -t public_content_t over the image root is, and
a later relabel leaves that value alone.

selinux_file_contexts.t now starts half the custom roots at
public_content_t, which is what genimage produces, and half at
default_t, and requires each to keep its own type. It fails 324 of its
618 checks against the previous xcat.fc.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 20:03:44 -03:00
Daniel Hilst cd75a9f820 test(xcat-core): no case measures a common or overlay directory in a guest tree
The published-name rules for an image root called rootimg end with two
recursive entries, common(/.*)? and overlay(/.*)?. A recursive entry
below the rootimg component matches a guest tree as well: with
rootimgdir=/install/rootimg/common/compute, the guest file
/install/rootimg/common/compute/rootimg/etc/shadow resolves to
public_content_t, and so does a directory called common at the root of
any guest tree.

selinux_file_contexts.t covers neither shape. Add three case groups: an
image root that holds a rootimg component in the middle, a guest tree
that holds a common or an overlay directory at its own root, and the
published files of such an image root. Each new path is measured in the
lookup and in both relabel passes.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 19:25:22 -03:00
Vinícius Ferrão 8c6ba3b2c0 test(netboot): exercise firewalld cleanup with Bash and dash
Execute each profile through /bin/sh. Check both firewalld entries as
regular files, valid links, dangling links, directories and missing paths.
Preserve unit targets, unrelated links and the older profiles without this
cleanup.
2026-10-21 18:07:22 -03:00
Vinícius Ferrão 402f398bb1 test(netboot): cover SELinux settings across postinstall profiles
Execute all affected owners and their aliases in isolated image roots. Check
policy contents and metadata, missing files, repeated runs and host
sentinels. Run the cases in Ubuntu and EL CI.
2026-10-21 18:07:11 -03:00
Vinícius Ferrão 33fee7bb0d test(netboot): resolve the shell mount target in profile tests
Older bubblewrap releases reject a symlink mount destination. Bind Bash over
the resolved shell path without changing the profile cases.
2026-10-21 17:52:06 -03:00
Daniel Hilst d7f579440d test(xcat-core): nothing starts xcatd without the recorded prefix file
%post writes /etc/xcat/xcatroot.env and %preun removes it, so the file
is absent on rpm --justdb, before %post runs, and after an interrupted
install. Both subtests of xcatd_relocated_startup.t have the file
present, so neither reads what happens without it.

Add a subtest that removes the file: each EnvironmentFile of the unit
carries a leading -, which makes a missing file not an error, XCATROOT
is the default of the unit, and the daemon starts with that default
instead of the installed prefix. Dropping the default XCATROOT from the
unit fails checks 4 and 7 of that subtest.

Record the trade the file contexts make for a rootimg component in the
middle of an image root: the guest labels are kept, which leaves the
published kernel of that one layout unlabeled, so httpd cannot serve it
and that osimage cannot netboot. The note names the recovery.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 17:16:06 -03:00