2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-23 02:42:17 +00:00
Commit Graph

4017 Commits

Author SHA1 Message Date
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 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 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 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 34ce66f542 test(xcat-core): the Ubuntu netboot initramfs never reaches its root handler
dracut dispatches a netroot= handler from network-legacy's ifup. Ubuntu 25.10 and
later ship no network-legacy, so network resolves through systemd-networkd and
nothing calls /sbin/netroot. install.netboot already says so in a comment, and
treats the dispatcher as optional.

Measured on xcat32-cn with the 26.04 netboot image: the initramfs does no DHCP of
its own, the management node logs no request for rootimg.cpio.gz, and dracut
enters emergency mode 3.3 seconds in. Under quiet that surfaces as "Failed to
isolate default target". The initrd is complete: modules.txt lists network,
systemd-networkd, net-lib, nfs and xcat, and both /sbin/netroot and
/sbin/xcatroot are present. Nothing calls them.

The cases run install.netboot the way dracut does, with its helpers stubbed, and
assert what it registers. They also drive the new hook with a stub handler.
Deleting the registration fails only "the root handler is registered on an
interface coming online".

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 18:21:19 -03:00
Daniel Hilst de86c39b46 test(xcat-core): Genesis ends net init on an address of the wrong family
genesis_nic_has_address ends the wait for the boot nic on an address of either
family. xcatd is on one family, so on a dual stack provisioning network the node
can go on to getcert and getdestiny holding only the family xcatd is not on, with
no route to the management node.

The cases drive the three address helpers out of doxcat with a stub ip and assert
what ends the wait for an IPv4 xcatd and for an IPv6 one. Two of the six fail
before the change: "an IPv6 xcatd is not reached by an IPv4 address alone" and
"an IPv4 xcatd is not reached by an IPv6 address alone". The other four pass
before and after, so the file is not vacuous.

No cell is in this state today, because an IPv6 cell serves no IPv4 pool and an
IPv4 cell sends no router advertisement, so the boot nic gets one family. The
form was still wrong.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 17:39:09 -03:00
Daniel Hilst a5d910f663 test(xcat-core): Genesis OpenEmbedded asks for DHCPv6 on every nic
A DHCPv6 reservation is keyed on the DUID, and a DUID names the machine, not the
nic. 10-xcat-genesis.conf puts the DHCPv6 settings in [connection], which
NetworkManager applies to every nic, so each nic of a node asks for the same
reserved address and Kea gives it to the first REQUEST.

Measured on xcat88-cn, which carries three nics on the provisioning bridge
virbr-p88. Kea logged four solicits under one DUID in one boot, and granted
2001:db8:188::20 to whichever IA asked first; the others took pool addresses.
The node then reported to xcatd from an address xcatd could not match to a node,
so el10-x86_64-genesis-oe-ipv6 passed or failed by chance.

genesis-bootnic reads BOOTIF and writes 16-xcat-genesis-bootnic.conf, which
leaves DHCPv6 on the boot nic and puts every other nic on link-local. It follows
genesis-duid, which already writes 15-xcat-genesis-duid.conf from the SMBIOS UUID
before NetworkManager starts.

The six cases pass with the file as committed, so the evidence is a mutation:
writing ipv6.method=auto for the secondary nics, which is the behaviour before
this change, reds only "the boot nic keeps DHCPv6 and every other nic does not
ask for an address".

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 17:08:54 -03:00
Daniel Hilst 018987d0fb fix(xcat-test): the cases restart a DHCPv4 unit that Ubuntu does not have
Ten cmd lines in five case files restarted the DHCPv4 server with the same
inline probe of kea-dhcp4, falling back to isc-dhcp-server on Ubuntu. Kea is the
backend there and its unit is kea-dhcp4-server, so the probe was false and the
fallback named a unit that is not installed. The restart exited 5 with "Unit
isc-dhcp-server.service not found" and failed the case.

