2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-12-04 08:07:04 +00:00
Commit Graph

29752 Commits

Author SHA1 Message Date
Daniel Hilst 9eacb22dff fix(xcat-core): bmcsetup reports BMC status to an invalid IPv6 host
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>
2026-11-10 17:38:11 -03:00
Daniel Hilst d2b97cc17b fix(xcat-core): test that bmcsetup reports BMC status to an invalid IPv6 host
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>
2026-11-10 17:38:11 -03:00
Daniel Hilst a8b81b7f76 fix(xcat-core): getbmcconfig rejects a node that asks over IPv6
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>
2026-11-10 17:37:09 -03:00
Daniel Hilst 4b293bfa66 fix(xcat-core): test that getbmcconfig rejects a node that asks over IPv6
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>
2026-11-10 17:37:09 -03:00
Daniel Hilst 8cd641f09a fix(xcat-core): the Genesis credential listener ignores the doxcat master
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>
2026-11-10 17:35:23 -03:00
Daniel Hilst cfbc953a32 fix(xcat-core): test that the Genesis credential listener ignores the doxcat master
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>
2026-11-10 17:35:23 -03:00
Daniel Hilst 2eb12d2c27 fix(xcat-core): a BMC cannot be given an IPv6 address
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>
2026-11-10 14:19:50 -03:00
Daniel Hilst 75ac4fb8ef fix(xcat-core): test that a BMC cannot be given an IPv6 address
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>
2026-11-10 14:19:35 -03:00
Daniel Hilst c84048cd7a fix(xcat-core): the DHCPv6 DUID test expects no boot file for an unknown client
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>
2026-11-10 09:31:37 -03:00
Daniel Hilst 2c462a5941 fix(xcat-core): a static ip= install boot fails on a slow link
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>
2026-11-10 07:25:42 -03:00
Daniel Hilst 62c8622f0f test(xcat-core): a static ip= install boot fails on a slow link
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>
2026-11-10 07:25:36 -03:00
Daniel Hilst cd27d21e13 fix(xcat-core): the Genesis bats sandbox stops a slow run after 20 s
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>
2026-11-10 07:24:57 -03:00
Daniel Hilst 150d820300 fix(xcat-core): makehosts keeps the old line of a node moved to IPv6
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>
2026-11-10 07:23:29 -03:00
Daniel Hilst 331a1dd87b test(xcat-core): makehosts keeps the old line of a node moved to IPv6
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>
2026-11-10 07:22:56 -03:00
Daniel Hilst adb686f3a0 fix(xcat-core): an IPv6-only Ubuntu diskless node gets no address in the initrd
On Ubuntu 26.04 an IPv6-only diskless node boots with no address and
cannot fetch its root image. grub2 adds BOOTIF= to every node, and
systemd-network-generator turns it into 70-BOOTIF.network with no
address. The generator drops an ip= that names no interface, and the
file for a named interface sorts after 70-BOOTIF.network. debian.pm
gave the static ip= an empty interface when the node had no installnic
or primarynic.

static_ip6_boot_arg now takes the net_params hash. It adds rd.bootif=0,
so the generator writes no 70-BOOTIF.network, and it names the
interface xcatboot0 through ifname=<name>:<mac> when the node has no
installnic, as the EL path does. The DHCP=ipv4 drop-in for
70-BOOTIF.network then has no file to apply to on an IPv6 node. An
IPv4 node is unchanged.

debian_static_ip6_gateway.t fails 5 of 9 assertions without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 07:22:27 -03:00
Daniel Hilst b5d6bd6e9c test(xcat-core): an IPv6-only Ubuntu diskless node gets no address in the initrd
grub2 adds BOOTIF= to the kernel command line of every node. On Ubuntu
26.04, systemd-network-generator then writes 70-BOOTIF.network with no
address. It drops an ip= that names no interface, and a file for a named
interface sorts after 70-BOOTIF.network. debian.pm gives the static ip=
an empty interface when the node has no installnic or primarynic.

