With [Table_vm] othersettings=cpumode:host-passthrough;firmware:efi-secureboot,
xcattest gives chtab only cpumode:host-passthrough, and bash runs
firmware:efi-secureboot as a command. The environment setup then fails.
chtab_command joined its words unquoted, and xcattest runs the command
through /bin/bash -c. chtab_command now quotes every word, the row selector
included, with the same _quote that chdef_command uses.
xcattest_conf_chtab_command.t passes with this change and fails 3 of 4
checks on the previous commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xcattest builds the chtab command for a [Table_*] row with unquoted words and
runs it through /bin/bash -c. A [Table_vm] othersettings value such as
cpumode:host-passthrough;firmware:efi-secureboot ends the command at the
semicolon: chtab receives only the first setting, and bash runs the second as
a command, so the environment setup fails.
Move the command builder from setup_env_by_configure_file into
xCAT::Test::Conf::chtab_command, with the same output, so a test can read the
words chtab receives. xcattest_conf_chtab_command.t splits the command the way
the shell does. Three of its four checks fail on this commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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>
xcattest applies a conf's [Table_*] blocks itself, once, before the first case
runs, so whatever table_attr returns is what reaches chtab. Its value class was
([\w\.\-]+), which stops at a colon or a slash and writes the truncated value
with no warning: on a management node provisioning over IPv6,
`net=2001:db8:176::/64` reached chtab as `net=2001`, and xcattest re-applied that
junk row on every run. [Table_site] value= has the same hole, so site.master
cannot be an IPv6 address either, and any table value holding a path or a
comma-separated list loses everything after the first slash or colon.
object_attr, beside it in the same module, already accepts ":,;/" -- which is
why an [Object_node] ip= carries an IPv6 address and a [Table_networks] net=
silently could not. table_attr now uses the same class. Both are faithful to
what they replaced: upstream xcattest still matches tables with ([\w\.\-]+) at
line 817 and objects with ([\w\.\-\+\ \/:]+) at line 854, and moving the pair
into xCAT::Test::Conf is what made the asymmetry visible and testable.
The class holds no whitespace and no '#', so a trailing inline comment is still
excluded -- asserted, because that is the behaviour a wider class could have
broken.
xcattest_conf_table_value_class.t covers one line per kind of value a table
holds. Seven of its 22 assertions fail without the fix, including the three IPv6
forms and the absolute path; xcattest_conf_object_attr.t stays green, which is
the control that colons were never meant to be refused.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
current_os reads /etc/os-release and returns undef for openSUSE. The word sles
appears nowhere in Leap's os-release -- ID is opensuse-leap on 15.x and
opensuse on 42.3 -- and Leap ships none of /etc/redhat-release,
/etc/lsb-release or /etc/SuSE-release, so no other arm is reached. xcattest
rejects every case on the resulting undef, and 328 of the shipped cases declare
os:Linux.
openSUSE now answers with the SLE family whose package set it shares, which is
the answer decided on 2026-09-18 for the same bug: sles.pm claims leap15 and
xcat.org publishes the Leap dependencies under sles15. It also lets the 18
cases written os:sles select a Leap node, which a name of its own would not.
current_os has one consumer -- the os: comparison at xcattest:1052 -- so the
answer affects nothing else.
The match is on the whole file rather than on ID alone, because Leap 42.3
spells its ID opensuse and Tumbleweed opensuse-tumbleweed. It is placed after
the sles test, so a real SLES node is unaffected.
xcattest_os_selection.t passes, 19 of 19. Reverting this file alone fails its
five openSUSE assertions and nothing else.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A conf that declares vmothersetting=cpumode:host-passthrough;firmware:efi
reaches the node as vmothersetting=cpumode:host-passthrough. The value
class of object_attr held no semicolon, so the reader kept the characters
up to it and dropped the rest without a message. vm.othersettings
separates its settings with a semicolon, so no conf could set two of them.
object_attr now keeps the semicolon, and chdef_command quotes every word
it takes from the conf. The quoting is what makes the semicolon safe:
xcattest runs each command through /bin/bash -c, where an unquoted
semicolon ends the command. chdef_command also sorts the assignments, so
one conf builds one command.
xcattest_conf_object_attr.t covers both halves.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An [Object_*] line of an xcattest conf declares an xCAT node attribute.
vm.othersettings holds several settings separated by a semicolon, which
is the syntax the kvm plugin reads, and such a line reaches the node cut
at its first semicolon with no message. The reader drops the rest, and
the chdef that applies it runs through /bin/bash -c unquoted, so the
shell would read the semicolon as a command separator.
load_config_file read each line with a regular expression written inline
and built the chdef by concatenation, so neither could be measured
without a database. xCAT::Test::Conf now holds the three readers and the
command builder, and xcattest calls them. The routines keep the behaviour
they replace, and both packages install the module.
xcattest_conf_object_attr.t fails five of its nine checks on this commit:
the semicolon value, the quoting and the order of the assignments.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Two files needed a resolution. Both are unions of independent additions.
XCAT::Test::Lifecycle::build_deb takes master's new $source argument and its
-xpf extraction, and keeps the control-$arch selection this branch adds for
xCAT-genesis-scripts. $source defaults to the repository root, so the branch
behaviour does not change.
.github/workflows/xcat_test.yml keeps master's profile_package_payload.t on
both lifecycle prove lines and master's Perl module list, and keeps this
branch's FIPS steps, bzip2 and openssl.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Preserve source modes when staging Debian package builds and accept a
private source fixture. Build group-writable profiles under umasks 0022
and 0002, then check the extracted data, postscripts and directories.
Verify that staging and packaging leave source permissions unchanged,
including a world-writable data file. Reuse the payload checks for normal,
reduced and permission-regression builds.
Run the unchanged initrd builder with fixture binaries and inspect both generated archives. Replace source extraction with checks for selected libraries and their contents.
Read site settings from an isolated database and inspect the sources.list written into the image. Stop at an injected package-metadata failure without downloading packages.
Run genimage and inspect the arguments passed to debootstrap instead of evaluating an extracted assignment. Keep the existing ppc64le pass-through explicit.
xcattest reports "Test case <name> has an invalid OS option - Linux" and then
"There is no valid case to run", so every case is skipped on openEuler.
Recorded on an openEuler 24.03 LTS SP4 management node with xCAT 2.20.0: both
flat provisioning cases were rejected and the run measured nothing.
Two causes, both in the os: comparison in xCAT-test/xcattest. get_current_os
takes the /etc/os-release branch, finds no sles, and falls off the end of that
branch, so it returns the exit status of the failed grep, 256, which names no
distribution. And a case marked os:Linux expands to exactly rhels, sles and
ubuntu, so openEuler would be rejected even by a correct get_current_os.
Both halves move into xCAT::Test::OS. xcattest finds it beside itself and the
package installs it at <prefix>/lib/perl. current_os takes a path prefix, so a
test describes a system by writing release files into a scratch tree. openEuler
is named in both halves and nothing else changes.
xCAT-test/unit/xcattest_os_selection.t covers it. Removing openeuler from
linux_aliases fails two checks, and removing the openEuler branch from
current_os fails three. A further case gives a root both /etc/redhat-release
and an openEuler /etc/os-release and asserts rhels10, so the precedence is
named: openEuler ships neither that file nor /etc/lsb-release.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>