Each of those lines now calls commoncmd/restart_dhcp.sh. discovery_test also
decided whether to create /var/lib/dhcpd/dhcpd.leases from the same single-unit
probe, so on an Ubuntu management node it wrote an ISC leases file beside a Kea
backend; it now asks restart_dhcp.sh --print-unit.

Each rewritten line keeps the check that followed it. xcattest discards a cmd
line that does not start with [#/$\w] and binds its checks to the previous
command, so the calls are written as absolute paths.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 16:32:12 -03:00
Daniel Hilst 79f5291554 test(xcat-test): the cases restart a DHCPv4 unit that Ubuntu does not have
xCAT runs Kea as kea-dhcp4 on EL and as kea-dhcp4-server on Debian and Ubuntu.
Ten cmd lines across five case files probed the EL name alone and fell back to
isc-dhcp-server on Ubuntu, which is absent where Kea is the backend.
reg_linux_diskless_installation_hierarchy failed on it in
xcat-test-ubuntu-24-x86_64 #85: rc 5, "Unit isc-dhcp-server.service not found".
Measured on xcat24-mn, Ubuntu 24.04.4: kea-dhcp4 inactive, kea-dhcp4-server
active, isc-dhcp-server absent.

restart_dhcp.sh restarts whichever DHCPv4 unit is active, and --print-unit names
it for a caller that asks which backend the node runs. The bats cases drive it
with a stub systemctl that reports one unit active and records what was
restarted.

The eight cases pass with the file as committed, so the discriminating evidence is
a mutation: dropping kea-dhcp4-server from the candidate list reds exactly "the
Ubuntu Kea unit is restarted" and the message assertion, and leaves the EL, ISC
and dhcpd cases green.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 16:32:12 -03:00
Daniel Hilst ade70bbf26 test(xcat-core): nothing holds udpcat.awk to the socket family of its sibling helpers
allowcred.awk and updateflag.awk both had to choose the gawk network family from
the management address. udpcat.awk, which sends the discovery packet, still names
/inet/ and no test covers it.

The two cases send a packet to a loopback listener of each family and pass with
the file unchanged, because a /inet/ socket that connects resolves an IPv6
literal. A /inet/ listener does not, which is the difference that made the other
two helpers fail. The cases are a guard on the third helper, not a captured
defect.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 16:02:32 -03:00
Daniel Hilst 26b3a62c04 test(xcat-core): Genesis waits for an IPv4 address that an IPv6 cell never serves
The provisioning network of an IPv6 cell declares an IPv4 subnet with no pool, so
Kea answers every DHCPv4 request with ALLOC_ENGINE_V4_ALLOC_FAIL_NO_POOLS and the
node holds no IPv4 address. doxcat waits for one with no bound, and Genesis never
reaches xcatd.

The bats case gives the boot nic an IPv6 address and no IPv4 address, and expects
doxcat to finish. Before the change doxcat does not return and the sandbox timeout
reports 124. The sandbox stub for "ip -4" now reads a per-nic file when the test
writes one, and answers as before when it does not.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 15:52:25 -03:00
Daniel Hilst 6f126a0ac6 fix(xcat-core): a secondary nic can take the IPv6 address reserved for the node
A node with several nics on the provisioning network booted Genesis and reported
to xcatd from a pool address, so the management node never saw it reach the
shell. The el10 x86_64 IPv6 cell passed or failed by chance: one run in three
served the reserved address to the boot nic.

doxcat started DHCPv4 and DHCPv6 on the boot nic and on every eligible secondary
nic at the same time. A DHCPv6 reservation is keyed on the DUID, which names the
machine and not the nic, so each nic asked for the same reserved address and Kea
gave it to the first REQUEST. DHCPv4 is unaffected: a DHCPv4 reservation is keyed
on the hardware address.

A secondary nic now waits for the boot nic to hold a routable IPv6 address before
it asks for one, in genesis_wait_nic_v6. On an IPv4-only network the wait ends
after the last try and the secondary nic asks for no IPv6 address, which it could
not have obtained there anyway. DHCPv4 on a secondary nic still does not wait.

genesis_secondary_dhcp.bats measures which nics are selected, so its boot nic now
starts with an address and its cases read as before.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 15:45:17 -03:00
Daniel Hilst 38ae1281ae test(xcat-core): a secondary nic can take the IPv6 address reserved for the node
A DHCPv6 reservation is keyed on the DUID, and a DUID names the machine, not the
nic. Every nic of a node asks for the same reserved address, and Kea gives it to
the first REQUEST. The node then holds its own address on whichever nic won, and
xcatd cannot match a report that arrives from a pool address.

The bats case boots doxcat in the sandbox with a boot nic and one eligible
secondary nic, and reads the order the nics were served from the recorded
dhclient command lines. The sandbox gains an "ip -6 -o addr show dev" stub, which
reads the per-nic file the test writes.

Two of the three assertions hold before the change. Only "a secondary nic is not
served DHCPv6 while the boot nic has no address" fails, because doxcat starts
both families on every selected nic at once.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 15:45:08 -03:00
Daniel Hilst 81bf21c55e Merge remote-tracking branch 'origin/fix/nodediscover-ipv6-node-and-nic' into releases/2.20.0-rc9 2026-11-08 13:00:05 -03:00
Daniel Hilst 435ba5abd3 test(xcat-core): sequential discovery cannot resolve or match an IPv6 node
nodediscover.pm decides two things with IPv4-only code, and sequential discovery
over IPv6 stops at each of them.

It gates the MAC record on inet_aton($node), so a node whose only address is
IPv6 fails and process_request returns "Can not resolve IP for the matching
node". update_discovery_data runs after every such early return, so no
discoverydata row is written and makedhcp never runs. Measured on xcat88-mn:
tabdump discoverydata empty after a full seq_discovery_ipv6 run.

It then matches a NIC behind if ($ip =~ /\d+\.\d+\.\d+\.\d+/). The OpenEmbedded
image sends address=${ipv4_address:-$ipv6_address}, so over IPv6 the NIC record
carries the v6 address, the branch is skipped, $localnic stays 0 and
process_request returns "No nic found in deploy network".

The three tests ask xCAT::DiscoveryUtils for the two decisions and for the
hostname tag of an IPv6 NIC. Each holds an IPv4 case down as well, because every
green discovery cell depends on that path being unchanged. All three fail on this
commit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 12:57:38 -03:00
Daniel Hilst 225f8882fa Merge remote-tracking branch 'origin/fix/dhcp6-reserved-address-reclaim-hold' into releases/2.20.0-rc9 2026-11-08 11:19:41 -03:00
Daniel Hilst 2d47339d7d test(xcat-core): a discovered node needs its UUID recorded for DHCPv6
dhcp6_client_duids builds the DHCPv6 identity of a node from vpd.uuid, and no
other table holds it. Sequential discovery writes mac, hosts, ipmi, nodepos,
nodelist, nodehm and chain for the node it assigns and never wrote vpd, so the
reservation of a discovered node falls back to a DUID-LL built from its MAC.
Measured on xcat88-mn: the firmware, iPXE and the Genesis image all send a
DUID-UUID, so that reservation matches nothing and the node keeps a pool address.

The findme request already carries the value. The new test asks
xCAT::DiscoveryUtils which vpd attributes a request carries, and holds down the
one case that must be refused: the OpenEmbedded image synthesises
"<machine type>-<serial>-<first mac>" when the firmware reports no product_uuid,
and a DUID built from that string matches no client.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:19:28 -03:00
Daniel Hilst 673d4727bb Merge remote-tracking branch 'origin/fix/dhcp6-reserved-address-reclaim-hold' into releases/2.20.0-rc9 2026-11-08 11:08:50 -03:00
Daniel Hilst e474f57d2f test(xcat-core): a per-network iPXE script needs a host on an IPv6 network
mknb writes one boot script per network under xcat/ipxe/nets, and that script is
what an unknown client boots: it carries destiny=discover and no node name, so
the Genesis image asks to be discovered. Every URL in it named the server with
${next-server}. DHCPv4 fills that from the siaddr of the offer, and DHCPv6 has no
next-server option, so iPXE leaves it empty and the fetch has no host.

The new test asks xCAT::NetworkUtils for the base of those URLs and holds down
both families. Measured on xcat88-mn: the per-node script, which boots, carries
http://[2001:db8:188::1]/ while the per-network script carried
http://${next-server}/.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:08:35 -03:00
Daniel Hilst 282adefda5 Merge remote-tracking branch 'origin/fix/dhcp6-reserved-address-reclaim-hold' into releases/2.20.0-rc9 2026-11-08 11:03:12 -03:00
Daniel Hilst 82d39637a6 test(xcat-core): an unknown DHCPv6 client needs the second boot stage named
kea_client_classes6 names the shim for an unknown client, which answers the
firmware. The shim starts iPXE, and iPXE solicits again with the iPXE user class.
A client xCAT has never seen matches no per-node class, so its only match is the
architecture class, and it is handed the shim a second time. It never fetches a
kernel and never sends a findme, so sequential discovery over IPv6 cannot start.

The new assertions ask for an iPXE second-stage class carrying the per-network
script that mknb writes, and for it to be offered before the architecture class,
because Kea takes the first class that defines an option. All four fail on this
commit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 11:02:56 -03:00
Daniel Hilst 39a1ad2d05 Merge remote-tracking branch 'origin/fix/dhcp6-reserved-address-reclaim-hold' into releases/2.20.0-rc9 2026-11-08 10:40:04 -03:00
Daniel Hilst 2ec9341007 test(xcat-core): a reserved DHCPv6 address must be free for the next boot stage
A boot chain presents one DUID in several stages, and each stage asks for its own
IA. Kea holds a reclaimed lease for an hour by default, so the reserved address a
boot loader released is still bound to the IAID of the loader when the Genesis
image asks for it. The image is given a pool address, and xcatd names a node by
the address it speaks from.

The new assertions read expired-leases-processing out of the rendered DHCPv6
document. They fail on this commit, because render_dhcp6_config writes no such
block and all three Kea defaults apply.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 10:39:06 -03:00
Daniel Hilst d0957a5695 Merge branch 'feat/ipv6' into releases/2.20.0-rc9 2026-11-08 06:48:58 -03:00
Daniel Hilst 0e45012264 fix(xcat-core): choose the UUID byte order of a DUID from the node, not the platform
The implementation for 596450159, which committed only its test.

dhcp6_firmware_uuid_order answers canonical for a kvm node and firmware for any other, because
getNodeUUID writes the byte swap of vpd.uuid into the libvirt domain of a guest xCAT defines and
the SMBIOS encoding swaps it back. dhcp6_client_duid uses it when the node sets no duid attribute,
and dhcp6_client_duids reads nodehm.mgt to supply it.

dhcp_dhcpv6_duid.t gains the mgt column and asserts the address holder of a kvm node against that
of a node xCAT does not define.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:48:54 -03:00
Daniel Hilst 175ac0ea0c Merge branch 'feat/ipv6' into releases/2.20.0-rc9 2026-11-08 06:48:34 -03:00
Daniel Hilst 5964501597 fix(xcat-core): a KVM node reserves its IPv6 address for the wrong byte order
makedhcp derived the DHCPv6 address reservation of a node from the byte swap of vpd.uuid, on the
grounds that EDK2 copies the SMBIOS UUID bytes into its DUID and SMBIOS stores the first three
fields little-endian. That holds for a physical node. For a KVM guest that xCAT defines it is
wrong: getNodeUUID writes the byte swap of vpd.uuid into the libvirt domain, qemu stores that
little-endian in SMBIOS, and the two swaps cancel, so the firmware of the guest sends vpd.uuid
unswapped.

Measured on xcat88-cn: the firmware and the OpenEmbedded Genesis image both sent
00:04:0c:3f:8d:41:... from vpd.uuid 0c3f8d41-6a52-4e7b-..., while iPXE sent the swap. The address
was reserved for the swap, so the image took an address from the dynamic range and xcatd could
not name it.

dhcp6_firmware_uuid_order reads nodehm.mgt and answers canonical for a kvm node and firmware for
any other, and dhcp6_client_duid uses it when the node sets no duid attribute. A node that names
an order itself is unchanged.

dhcp6_firmware_uuid_order.t covers the predicate. dhcp_dhcpv6_duid.t asserts that a kvm node
holds its address on the canonical order and that a node xCAT does not define keeps the swap.
Both fail with the predicate forced to one order.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:48:31 -03:00
Daniel Hilst 267e996ed7 Merge branch 'feat/ipv6' into releases/2.20.0-rc9 2026-11-08 06:17:48 -03:00
Daniel Hilst 5e1e3b0000 revert(xcat-core): a pool of one address cannot serve two IAs of one client
Reverts dd065ea99, 084f4a9ed and c84716b9d, which gave a node of several DHCPv6 clients a pool of
exactly its address, gated on a client class matching every DUID of the node.

Measured on xcat88-cn: Kea consumes a pool address per (DUID, IAID) pair. The firmware and the
OpenEmbedded Genesis image send the same DUID with different IAIDs, so the firmware took
2001:db8:188::20 and Genesis still fell through to the dynamic range at ::1002. The pool serves
whichever client solicits first and cannot serve both.

A host reservation applies to every IA of its client, so a reservation is what spans the firmware
and the image. The defect is which DUID holds the reservation, not that a reservation holds it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:17:28 -03:00
Daniel Hilst 4303f85640 Merge branch 'feat/ipv6' into releases/2.20.0-rc9 2026-11-08 06:11:18 -03:00
Daniel Hilst c84716b9db fix(xcat-core): the Genesis image gets a pool address and xCAT cannot name the node
A node solicits over DHCPv6 under more than one DUID, and kea_node_reservations6 reserved the
address for the first client only. The OpenEmbedded Genesis image sends the DUID-UUID in the
order the firmware sends, which is not that client, so it took an address from the dynamic range.
xcatd could not map the address to a node, Genesis reported CERTIFICATE_ACTION_FAILED with the
node unassigned, and discovery over IPv6 stopped there.

Which order the firmware sends is not the same on every platform. For a KVM guest getNodeUUID
writes the byte swap of vpd.uuid into the domain, and the firmware swaps those bytes back, so the
order the firmware sends is the one the code labels for iPXE.

makedhcp now gives a node of several clients a pool of exactly its address, gated on a client
class that matches every DUID of the node, and leaves the address out of the reservation: Kea
excludes a reserved address from every pool. The reservation still carries the hostname, on one
entry, because _reservation_matches treats a shared hostname as the same reservation. A node with
one client is unchanged and keeps its address in its reservation.

dhcp_dhcpv6_duid.t reads the address through the pool as well as the reservation. Without the
pool insertion its nine address assertions fail.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:11:04 -03:00
Daniel Hilst dd065ea99a test(xcat-core): one IPv6 address cannot reach every DHCPv6 client of a node
A node solicits under more than one DUID. Measured on 2026-11-08, the OpenEmbedded Genesis
image sends the DUID-UUID in the byte order the firmware sends, not the DUID-LL that
dhcp6_client_duid_list assumes. It matched the reservation of the node that holds no address,
took 2001:db8:188::1005 from the dynamic pool, and xcatd could not name it. Genesis reported
CERTIFICATE_ACTION_FAILED with the node unassigned.

A reservation holds the address for one identifier only. Kea refuses the same address on a
second reservation, and a hw-address reservation never matches because these packets carry no
hardware address. A client class can match every DUID form, and a pool of one address can be
gated on that class.

The test asks for kea_node_address_class6 and kea_node_address_pool6 and fails without them.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 06:02:18 -03:00
Daniel Hilst e2495c4811 Merge feat/ipv6 into releases/2.20.0-rc9
Comment-only: the reason a DUID byte order cannot name a boot stage.
2026-11-08 01:19:16 -03:00
Daniel Hilst 0c3cede440 docs(xcat-core): correct why a DUID byte order cannot name a DHCPv6 boot stage
The previous two commits said the firmware sends the uuid in RFC 4122 order and iPXE in SMBIOS
order, the opposite of a physical machine. That reads the measurement the wrong way round.

getNodeUUID in kvm.pm writes the libvirt domain uuid as the byte-swap of vpd.uuid, and swaps back
when it reports the value, so vpd.uuid is the uuid the guest reports. The firmware sends the
SMBIOS bytes of the domain uuid, which is vpd.uuid unswapped, and iPXE converts those to RFC 4122,
which is the swap. A node whose domain carries vpd.uuid unswapped gives the opposite pair. Both
orders are real, and neither follows from vpd.uuid alone.

The code does not change. The reason recorded in it does.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 01:19:12 -03:00
Daniel Hilst 970cf0fde1 Merge feat/ipv6 into releases/2.20.0-rc9
Carries the DHCPv6 boot-stage split on option 15. The firmware and the iPXE it loads send the
same vpd.uuid in two byte orders, and which client sends which order depends on the platform, so
the reservation of a chainloading node can no longer name a boot file.
2026-11-08 01:11:34 -03:00
Daniel Hilst 182f3d9ef2 fix(xcat-core): DHCPv6 gives the firmware an http boot file it cannot fetch
A UEFI node that chainloads solicits twice. dhcp6_client_duid_list labelled the SMBIOS
little-endian DUID-UUID 'firmware' and the RFC 4122 one 'ipxe', and kea_node_reservations6 wrote
the boot file of that stage into each reservation.

The byte order depends on how the platform stores its SMBIOS uuid, so it does not identify a boot
stage. On a QEMU UEFI node the pair arrives the other way round: the firmware matched the
reservation labelled 'ipxe' and was given an http:// URL, which a UEFI PXEv6 boot option cannot
fetch, and reported "PXE-E53: No boot filename received". iPXE matched the one labelled
'firmware', was given the shim a second time and stopped at "Failed to open ipxe.efi".

kea_node_boot_classes6 makes the split the DHCPv4 path makes with the iPXE feature sub-options of
option 175, using option 15, the DHCPv6 User Class: iPXE sends it holding iPXE and the firmware
does not send it at all. Each of the two classes matches every DUID of the node, so neither order
is assumed, and the tests are mutually exclusive. The reservations of a chainloading node now
carry no boot file, because Kea gives a reservation's option data precedence over a class's; they
keep their DUIDs, so an update or a delete after a change of netboot still finds every client.
The Genesis client keeps its own reservation and boot file.

dhcp6_boot_stage_classes.t went from 16 failures to none. The assertions in dhcp_dhcpv6_duid.t
that read a stage boot file out of a reservation now read it out of the class that serves it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 01:11:23 -03:00
Daniel Hilst cc5ee8f3fc test(xcat-core): capture the DHCPv6 boot stage that a DUID byte order cannot identify
A UEFI node that chainloads solicits twice, and makedhcp tells the two clients apart by the byte
order of the DUID-UUID. The order depends on how the platform stores its SMBIOS uuid, so it does
not identify a boot stage.

Measured on an EL10 management node with Kea DHCPv6 at DEBUG, one boot of a QEMU UEFI node sends
the opposite pair to the one the code assumes: the firmware solicits with 00:04:0c:3f:8d:41:... in
RFC 4122 order and no option 15, and iPXE with 00:04:41:8d:3f:0c:... in SMBIOS order and option 15
holding 00:04:69:50:58:45, the length-prefixed string iPXE.

This test asks for the split the DHCPv4 path already makes, on what the client reports rather than
on who it is. It fails on the current tree: kea_node_boot_classes6 and
dhcp6_ipxe_user_class_test do not exist, and every one of its 16 assertions is red.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-08 01:11:13 -03:00
Daniel Hilst cdb8187cbc fix(xcat-test): the SELinux diskless case cannot find an iPXE node boot config
selinux_cn_diskless_disabled_by_design looks for the boot configuration of the
compute node in three places: the xnba node directory, pxelinux.cfg by node
name, and petitboot. A node with netboot=ipxe has its script in
/tftpboot/xcat/ipxe/nodes/<node>.uefi instead, which the list does not name, so
the case reports

  BOOTCFG-BAD: the node has no boot configuration
  BOOTCFG-BAD: no boot configuration carries selinux=0

and fails on every iPXE cell. xcat54-cn of el10-x86_64-devel is netboot=ipxe, so
build 78 of xcat-test-el10-x86_64 failed there after its other checks passed:
the node reported SELinux disabled and the case still could not confirm the flag
reached the boot configuration.

Both path lists now name the iPXE script, the UEFI one first, which is the file
a UEFI client fetches. nodeset/ipxe_secureboot_shim.sh already reads that path.

The paths stay absolute, so the check still fails when no boot configuration
carries selinux=0.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 20:15:32 -03:00
Daniel Hilst 279e4de1f2 Merge feat/ipv6 into releases/2.20.0-rc9
Carries the xcatd= address family: destiny.pm chose the address with
my_ip_facing, which is IPv4 only, so an IPv6-only node fetched its Genesis
payload over IPv6 and was told to report to xcatd over IPv4.
2026-11-07 19:38:41 -03:00
Daniel Hilst 7f2fdb6f87 test(genesis): the xcatd= argument names the IPv4 address of an IPv6-only node
destiny.pm chooses the address for the xcatd= kernel argument with my_ip_facing,
which resolves the peer with OnlyV4. An IPv6-only node shares the link with the
management node, so that call succeeds and answers with the IPv4 address.

Measured on xcat88-mn, whose compute node holds only 2001:db8:188::20:

  imgfetch -n kernel http://[2001:db8:188::1]/tftpboot/xcat/genesis.kernel.x86_64
  imgargs kernel ... xcatd=192.168.88.1:3001 destiny=shell

The payload is fetched over IPv6 and the node is then told to report over IPv4.
An IPv4 pool on the same network hid this. Without one the node holds no IPv4
address, so Genesis cannot reach xcatd and discovery never completes.

genesis_xcatd_address_family.t asserts that the resolver picks the family from
the node, that a resolver error travels rather than becoming a false address,
and that an IPv6 literal is bracketed in the argument. Five of its seven
assertions fail without the fix.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 19:38:18 -03:00
Daniel Hilst bd696e7689 Merge feat/ipv6 into releases/2.20.0-rc9
Carries the DHCPv6 boot-file gap: a client with no reservation was answered
with an address and no option 59, so a node being discovered over IPv6 had
nothing to boot and sequential discovery could not start.
2026-11-07 19:17:03 -03:00
Daniel Hilst 03129cf654 test(dhcp): a DHCPv6 client with no reservation is told nothing to boot
Sequential discovery over IPv6 starts with a node xCAT has never seen. It has
no DUID in the dhcp6duid table, so kea_node_reservations6 writes no reservation
for it, and option 59 (bootfile-url) is written only inside a reservation. The
subnet carries a dynamicrange, so Kea answers the node with an address and no
boot file.

Measured on xcat88-mn: an unknown client took 2001:db8:188::1000 from the pool,
and the running kea-dhcp6.conf held no client-classes at all.

dhcp6_boot_client_classes.t asserts that render_dhcp6_config carries
client-classes, that _render_subnet6 scopes a class to its subnet, and that the
class builder names a loader per architecture from option 61. Without the fix
10 of its 11 assertions fail.

dhcp_kea_plugin_intent.t gains four assertions on the wiring: that
kea_subnet6_intent carries the classes and evaluates them only for its own
subnet. Emptying the class list in kea_subnet6_intent fails those four and no
other test in the file.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 19:15:10 -03:00
Daniel Hilst 8cf1615b24 fix(xcat-core): rpmbuild rejects four specs with %else after %else
xCAT-buildkit, xCAT-client, xCAT-test and xCAT-vlan each hold two %else
in the pod converter BuildRequires block, so rpmbuild -bs stops with
"%else after %else" and the EL core build fails for every architecture
before it can index a repository.

The feat/ipv6 merge produced the structure. Both sides rewrite the same
%if block, master as "%if 0%{?suse_version}" and feat/ipv6 as the
inverted "%if !0%{?suse_version}", and they touch different lines, so
git merged both bodies without a conflict.

This change keeps master's form and removes the second branch. The two
branches ask for the same package on the same condition, so no
BuildRequires changes.

spec_conditional_nesting.t reports all four files before this change and
none after.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 11:40:25 -03:00
Daniel Hilst 325da9b749 test(xcat-core): catch a malformed rpm conditional in a spec file
rpmbuild rejects a spec that holds two %else in one conditional, and
nothing in the tree checked for it. A merge where both sides rewrite the
same %if block can produce that structure with no git conflict, so the
fault reaches a build host instead of a test.

spec_conditional_nesting.t reads every *.spec in the tree and tracks the
%if / %else / %elif / %endif nesting in Perl. It reports a second %else,
an %elif after %else, a directive with no open conditional, and an
unterminated conditional. A probe at the end of the file confirms the
check itself reports a second %else.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 11:40:17 -03:00
Daniel Hilst 0b2e0a59ec merge(xcat-core): take fix/ubuntu-netboot-dracut-ng-systemd-initrd into releases/2.20.0-rc8
An Ubuntu 26.04 diskless node freezes in the initial ramdisk at 1.78 s with
'Failed to isolate default target: Unit rescue.service not found'. genimage writes an
exclusive dracutmodules list, dracut 110 drops 35network-legacy, so 11systemd-networkd is
selected, 80base then makes systemd the init, and the list names neither systemd-initrd nor
dracut-systemd, so there is no default target. rh/genimage already names those three for
dracut 105 and later.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 09:34:42 -03:00
Daniel Hilst 705d199c4b test(xcat-core): Ubuntu netboot dracut.conf names no systemd module
An Ubuntu 26.04 diskless node freezes in the initial ramdisk:

    systemd[1]: Failed to isolate default target: Unit rescue.service not found.
    systemd[1]: Freezing execution.

The netboot dracut.conf names an exclusive module list, "xcat nfs base
network kernel-modules". dracut-ng, which resolute ships as dracut 110,
removed the network-legacy module, so 40network selects systemd-networkd,
which depends on the systemd module. The base module then skips the shell
/init, and systemd becomes /init. The list names neither systemd-initrd nor
dracut-systemd, so the initial ramdisk holds no initrd.target.

Move the list into imgutils::dracut_netboot_modules, which takes the image
module directory and returns the list, and call it from both dracut.conf
writes in the Ubuntu genimage. The new
xCAT-test/unit/imgutils_dracut_netboot_modules.t holds the noble list down
and asks for the systemd modules on a dracut that has no network-legacy.
Three of its six assertions fail on this commit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 09:33:15 -03:00
Daniel Hilst 8b2b514805 merge(xcat-core): take fix/selinux-diskless-bootcfg-check into releases/2.20.0-rc8
The case asserted rc == 0 on a grep -rhl over three per-node bootloader paths. GNU grep exits 2 for a file it cannot open and keeps that status even when it matched elsewhere, so only one bootloader writes a file per node and the case could never pass.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 09:19:56 -03:00