The test drives static_ip6_boot_arg with the net_params of the caller.
It expects rd.bootif=0 on every static ip=, and ifname=xcatboot0:<mac>
when the node has no installnic. 5 of its 9 assertions fail before the
fix.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-10 07:21:24 -03:00
Daniel Hilst b5300555a6 fix(xcat-core): an installed KVM node sends a DUID its reservation does not hold
With mac.duid=canonical or firmware, an installed KVM guest whose
domain an earlier mkvm defined sends a DHCPv6 client identifier that
its reservation does not hold.

makedhcp applies the policy to vpd.uuid. configdhcpv6duid applied it to
product_uuid of the node. In such a guest product_uuid is the byte swap
of vpd.uuid, so the script wrote the other UUID order.

mypostscript now exports vpd.uuid as VPDUUID, and configdhcpv6duid
applies the policy to it. The script reads product_uuid only when
VPDUUID holds no UUID.

postscript_dhcpv6_duid.bats asserts the DUID for each policy with a
swapped product_uuid, and the VPDUUID export. The tests fail without
this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:19:09 -03:00
Daniel Hilst d91dc332d9 test(xcat-core): an installed KVM node sends a DUID its reservation does not hold
makedhcp applies the firmware and canonical policies of mac.duid to
vpd.uuid. configdhcpv6duid applies them to product_uuid of the node. A
KVM domain that an earlier mkvm defined holds the byte swap of
vpd.uuid, so in that guest product_uuid is the swap. With duid=canonical
the installed DHCPv6 client then sends the firmware order, and matches
no reservation.

postscript_dhcpv6_duid.bats gives the script a vpd.uuid in VPDUUID and
a product_uuid that is its swap, and asserts the DUID that makedhcp
reserves for each policy. It also asserts that mypostscript exports
VPDUUID. The five tests fail on this tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:19:00 -03:00
Daniel Hilst b62fd4cc8a test(xcat-core): genesis_openembedded_duid.t fails on a second enabled unit
genesis_openembedded_duid.t fails in the unit suite. The
xcat-genesis-network recipe enables xcat-genesis-duid.service and
xcat-genesis-bootnic.service, and the test matched SYSTEMD_SERVICE
against a list that holds the first unit alone.

The test now reads SYSTEMD_SERVICE as a list and asserts that it holds
xcat-genesis-duid.service. With that unit removed from the recipe the
assertion fails, and with the recipe as it is the test passes.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:18:28 -03:00
Daniel Hilst 74ba342c29 fix(xcat-core): a KVM node reserves its IPv6 address for the order iPXE sends
A KVM guest that mkvm defines gets no reserved IPv6 address for its
firmware, its Genesis image or its installed system. The address is
reserved for the DUID that iPXE sends.

dhcp6_firmware_uuid_order answered canonical for mgt=kvm. That was
true while getNodeUUID wrote the byte swap of vpd.uuid into the domain.
The carried kvm fixes make mkvm write the UUID that the guest reports
as vpd.uuid, so the firmware of the guest sends the byte swap of
vpd.uuid, as a physical node does.

dhcp6_client_duid now uses the firmware order for every node that sets
no duid attribute, as the mac.duid schema text states. The
dhcp6_firmware_uuid_order sub, its test and the nodehm read in
dhcp6_client_duids are removed. Comments that described the old mkvm
now describe a domain that an earlier mkvm defined.

dhcp_dhcpv6_duid.t asserts that a kvm node holds its address on the
byte-swapped order. It fails without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:18:09 -03:00
Daniel Hilst 83487a52d3 test(xcat-core): a KVM node reserves its IPv6 address for the order iPXE sends
mkvm now gives the libvirt domain the UUID that the guest reports as
vpd.uuid, through xCAT::KVMUtils::guest_uuid. The firmware of the guest
then sends the byte swap of vpd.uuid, as a physical node does.
dhcp6_firmware_uuid_order still answers canonical for mgt=kvm, because
it was written for the earlier mkvm that swapped the UUID. So makedhcp
reserves the address of a KVM node for the DUID that iPXE sends, and
the firmware, Genesis and the installed node match no address.

