Use the current Genesis source directory and stage the payload verifier
with its Perl module through the existing build helper. Supply the
OpenSSL configuration and native awk required by the module. Keep private
Perl libraries available with ownership the build namespace can preserve.
Replace source-pattern assertions with real builder transactions against
unsigned RPMs and RPMs signed by trusted or untrusted keys. Check OS and
extra-package installation, missing trust, and generated repository lists.
Keep the existing helper and plugin dispatch cases.
Exercise the zone renderer with IPv6 literals, IPv4 addresses, and
hostnames. Cross DNS target and DHCP subnet families in ISC parser tests,
including an IPv4 DNS target in a DHCPv6 configuration. Check forward
and reverse zones, the selected key, and disabled DDNS.
ISC rejects an IPv6 DNS update target rendered with primary. Select
primary6 for IPv6 literals with NetworkUtils::isIpv6addr. Keep primary
for IPv4 addresses and hostnames, regardless of the DHCP subnet family.
The complete installer fixture searches the host /usr tree for awk.
A slow scan can exhaust the execution limit before disk selection runs.
Run discovery against a private directory with the native find command.
Cover absent awk discovery and show the installer log on failure.
Use the Debian control and dependency parsers instead of splitting physical lines and treating alternatives as mandatory requirements.
Check amd64, ppc64el and riscv64, including the ipmitool version floor and redundant recommendations. Require libdpkg-perl on Debian test hosts.
The case saves /etc/passwd, /etc/group and /etc/shadow on the compute
node to /tmp, and puts them back with mv -f. mv keeps the tmp_t label
of the copy in /tmp. On a node that runs SELinux enforcing, sshd then
cannot read /etc/shadow, so every later xdsh to the node fails. On the
el9 and el10 CI cells about sixty later cases failed for this reason.
Put the files back with cp -f, which keeps the label of the file in
/etc.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 20903fce1c)
(cherry picked from commit 7d8af9ecc8a6b3701ff1b8ae482c57b9493d2b17)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
selinux_cn_diskful_enforcing provisions a diskful compute node with
SELinux enforcing and expects no xCAT denial on it. The SELinux support
covers the management node only: xcatd runs in xcat_t and the image
build in xcat_image_t, and no policy is shipped for a compute node.
The case therefore cannot pass, and its failure reads as a defect in
the management-node policy.
Remove the case from testcase/selinux/cases1 and from selinux.bundle.
selinux_bundle.t still passes: every remaining case is in a bundle.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 3c254f221a)
(cherry picked from commit f85106929cc94872d0e9cdc02b735f5387f45615)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
With the initramfs network fixed, xcatroot still printed "Failed to
download image". It then failed name resolution, and the booted node
called itself localhost, so the postscripts did not identify it.
Under initramfs-tools the kernel arguments reached xcatroot as
variables, and dhclient wrote resolv.conf and set the hostname. Under
systemd, dracut-initqueue runs xcatroot without the arguments, and
systemd-networkd keeps DNS and the hostname in its lease files. The
image also links resolv.conf to the systemd-resolved stub, which does
not resolve a short name, and the copy of resolv.conf went through
that link.
xcatroot now reads the arguments with getarg, writes resolv.conf from
the lease when it names no server, replaces the stub link in the new
root, and writes the hostname from the lease when the image has none.
xcatroot_rootimg_checksum.bats fails without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 426a522879f380979d026d22798f4072c285cd2e)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Five cases in xcatroot_rootimg_checksum.bats run the Ubuntu xcatroot
as a systemd initial ramdisk runs it:
- with imgurl, XCAT and rootimgchecksum only on the kernel command
line, not in the environment;
- with the DNS servers and domain only in the systemd-networkd lease;
- with an image whose resolv.conf links to the systemd-resolved stub;
- with an image whose hostname file is empty.
Three of them fail on this tree. The other two check that a
resolv.conf and a hostname which are already set are kept.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit e221262d91de99299341d0ca35248c9360dab342)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
On Ubuntu 26.04 a stateless node fetches kernel and initrd and then
enters dracut emergency mode. Kea sees no DHCP from the initramfs and
httpd sees no request for rootimg.cpio.gz.
systemd-network-generator turns BOOTIF= into 70-BOOTIF.network with no
DHCP setting. That file exists, so dracut's networkd-config.sh does not
install its DHCP default, and the boot NIC stays unconfigured. Also,
xcat-cmdline.sh wrote its finished condition to /initqueue-finished
and /lib/dracut/hooks, which dracut 110 does not read. With an empty
initqueue/finished, dracut-initqueue ends before networkd-run.sh calls
the online hook and /sbin/netroot.
The module now installs a drop-in that sets DHCP=ipv4 for
70-BOOTIF.network, and xcat-cmdline.sh writes the finished condition
to $hookdir/initqueue/finished. ubuntu_netboot_initqueue.bats fails
without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 29cfd1c0182631e2f91c1a37be7b34860f80742a)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
ubuntu_netboot_initqueue.bats captures two defects in the Ubuntu dracut
module. The boot NIC gets no DHCPv4 lease, because nothing turns on
DHCP for the 70-BOOTIF.network file that systemd-network-generator
writes from BOOTIF=. And xcat-cmdline.sh writes its finished condition
outside $hookdir, so dracut-initqueue ends before the settled hook
that fetches the root runs. Both new cases fail on this tree.
imgutils_ubuntu_dracut_module.t now also checks the inst_simple
sources of the install script.
ubuntu_netboot_root_handler.bats sourced the online hook from sh. On
an Ubuntu host sh is dash, whose "." passes no arguments, so two cases
failed there. The initramfs sh is bash, so the cases now use bash.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 22cf6d78573f3df38c5d395dde4f50fc5c7a3640)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An IPv6 address can end in dotted decimal (RFC 4291). ipmitool and
BMCUtils accept 2001:db8:1::192.0.2.20, but ipv6_expand allowed only
hexadecimal digits and colons. bmc_has_address then failed before it read
the BMC, and an OpenBMC reported installstatus failed.
ipv6_expand now converts a dotted-decimal tail into two hexadecimal
groups before it expands the address. It rejects an octet above 255.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An IPv6 address can end in dotted decimal: 2001:db8:1::192.0.2.20 and
2001:db8:1::c000:214 are the same address. ipmitool and BMCUtils accept
the dotted form, but ipv6_expand in bmcsetup rejects the dots, so an
OpenBMC configured with that spelling reports installstatus failed.
The new cases check the final OpenBMC status for both spellings, in both
directions, and for a different address. The first case fails on the
current bmcsetup.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An OpenBMC node can report "failed" after its IPv6 address is set
correctly, and "bmcready" when the BMC has a different address.
bmc_has_address in bmcsetup searches the whole lan6 print output for
the configured text. One IPv6 address has many spellings, so
"2001:0db8:0001::0020" does not match "2001:db8:1::20". A substring
match also accepts "2001:db8:1::20" for "2001:db8:1::2". The IPv4 check
has the same substring defect.
bmc_has_address now reads each "Address:" entry of lan6 print and
compares it with the configured address after ipv6_expand writes both
as eight zero-padded lowercase groups without the prefix length.
ipv6_expand uses only bash. The IPv4 check compares the complete
"IP Address" field.
The new tests in genesis_bmcsetup_users.bats fail without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An OpenBMC node can report "failed" after its IPv6 address is set
correctly, and "bmcready" when the BMC has a different address.
bmc_has_address in bmcsetup searches the lan6 print output for the
configured text, so a different spelling of the same address does not
match, and "2001:db8:1::2" matches "2001:db8:1::20".
The new tests give the BMC equivalent spellings (zero-padded and
compressed, upper and lower case, with and without a prefix length),
and different addresses that share a text prefix, for IPv6 and IPv4.
They fail on this commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
rewritemyfru answers "Unable to prove root on your IP approves of this
request" to a node on an IPv6 cluster, so the FRU of the node is not
rewritten.
ok_with_node in frusetter.pm opens the credential callback with
IO::Socket::INET, which cannot connect to an IPv6 address.
ok_with_node now opens the socket with
xCAT::NetworkUtils::open_tcp_socket, as bmcconfig.pm does. The
challenge and the expected answer do not change.
The IPv6 tests in frusetter_ipv6_callback.t fail without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
rewritemyfru answers "Unable to prove root on your IP approves of this
request" to a node on an IPv6 cluster, so the FRU of the node is not
rewritten.
The new test starts a credential listener on ::1 and on 127.0.0.1 and
calls ok_with_node and process_request in frusetter.pm against it. The
IPv6 tests fail on this commit. The IPv4 tests pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
On an IPv6 cluster, bmcsetup in Genesis sends the bmcready status to
"[2001" instead of the management node. An OpenBMC node also reports
"failed" after its IPv6 address is set correctly.
bmcsetup reads the xcatd= kernel argument again and splits it on the
first colon. For "[2001:db8::1]:3001" this gives "[2001", and bmcsetup
writes it over the XCATMASTER that doxcat exported. updateflag.awk and
allowcred.awk then get an invalid host. The OpenBMC check reads the
address back with "lan print", which shows only IPv4 parameters.
bmcsetup now reads a bracketed xcatd= value as doxcat does. The new
bmc_has_address reads an IPv6 address back with "lan6 print" on the LAN
channel, and an IPv4 address as before.
The IPv6 status tests in genesis_bmcsetup_users.bats fail without this
change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
On an IPv6 cluster, bmcsetup in Genesis sends the bmcready status to
"[2001" instead of the management node. An OpenBMC node also reports
"failed" after its IPv6 address is set correctly.
The new tests run bmcsetup with xcatd=[2001:db8::1]:3001 on the kernel
command line and XCATMASTER in the environment, as doxcat starts it.
They record the host that updateflag.awk and allowcred.awk receive. The
OpenBMC tests supply the lan6 print output of the BMC. The IPv6 tests
fail on this commit. The IPv4 tests pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
getbmcconfig answers "Unable to prove root on your IP approves of this
request" to a Genesis node on an IPv6 cluster. getipmi then retries
without end, and bmcsetup never configures the BMC.
ok_with_node in bmcconfig.pm opens the credential callback with
IO::Socket::INET, which cannot connect to an IPv6 address.
ok_with_node now opens the socket with
xCAT::NetworkUtils::open_tcp_socket, which uses IO::Socket::INET6 and
keeps IO::Socket::INET as the fallback. The challenge and the expected
answer do not change.
The IPv6 tests in bmcconfig_ipv6_callback.t fail without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
getbmcconfig answers "Unable to prove root on your IP approves of this
request" to a Genesis node on an IPv6 cluster, so getipmi retries and
bmcsetup never configures the BMC.
The new test starts a credential listener on ::1 and on 127.0.0.1 and
calls ok_with_node and process_request in bmcconfig.pm against it. The
IPv6 tests fail on this commit. The IPv4 tests pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
On an IPv6 cluster, xcatd cannot confirm a credential request from a
Genesis node, so the node gets no certificate. getcert and bmcsetup
start allowcred.awk with the environment that doxcat exports.
allowcred.awk selects the listener family from MASTER_IP or MASTER.
doxcat exports neither. It exports XCATMASTER, so the listener is
always IPv4 and the IPv6 callback from xcatd gets no answer.
The Genesis allowcred.awk now reads XCATMASTER first. MASTER_IP and
MASTER stay as fallbacks.
The tests in ipv6_genesis_awk_inet6.bats that use the doxcat
environment fail without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
On an IPv6 cluster, getcert and bmcsetup in Genesis start allowcred.awk
with the environment that doxcat exports. doxcat exports XCATMASTER.
allowcred.awk reads only MASTER_IP and MASTER, so it opens an IPv4
listener. xcatd calls back over IPv6, gets no answer and issues no
certificate.
The existing tests set MASTER_IP, so they do not see this failure.
The new tests start the Genesis allowcred.awk with only XCATMASTER,
XCATPORT and XCATDEST set, as doxcat does, and connect over the family
of that address. The IPv6 test fails on this commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
When ipmi.bmc is an IPv6 address, bmcconfig finds no network for it and
Genesis leaves the BMC unconfigured. bmcsetup only writes IPv4 LAN
parameters.
bmc_net_params now accepts an IPv6 address, or a name that resolves only
to one, and returns the prefix length, the gateway and the prefix of the
networks row that contains it. bmcconfig sends the prefix as
routerprefix. bmcsetup writes the address with "ipmitool lan6 set
static_addr" and, when there is a gateway, a static router. A name with
an IPv4 address keeps the IPv4 setup.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
bmcconfig finds the netmask and gateway of a BMC with inet_aton and a
dotted-quad match, so a BMC with an IPv6 address gets no network and
Genesis does not configure it. bmcsetup only writes IPv4 LAN parameters.
Move the network lookup of net_parms into xCAT::BMCUtils::bmc_net_params,
with the IPv4 behaviour unchanged, so a unit test can call it. Add tests
for the IPv4 and IPv6 results of the lookup, and bats tests for the lan6
commands that bmcsetup must issue. The IPv6 tests fail on this commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
dhcp_dhcpv6_duid.t fails 5 checks on Kea. A client without a
reservation gets the iPXE loader, and the test expects no bootfile-url.
The test is stale. 69737e20f gave each IPv6 network Kea client classes,
so that an unknown UEFI x86_64 client gets the iPXE loader and can start
sequential discovery. kea_client_classes6 adds that class only when the
loader is in site.tftpdir. The GitHub runner installs the loader, so the
pool clients of the test get it. The unit suite failed before this file
ran on every push since then, so no run reported the change.
The test now sets site.tftpdir to a private directory that holds the
loader, and expects the loader for the Kea clients without a
reservation. The ISC checks do not change, because the ISC backend has
no such class. The result no longer depends on the files of the host.
On a tree before 69737e20f the new checks fail, 5 of 64. On the current
tree they pass, with and without the loader in /tftpboot.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xCAT does not set rd.net.timeout.carrier. dracut does not retry a static
ip= configuration that found no carrier. On a port whose link came up
46 s after the driver loaded, the EL and openEuler installer logged "No
carrier detected" and stopped in the dracut emergency shell.
_el10_static_ipv6_boot_args now adds rd.net.timeout.carrier=120. dracut
waits only while the boot interface has no carrier. The static IPv4
path of managedaddressmode=static and the Ubuntu diskless path do not
get the argument.
anaconda_ipv6_rendering.t fails without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xCAT does not set rd.net.timeout.carrier. dracut does not retry a static
ip= configuration that found no carrier. On a port whose link came up
46 s after the driver loaded, the installer logged "No carrier
detected" and stopped in the dracut emergency shell.
The test expects rd.net.timeout.carrier=120 in the static IPv6 boot
arguments of the EL and openEuler installer. It fails before the fix.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
run_genesis stops the Genesis script after 20 s. On a riscv64 host,
tests 2 and 3 of genesis_secondary_dhcp6_order.bats take about 34 s
each, so they fail with exit 124 although the script is correct.
The cap is now 120 s, and GENESIS_SANDBOX_TIMEOUT overrides it. With
GENESIS_SANDBOX_TIMEOUT=10 on x86_64, tests 2 and 3 fail with exit
124, which is the failure seen on riscv64.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
After chdef <node> ip=<IPv6> and makehosts <node>, /etc/hosts held the
old IPv4 line and the new IPv6 line of the node. node_address_family
answers 4 for such a node, so nodeset rendered ip=dhcp and an IPv4
kickstart with no warning.
addnode matches a node name only against lines of the family it writes,
which keeps both lines of a dual-stack node. When makehosts writes
hosts.ip and the node has no line of that family, the address moved to
the other family. addnode now replaces the old line in that case. A
node with a line of each family keeps both, and makehosts -m is
unchanged. ipv6_provisioning.rst says how to move a dual-stack node to
IPv6 only.
makehosts_family_change.t fails 3 of 6 assertions without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
After chdef <node> ip=<IPv6> and makehosts <node>, /etc/hosts holds the
old IPv4 line and the new IPv6 line of the node. node_address_family
answers 4, and nodeset renders an IPv4 install with no warning.
The test runs makehosts with and without a noderange on a node that
changed family, and on a dual-stack node, whose two lines must stay.
The three family-change assertions fail before the fix. The dual-stack
and makehosts -m assertions pass before and after it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>