dhcp_dhcpv6_duid.t now asserts that a kvm node holds its address on
the byte-swapped order, as a node xCAT does not define does. The
assertion fails on this tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:16:57 -03:00
Vinícius Ferrão fd65b1e704 fix(kvm): swap the UUID for pc-q35-2.1 and pc-i440fx-utopic
pc-q35-2.1 and the Ubuntu pc-i440fx-utopic store the UUID bytes
unencoded behind an SMBIOS 2.8 entry point, as pc-i440fx-2.1 does, so
their guest reports the domain UUID with the first three fields
swapped. guest_uuid kept the UUID unchanged for them, so mkvm and
clonevm gave the guest a UUID that differed from vpd.uuid, and rinv and
rscan reported the domain UUID.

guest_uuid now swaps the UUID for both machine types. Only QEMU 2.1 to
2.6 provide pc-q35-2.1. pc-i440fx-utopic is the default machine type of
Ubuntu 14.10, and the QEMU of Ubuntu 16.04 keeps it with the 2.1
settings. The QEMU of Ubuntu 15.04 and 15.10 defines it with current
settings, so a guest there reports the UUID unchanged. pc-q35-2.0 uses
SMBIOS 2.4 tables and keeps the UUID unchanged.

(cherry picked from commit ba9dfbfed7ea24b0f5344c0c906ce10db4829996)
(cherry picked from commit fe83337ce0)
(cherry picked from commit 26b6ca5806)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:16:14 -03:00
Vinícius Ferrão e26416f76d fix(kvm): resolve the default machine type before converting a UUID
The UUID conversion of mkvm, clonevm, rinv and rscan used the machine
type that the domain XML names. A domain that names none, or names an
alias such as pc, gets the default machine type of the hypervisor:
pc-i440fx-2.1 on QEMU 2.1 and pc-i440fx-rhel7.1.0 on the qemu-kvm of
RHEL 7.1. Its guest then reported a swapped UUID that the plugin did
not expect.

The plugin now asks libvirt for the machine type through the domain
capabilities of the hypervisor, as it already does for the video
model, and converts the UUID for that machine type. The domain XML
keeps the machine type it names. When libvirt cannot answer, the
plugin uses the machine type of the XML, as before.

(cherry picked from commit f3b47fcca98ca75c123615433df38d3642d2c5d4)
(cherry picked from commit 1e830adaa9)
(cherry picked from commit 8f81a34a3e)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:16:09 -03:00
Vinícius Ferrão b06f13582b fix(kvm): give a KVM guest the UUID that vpd.uuid holds
mkvm and clonevm wrote the libvirt domain UUID with the first three
fields of vpd.uuid swapped, rscan swapped them back when it stored a
domain UUID in vpd.uuid, and rinv printed the swapped value. QEMU
stores the domain UUID as SMBIOS 2.6 specifies, so the guest reported
the swapped UUID, not vpd.uuid, and its UEFI firmware sent a DUID that
the reservation makedhcp derives from vpd.uuid did not match.

The plugin now converts through xCAT::KVMUtils::guest_uuid, which
keeps the UUID unchanged for every machine type except pc-i440fx-2.1
and its RHEL counterpart pc-i440fx-rhel7.1.0. Those machine types,
which QEMU before 9.1 and the qemu-kvm of EL8 still offer, store the
UUID bytes unencoded behind an SMBIOS 2.8 entry point, so their guest
reports the first three fields swapped and the swap stays. mkvm and
clonevm take the machine type of the domain they build, and rscan and
rinv the machine type of the domain they read.

A guest that mkvm defined before keeps its UUID, because mkvm reuses
the domain XML in kvm_nodedata. Its vpd.uuid keeps the swapped order
until it is corrected.

(cherry picked from commit 4d8007091c9a8ba2e246749a7278c0f5e04da374)
(cherry picked from commit 76f2008779)
(cherry picked from commit 32d61367cd)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:16:08 -03:00
Vinícius Ferrão a6a2596d7b fix(kvm): keep the mac attributes of a guest that rscan updates
rscan -u, and rscan -w for a guest that xCAT already knows, deleted the
mac row of the guest and wrote back only its MAC address. That dropped
mac.duid, so the next makedhcp reserved the default DUID in place of
the identifier the node had selected, and its client lost the reserved
address. rscan now updates the MAC address in the existing row and
keeps the other mac attributes. The other tables it rewrites are
unchanged.

(cherry picked from commit b464b57499d74d525188c59a340c1bde8e3ffcf1)
(cherry picked from commit b1ed21d010)
(cherry picked from commit 5f1fd10929)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:15:34 -03:00
Daniel Hilst 965430fa6a fix(xcat-core): ISC gives the firmware of a KVM guest the iPXE boot script
On ISC DHCP a KVM guest that xCAT defines and that netboots with ipxe
boots neither stage: the firmware receives the iPXE boot script and
iPXE receives the shim.

addnode6 and addnode6_other_clients chose the boot file of each DHCPv6
host from the client label of its DUID. The label follows from vpd.uuid,
but which UUID order the firmware sends depends on the UUID of the
libvirt domain. For a guest that mkvm defines the labels are reversed.

The two hosts that hold a UUID order of a chainloading node now carry
one statement that chooses the file by boot stage: the boot script when
option 15, the User Class, holds iPXE, and the shim otherwise. The Kea
classes from kea_node_boot_classes6 make the same split.
isc_dhcp6_boot_stage_statement in BootPolicy builds the statement.

dhcp_dhcpv6_duid.t asserts the statement on both hosts of a KVM node.
The assertions fail without this change. Two older assertions expected
one file per label and now expect the statement.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:14:41 -03:00
Daniel Hilst 653ea56987 test(xcat-core): ISC gives the firmware of a KVM guest the iPXE boot script
On ISC DHCP, makedhcp gives each DHCPv6 host of a netboot=ipxe node the
boot file of the client that its DUID label names. The firmware of a
KVM guest that xCAT defines sends the canonical UUID order and iPXE
sends the swap, so the labels are reversed. ISC gives the boot script
to the firmware and the shim to iPXE, and the node boots neither.

dhcp_dhcpv6_duid.t runs makedhcp on ISC for a KVM ipxe node and asserts
that the host of each UUID order chooses the boot file by the iPXE user
class, option 15, as the Kea classes do. Both assertions fail on this
tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:13:53 -03:00
Daniel Hilst 6497b1a1a6 fix(xcat-core): makedhcp does not reload Kea for a DHCPv6 boot class
When the Kea Control Agent host updates succeed, an IPv6-only node
skips the Kea reload. A new DHCPv6 boot class stays inactive and a
deleted one stays active.

kea_process_request restarts Kea after a live update only when
client_classes_changed is set. It set the flag from the DHCPv4 class
updates and discarded the results of kea_sync_node_boot_classes6 and
kea_remove_node_boot_classes6.

kea_process_request now also sets the flag when either DHCPv6 boot
class update reports a change.

dhcp_kea_reload_boot_classes6.t asserts the restart for an added and
for a removed DHCPv6 boot class. Both assertions fail without this
change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:12:52 -03:00
Daniel Hilst fcf4b9734e test(xcat-core): makedhcp does not reload Kea for a DHCPv6 boot class
When the Control Agent host updates succeed, makedhcp restarts Kea only
if client_classes_changed is set. kea_process_request sets it from the
DHCPv4 class updates alone. The results of kea_sync_node_boot_classes6
and kea_remove_node_boot_classes6 are discarded, so an IPv6-only node
skips the reload: a new boot class stays inactive and a deleted one
stays active.

dhcp_kea_reload_boot_classes6.t runs kea_process_request with a Kea
backend whose live host commands succeed, and counts the restarts. It
asserts a restart when a DHCPv6 boot class is added or removed, and
keeps the two controls: no class change, and a DHCPv4 class change.
The two DHCPv6 assertions fail on this tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:12:47 -03:00
Daniel Hilst 7513aba307 fix(xcat-core): the DHCPv6 discovery URL ignores site.httpport
With site.httpport=8080 an unknown node loads iPXE over DHCPv6 and
cannot fetch the boot script of its network.

kea_client_classes6 wrote the second-stage URL of a network as
http://<server>/tftpboot/..., with no port. The per-node URL from
dhcp6_bootfile_url_for_node already carries the site port.

kea_client_classes6 now takes an httpport option and adds the suffix
from httpport_suffix, as the DHCPv4 network classes do.
kea_boot_client_classes6 passes the value of site.httpport.

dhcp6_boot_client_classes.t and dhcp_dhcpv6_duid.t assert the port in
the URL. Both fail without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:12:06 -03:00
Daniel Hilst f79ab05278 test(xcat-core): the DHCPv6 discovery URL ignores site.httpport
With site.httpport=8080 an unknown node loads iPXE over DHCPv6 and
cannot fetch the boot script of its network. kea_client_classes6
writes that URL with no port, so the client asks port 80.

dhcp6_boot_client_classes.t gives kea_client_classes6 port 8080 and
asserts the port in the second-stage URL. dhcp_dhcpv6_duid.t sets
site.httpport and asserts the same URL from kea_boot_client_classes6,
which is the caller in the plugin. Both assertions fail on this tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:11:52 -03:00
Daniel Hilst b6e8a4580e fix(xcat-core): a DHCPv6 boot class answers clients of every network
A discovery client on the second IPv6 network received the boot URL of
the first network.

kea_client_classes6 builds the boot classes of one network. Each URL
carries the address of the management node on that network. The
classes go to the global client-classes of Dhcp6 without the
additional-only flag, so Kea evaluates their tests for the clients of
every subnet. The additional-class list of the subnet does not restrict
them.

kea_client_classes6 now sets additional_only on every class it returns.
The Kea backend renders it as only-in-additional-list, or as
only-if-required before Kea 2.7.4, the same flag the DHCPv4 network
classes use.

dhcp6_boot_client_classes.t asserts the rendered flag. It fails without
this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:11:18 -03:00
Daniel Hilst 14e0f40cdc test(xcat-core): a DHCPv6 boot class answers clients of every network
kea_client_classes6 builds the boot classes of one network, and the
subnet names them in its additional-class list. The classes do not set
the additional-only flag, so Kea also evaluates them for every client of
every other subnet. A discovery client on the second network then
receives the boot URL of the first network.

dhcp6_boot_client_classes.t renders the classes of one network through
the Kea backend and asserts that each one carries
only-in-additional-list. The assertion fails on this tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:11:01 -03:00
Daniel Hilst 71c726b32f fix(xcat-core): Ubuntu genimage leaves the online hook out of the dracut module
On Ubuntu 26.04 genimage stops with "dracut[F]: Cannot install a hook
(.../97xcat/xcat-online.sh) that does not exist". install.netboot hooks
xcat-online.sh, but stage_dracut_module does not copy it into 97xcat, so
the stateless image gets no initrd and the node never boots.

Add xcat-online.sh to the files of the stateless module.
imgutils_ubuntu_dracut_module.t fails without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit ed9a23ba7b203cb3aff6583e07455172be6f2394)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 17:59:02 -03:00
Daniel Hilst f93367daae test(xcat-core): Ubuntu genimage leaves the online hook out of the dracut module
On Ubuntu 26.04 genimage stops with "dracut[F]: Cannot install a hook
(.../97xcat/xcat-online.sh) that does not exist". install.netboot hooks
xcat-online.sh into initqueue/online, but mkinitrd_dracut in the Ubuntu
genimage copies a fixed file list into 97xcat, and that list does not
name xcat-online.sh. The stateless image gets no initrd and no kernel,
so nodeset fails and the node never boots.

This commit moves the copy into imgutils::stage_dracut_module, with the
same file list, so a unit test can call it. The test stages each mode
from the source tree and checks that every file the staged install
script gives to inst_hook is in the module. It fails on xcat-online.sh.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 4155d98dc35a65d5d6721298bf9c2c89428a29fa)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 17:59:02 -03:00
Daniel Hilst 6d2418aaa7 fix(xcat-core): a UEFI node set to boot its disk stops at the firmware boot menu
After the IPv6 diskful install on xcat88-cn, the node netbooted iPXE,
which fetched nodes/seqdisc1.uefi and ran its "exit". OVMF loaded
BootManagerMenuApp, and the node waited at "Please select boot device"
until the case timed out.

UEFI firmware that runs a boot option which returns success stops at
its boot manager menu and does not try the next option. iPXE "exit"
returns success. _write_uefi_exit_script in xnba.pm, which the ipxe
method also uses, now writes "exit 1", so the firmware goes on to the
disk. The BIOS script keeps "exit". netboot_ipxe_method.t fails
without this change; xnba_semicolon.t is updated to the new script.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 10:41:54 -03:00
Daniel Hilst d7aaafc7a0 test(xcat-core): a UEFI node set to boot its disk stops at the firmware boot menu
After the IPv6 diskful install on xcat88-cn, the node netbooted iPXE,
which fetched nodes/seqdisc1.uefi and ran its "exit". OVMF then loaded
BootManagerMenuApp and the node waited at "Please select boot device"
for the rest of the case. UEFI firmware that runs a boot option which
returns success stops at its boot manager menu instead of trying the
next option, and iPXE "exit" returns success.

The test sets an ipxe node to boot and asserts that its UEFI script
exits with a failure status. It fails today.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 10:41:54 -03:00
Daniel Hilst ed5c5b723c fix(xcat-core): two Ubuntu root handler bats cases fail on an Ubuntu runner
"the online hook calls the handler with dracut's three arguments" and
"a second interface does not fetch the image again" fail in the GitHub
CI with "called: No such file or directory". Both cases source
xcat-online.sh from sh. On Ubuntu sh is dash, and the dash "." builtin
passes no arguments, so the hook sees no interface and returns before
it calls the stub handler.

The initramfs links sh to bash, so the cases now source the hook from
bash. Run on an Ubuntu host, both cases fail before this change and
pass after it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 09:28:40 -03:00
Daniel Hilst 38f4e4e2e9 fix(xcat-core): the OpenEmbedded metadata check fails on the bootnic service
The OpenEmbedded metadata check failed in test_installed_network with
'xcat-genesis-bootnic.service' missing from the expected set. The
xcat-genesis-network recipe installs and enables genesis-bootnic and
its unit since the Genesis DHCPv6 boot nic fix, and the test still
expected only xcat-genesis-duid.service.

The test now expects both services, and asserts that the bootnic
script is installed and that its unit runs it before NetworkManager.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 09:28:10 -03:00
Daniel Hilst 7ee57ff62e fix(xcat-core): sequential discovery over IPv6 finds no nic in the deploy network
Sequential discovery over IPv6 matched the pool node and then failed
with "No nic found in deploy network for seqdisc1". NetworkManager
installs a DHCPv6 lease as a /128, so Genesis reports the boot nic as
2001:db8:188::1004/128. hosttag_for_ipv6_nic masked both addresses with
that prefix length, and a /128 never matches the address of the node.

For a /128, hosttag_for_ipv6_nic now takes the network from the IPv6
rows of the networks table, which nodediscover reads once per request
through the new ipv6_networks. discovery_hosttag_ipv6_nic.t fails
without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 07:56:00 -03:00
Daniel Hilst dd1d517d80 test(xcat-core): sequential discovery over IPv6 finds no nic in the deploy network
On xcat88-mn the findme from the OpenEmbedded Genesis reached xcatd
over IPv6 and seqdiscovery matched seqdisc1, then zzzdiscovery failed
with "No nic found in deploy network for seqdisc1". NetworkManager
installs a DHCPv6 lease as a /128, so Genesis reports the boot nic as
2001:db8:188::1004/128. hosttag_for_ipv6_nic masks both addresses with
that prefix length, and a /128 never matches the address of the node.

The test asserts that a /128 lease inside an xCAT IPv6 network of the
node is the node itself. It fails today.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 07:55:24 -03:00
Daniel Hilst d4591ee343 fix(xcat-core): a node with no MAC still boots its own DHCPv6 class
When sequential discovery clears mac= on a defined node, makedhcp drops
the DHCPv6 reservation of the node but keeps its two per-node client
classes. The classes match the DUID, so iPXE still fetches the boot
script of the node, Genesis boots with that node's destiny, and no
findme reaches xcatd.

kea_node_boot_classes6_for_nodes now skips a node with no MAC, as
kea_node_reservations6 does, so kea_sync_node_boot_classes6 removes
the classes with the reservation. dhcp_dhcpv6_duid.t fails without
this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 00:42:34 -03:00
Daniel Hilst 38f521ce4b test(xcat-core): a node with no MAC still boots its own DHCPv6 class
seq_discovery_ipv6 clears mac= on the compute node and runs makedhcp,
so the node is unknown and sends a findme. kea_node_reservations6
drops the reservation of a node with no MAC, but
kea_node_boot_classes6_for_nodes still writes the two per-node classes,
which match the DUID. On xcat88-cn iPXE took a pool address and still
fetched nodes/xcat88-cn.uefi, Genesis booted with destiny=shell, and
xcatd never ran sequential discovery.

The test clears the MAC of an ipxe node and asserts that it gets no
reservation and no boot class. The class assertion fails today.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 00:41:38 -03:00
Daniel Hilst d6fecff195 fix(xcat-core): makehosts cuts an IPv6 address at its first colon
hosts.otherinterfaces and nics.nicips take "<name>!<ip>" or
"<name>:<ip>". The ":" form was split at every colon, so
"node01:2001:db8::5" gave the address "2001". otherinterfaces dropped
the entry; nicips wrote "2001 node01-eth1" to the host entries, which
makedns then rejects as malformed.

addotherinterfaces, delotherinterfaces and donics now split at the
first colon only. ddns_ipv6_records.t holds both forms down.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 22:52:41 -03:00
Daniel Hilst 03aead6059 fix(xcat-core): makedns drops IPv6 PTRs and named.conf settings
makedns stops with "the mask should be a factor of 4" when a node is
in an IPv6 network with a /62 or other non-nibble prefix.
get_reverse_zones_for_entity rejected the prefix that getzonesfornet
already accepts. It now takes the zone of the next nibble that holds
the node address, which is one of the zones getzonesfornet creates.

A node whose hosts.ip is IPv4 got an AAAA for its IPv6 address but no
PTR, because add_or_delete_records walked hosts.ip only. It now also
walks the other addresses the makehosts content gives the node.

find_nameserver_for_dns asked the resolver for the NS of ip6.arpa. and
arpa.: its stop list matched IN-ADDR.ARPA and upper-case ARPA only.

update_namedconf matched "listen-on {" and "listen-on-v6 {". The EL
named.conf writes "listen-on-v6 port 53 { ::1; };", so
site.dnsinterfaces was ignored and named stayed on ::1. The match now
allows options before the brace and a block on one line.

A new zone closed allow-update before the site.dnsupdaters entries,
and named rejects the entries as unknown options.

ddns_ipv6_records.t holds each case down.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 22:52:40 -03:00
Daniel Hilst 129836ee58 fix(xcat-core): makedns drops IPv6 records and named.conf settings (test)
makedns on a dual-stack or IPv6-only cluster fails in six places:

- a node in an IPv6 network whose prefix is not a multiple of 4 makes
  get_reverse_zones_for_entity die, and makedns stops;
- the reverse walk asks the resolver for the NS of ip6.arpa. and arpa.,
  because its stop list matches only upper case;
- a node whose hosts.ip is IPv4 gets an AAAA but no PTR for its IPv6
  address;
- site.dnsinterfaces does not replace "listen-on-v6 port 53 { ::1; };"
  of the EL named.conf, so named stays on ::1;
- site.dnsupdaters is written after the allow-update block of a new
  zone, which named rejects;
- hosts.otherinterfaces and nics.nicips with the ":" separator cut an
  IPv6 address at its first colon.

ddns_ipv6_records.t runs each routine and reads the records, the
named.conf or the host entries it produced. These checks fail on this
commit and pass with the fixes that follow.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 22:52:40 -03:00
Daniel Hilst 2e2ac69f78 fix(xcat-core): Genesis OpenEmbedded still asks for DHCPv6 on every nic
On a node with three nics on the provisioning network, every nic sent a
DHCPv6 SOLICIT under the same DUID. A secondary nic took the reserved
address and the boot nic got a pool address, so xcatd could not match
the findme report to the node.

genesis-bootnic tried to restrict DHCPv6 with ipv6.method in
[connection-*] sections of a conf.d file. NetworkManager does not accept
ipv6.method as a connection default and ignores it.

genesis-bootnic now writes two keyfile profiles: one bound to the BOOTIF
address with ipv6.method=auto and the higher autoconnect priority, and
one multi-connect profile with ipv6.method=link-local for every other
nic. genesis_openembedded_bootnic.bats fails without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 22:49:07 -03:00
Daniel Hilst 9a8ea90a47 test(xcat-core): Genesis OpenEmbedded still asks for DHCPv6 on every nic
genesis-bootnic writes ipv6.method into [connection-*] sections of a
NetworkManager conf.d file. NetworkManager.conf(5) does not list
ipv6.method among the properties such a section can default, so
NetworkManager ignores it. On xcat88-cn all three nics still sent a
SOLICIT under the same DUID, and the boot nic held a pool address
while a secondary nic held the reservation.

The test asserts that the boot nic gets a connection profile bound to
its BOOTIF address with ipv6.method=auto, that the other nics get a
link-local profile, and that no conf.d file carries ipv6.method. It
fails on the current script.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 22:48:24 -03:00
Daniel Hilst 68df4daaa9 fix(xcat-core): the Ubuntu netboot online hook ends the script that runs it
dracut SOURCES a hook: source_all runs `. "$f" "$@"`. An `exit` in the hook
therefore ends networkd-run.sh, which is the script bringing the network up, so
the early return path would stop network setup on the second interface. A compute
node with three nics on the provisioning network reaches that path.

The hook leaves with `return` now. A case sources it with the marker already
present and asserts the caller still runs; putting `exit` back fails only that
case. Two cases drove the hook with `sh hook.sh` and now source it, which is both
what dracut does and what `return` requires.

dracut's own 98syslog/rsyslogd-start.sh uses `exit` in an online hook, so the
convention is not uniform. `return` is correct for a sourced script and says what
is meant: end this hook, not its caller.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 18:25:36 -03:00
Daniel Hilst 07651d98b8 fix(xcat-core): the Ubuntu netboot initramfs never reaches its root handler
xcat-online.sh calls /sbin/xcatroot from initqueue/online, which systemd-networkd
and NetworkManager both reach, instead of waiting for a netroot dispatch that
only network-legacy performs. install.netboot registers it and still installs the
legacy dispatcher where dracut ships one, so EL is unchanged.

The hook runs once: it marks /tmp/xcat.rootimg.done on success, because a second
interface coming online would download the image again.

NOT YET PROVEN ON A NODE. The management node of the cell was reverted by the run
that was aborted while this was written, so the image to boot it with was gone.
The next xcat-test-ubuntu-26-x86_64 run measures it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 18:21:19 -03:00