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

1103 Commits

Author SHA1 Message Date
Daniel Hilst 77eaf4d53c fix(ipv6): a diskless node has an address and no route
mknetboot gave an IPv6-only node ip=either6, which asks dracut for DHCPv6.
DHCPv6 assigns one address with a prefix length of 128 and carries no route, and
an xCAT provision network sends no router advertisement: radvd is not installed
and net.ipv6.conf.<nic>.forwarding is 0. The node came up with the address and
no way to reach the server, and the dracut hook reported
"Connecting to [2001:db8:147::1]:80... failed: Network is unreachable."

debian.pm now builds the static form from the address, gateway and prefix the
node already has in the database, the way sles.pm passes hostip and gateway to
linuxrc. either6 remains the answer when the address cannot be resolved.

Captured by xCAT-test/unit/dracut_static_ip6.t. Removing the prefix length from
the parameter fails four of its nine assertions and leaves the bracketing and
the refusal cases passing.

Measured on an IPv6-only Ubuntu 24.04 node: Kea records prefix_len=128 for its
lease, and dracut logged BOUND6 for eth0 before the fetch failed.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 15:27:53 -03:00
Daniel Hilst ddaad73ab4 fix(grub2): a ppc node is given linuxefi when its image carries it
grub2_kernel_commands read the image and not the architecture, so a ppc node
whose grub2 image carries linuxefi was given it. linuxefi loads an EFI binary
and a ppc loader is not one. The previous commit removed the architecture test
along with the defect it carried.

The command now needs both: the architecture whose loader is an EFI binary, and
an image that carries the command.

grub2_netboot_protocol.t covers the three architectures and caught this. Its
loader fixture now records the commands it carries, because the configuration
follows the image.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 15:27:53 -03:00
Daniel Hilst 557c3689f7 test(grub2): a grub2 image without linuxefi is still offered linuxefi
grub2.pm chooses the kernel command from the architecture of the node, so every
x86 node is given linuxefi and initrdefi. Those two come from a downstream patch
and an image built from upstream grub carries neither.

These assertions fail without the fix that follows: the upstream image, the
missing image and the undefined image are all answered with linuxefi.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 14:45:33 -03:00
Daniel Hilst 5760b73d57 test(networkutils): the facing-address placeholder is dropped by format_host_port
format_host_port validates its host with format_uri_host, which refuses
'!myipfn!' because it is not a host name. The call returns undef, so a command
line built from it loses both the server and the port.

These assertions fail without the fix that follows: format_host_port and
format_uri_host return nothing for the placeholder, and the imgurl built from it
reads "imgurl=http:///install/..." for an IPv6 and an IPv4 facing address alike.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 13:49:07 -03:00
Daniel Hilst 1c8094e305 fix(template): the IPv6 search list makes YaST refuse the whole profile
The search list added in the previous commit carried no config:type, and the
AutoYaST schema gives searchlist the LIST type, the way it gives it to
nameservers. xmllint against profile.rng of Leap 15.6 reports only "Element
profile failed to validate content", and YaST refuses the profile entirely, so
the node cannot install at all.

searchlist is now emitted as a typed list. Measured against
/usr/share/YaST2/schema/autoyast/rng/profile.rng on a live management node: the
generated profile fails to validate, the same profile with the attribute added
validates, and removing hostname as well changes nothing, so hostname was not
the element at fault.

Captured by xCAT-test/unit/autoyast_ipv6_network.t, which gained an assertion on
the attribute.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 12:48:21 -03:00
Daniel Hilst 278b582cf5 fix(template): an IPv6-only SUSE node is installed as "localhost"
_autoyast_network6 sets dhcp_hostname to false, because an IPv6-only node has no
DHCPv4 to take a hostname from, and it writes no hostname of its own. YaST then
has nothing to set: y2log of an installed node records Y2Network::Hostname with
@static=nil, @transient=nil and @dhcp_hostname=:none, and the node answers
"localhost". The two sibling builders in the same file write both keys.

The dns section now carries the node name and a search list of the node domain.
getNodeNetworkCfg6 already returns the name, so no new lookup is needed.

Captured by xCAT-test/unit/autoyast_ipv6_network.t. Without the two keys its
assertions 17 and 18 fail and the other 16 pass.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 12:26:20 -03:00
Daniel Hilst 7fd7ee7d92 test(template): an IPv6-only node is given an IPv4 resolver it cannot reach
site.nameservers holds one list for the whole cluster, so an IPv6-only node takes the
IPv4 resolver of an IPv4 network when its own network names none. The AutoYaST profile
of a Leap 15.6 node carried <nameserver>192.168.156.1</nameserver> while the node had
no IPv4 address at all.

An unreachable server in resolv.conf is not a failure the node reports. Every lookup
waits for its timeout before the next server is tried.

The test adds a node whose configured resolvers are IPv4 only and asserts the section
carries none of them, and that the gateway stands in.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 09:58:17 -03:00
Daniel Hilst 2a6d80fb8c test(template): the address mode is answered for the cluster, not for the node
post.sles.common reads MANAGEDADDRESSMODE and, for anything but static, removes the
interface configuration and writes a new one with BOOTPROTO=dhcp. managed_address_mode
returns site.managedaddressmode, which describes the cluster.

An IPv6-only node therefore has the static IPv6 configuration in its AutoYaST profile
rewritten to DHCP during the post phase, and comes up with a link-local address only.
The node has no IPv4 address to ask a DHCP server for, so the site attribute cannot
answer for it.

The test renders MANAGEDADDRESSMODE for three nodes with the site attribute set to
dhcp: an IPv6-only node, an IPv4 node and a dual-stack node. Only the IPv6-only node
is expected to differ, so the other two hold the site behaviour down.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 09:56:37 -03:00
Daniel Hilst 918ed688de test(ipv6): nothing gives the dracut initrd an IPv6 network parameter
An Ubuntu diskless node brings its interface up from the dracut ip= parameter.
debian.pm appends ifname, netdev and BOOTIF and no ip= at all, and dracut configures
the interface it needs with DHCPv4 when the command line carries none. An IPv6-only
node therefore gets no address, cannot fetch imgurl and never mounts a root.

gen_net_boot_params already derives the interface in xCAT's own order and returns the
IPv4 spelling of the parameter. The test asserts the IPv6 spelling beside it for every
branch that names an interface, and asserts the IPv4 spelling is unchanged, because
anaconda.pm is its only caller today.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 09:09:23 -03:00
Daniel Hilst edea395c29 test(packaging): the IPv6 module dependency is asserted for the wrong families
The assertions added with this test required Socket6 and IO::Socket::INET6 on every
RPM family, which contradicts xcat_server_inet6_optional_dependency.t and the reason
it records: every call site loads the modules with an eval and keeps working on IPv4,
so a hard dependency states a dependency the code does not have.

The measurement that prompted the test still holds, and it is narrower than it looked.
Both modules are absent on a Leap 15.6 management node because the openSUSE Minimal-VM
image sets solver.onlyRequires = true in /etc/zypp/zypp.conf, so zypper installs no
recommended package. dnf installs one, so EL and openEuler need no hard dependency.

The test now reads requires and recommends separately per family: openSUSE requires
both and recommends neither, EL and openEuler recommend both and require neither. The
deb control files are read per package, since perl-xCAT has carried a hard dependency
since before this rule. xcat_server_inet6_optional_dependency.t gains a pointer to the
openSUSE exception so the two files do not disagree in prose.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 09:05:15 -03:00
Daniel Hilst 7703372cc2 test(packaging): nothing declares the two Perl modules every IPv6 path needs
xCAT::SLP, xCAT::IPMI, xCAT::Client, xCAT::NetworkUtils and the dhcp, nodestat and
credentials plugins reach IPv6 only through Socket6 and IO::Socket::INET6. Each one
loads them with eval { require ... }, so a missing module is not an error. The guard
variable stays false and the IPv6 branch is never taken.

No family declares the dependency. perl-generators reads a use statement, not a
require inside an eval, so the EL build derives no perl(Socket6) either, and
xCAT-server lists the two deb packages as Recommends, which apt 3.0 solver3 can drop.

The test asserts both specs require both modules on openSUSE, EL and openEuler, and
that both deb control files name them in Depends.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 08:52:19 -03:00
Daniel Hilst d1cafdddc3 test(template): the IPv6 profile does not replace the installer network
AutoYaST keeps the network the installer used unless keep_install_network says
otherwise, and the sections _autoyast_network6 replaces set it true. The static
interface in the generated section was therefore ignored.

The test asserts the section sets keep_install_network to false.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 14:48:37 -03:00
Daniel Hilst ebefdec9f8 test(template): the IPv6 networking section carries an element the schema refuses
AutoYaST validated the generated profile and reported "Extra element networking
in interleave", then told the operator no profile could be retrieved. The
element is dhcp_resolv, which the schema of Leap 15.6 does not accept.

The test asserts the section has no dhcp_resolv and keeps dhcp_hostname, which
the schema does accept.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 13:28:53 -03:00
Daniel Hilst b3cb867b87 test(sles): an IPv6-only node gets no installer network configuration
sles.pm put only the net device on the command line, so linuxrc configured IPv4
by default. An IPv6-only node sent an IPv4 DHCPDISCOVER, which the management
node answered "no free leases".

The test covers the arguments for a node with a gateway and an IPv6 nameserver,
for one with neither, that an IPv4 nameserver is left out, and that a node with
no IPv6 configuration gets no arguments.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 13:24:43 -03:00
Daniel Hilst 19779fa2f8 test(dhcp): an IPv6 subnet never gets its dynamic range
addrangedetection keys the dynamic ranges on networks.net, which carries no
prefix length. addnet6 names a subnet "<net>/<prefix>" and looked the range up
under that, so the lookup missed every IPv6 subnet.

The test drives the lookup with both forms of the subnet and holds down that an
IPv4 subnet is unchanged.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 12:40:44 -03:00
Daniel Hilst de6c13471f test(xcattest): a conf value that carries shell syntax is not quoted
xcattest applies the [Object_*] sections of a conf by joining each attribute to
a chdef command and running it through bash. Nothing quoted the values, and a
conf carries values a shell reads as syntax.

The test builds the command for a vmothersetting that holds two settings and
asserts the semicolon stays inside one command, that every value is quoted, and
that bash passes the whole value through as one argument.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 12:13:02 -03:00
Daniel Hilst 84f18d5fd5 test(dhcp): nothing asserts the two backends agree on the boot file URL
dhcp6_bootfile_url_for_node builds the RFC 5970 option 59 URL for both DHCP
backends, and each backend already had its own assertions on it. Neither
compared them, so the two could drift apart and both files would stay green.

The new block renders the same node through kea_build_node_reservations6 and
through the ISC omshell session and asserts the URL is the same string, that Kea
marks it always-send, and that a node asking for xnba gets none from either
backend.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 12:05:35 -03:00
Daniel Hilst 139249f811 test(packaging): the openSUSE TFTP dependency can resolve to a server with no IPv6
xCAT.spec requires the file /usr/sbin/in.tftpd. Two openSUSE packages provide
it, and atftp has no IPv6 option at all.

The test asserts openSUSE asks for the tftp package by name and no longer leaves
a file dependency atftp can satisfy, and that EL keeps the file dependency it
resolves to tftp-server.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 12:03:56 -03:00
Daniel Hilst 706efff55b test(template): the autoyast media_url does not bracket an IPv6 master
Template.pm built the media_url of each add-on product from the noderes
substitution, which writes the address of the management node as it stands. An
IPv6-only node was told to install from "http://2001:db8::1//install/...".

The test covers the IPv6-only URL on the default port and on a custom port, and
holds down that a node with IPv4 keeps the substitution.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 11:07:37 -03:00
Daniel Hilst 19dc1de843 test(grub2): the facing address is substituted without brackets into a URL
grub2.pm replaces !myipfn! with the facing address of the management node. The
placeholder stands in front of ":$httpport" in the install URLs, so an IPv6
address was substituted bare and the authority could not be read.

grub2_ipv6.t now exercises setstate with a kcmdline that carries the placeholder
inside an install URL. sles_install_url_ipv6.t asserts the substitution itself
against the real module, in both contexts: bracketed where a port follows, bare
where none does.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 10:46:39 -03:00
Daniel Hilst c268c42475 test(sles): the install URLs do not bracket an IPv6 server
sles.pm joined the install server and the port with a colon, so an IPv6
management node produced "install=http://2001:db8:156::1:80/install/...". That
authority cannot be split into an address and a port.

The test covers the diskful autoyast= and install= arguments, the statelite and
stateless imgurl=, and the authority helper the three share.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 10:21:32 -03:00
Daniel Hilst 368026599d test(dhcp): makedhcp writes no DHCPv6 configuration on openSUSE
dhcp.pm derived the DHCPv6 configuration file only inside the branch that
switches the DHCPv4 file to /etc/dhcp/dhcpd.conf. openSUSE ships /etc/dhcpd.conf,
so that branch never ran and the v6 file stayed undef.

The test asserts the v6 file for each layout ISC uses, that an AIX file yields
none, and that the module derives the v6 file from the v4 file it chose.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 09:46:30 -03:00
Daniel Hilst c5eed8e83f test(packaging): the openSUSE requires test covers only perl-xCAT
xcatd also fails to start on openSUSE, on Date::Parse, which xCAT-server ships in
xcatd.pm. The test named perl-xCAT alone, so that gap was not captured.

The expected capabilities are now a table keyed by spec, and xCAT-server is in
it. The set comes from comparing every perl() capability the EL build generates
against what a Leap 15.6 management node can resolve: of 88, only these five are
required and absent.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 09:20:25 -03:00
Daniel Hilst c559224455 test(packaging): perl-xCAT declares no Perl dependencies for openSUSE
perl-xCAT.spec carries no Requires and relies on the automatic Perl dependency
generator. EL has perl-generators and derives 99 perl() requires from the module
sources. openSUSE has none, so the built rpm requires only /bin/sh.

The test reads the Requires of perl-xCAT with rpmspec for openSUSE and for EL10.
On openSUSE it expects the four modules a Leap node does not otherwise carry. On
EL it expects none of them, because perl-generators derives them there.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 08:58:59 -03:00
Daniel Hilst d3e4d010db test(packaging): a bail-out in the openSUSE spec test stops the whole suite
opensuse_pod2man_buildrequires.t called BAIL_OUT when rpmspec exited non-zero.
prove stops every remaining file on a bail-out, not only the one that called it,
so one unreadable spec would hide the result of the rest of the suite.

The close failure now dies, which fails that file alone.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 08:35:40 -03:00
Daniel Hilst 7ec7c8ba03 test(packaging): xCAT-server asks openSUSE for a DB_File package it has not
openSUSE ships DB_File in perl-core-DB_File. The spec asks for perl-DB_File on
every platform below EL10, so zypper refuses the transaction with "nothing
provides 'perl-DB_File' needed by the to be installed xCAT-server" and the
management node cannot install xCAT.

The test reads the Requires of xCAT-server with rpmspec for openSUSE, EL9 and
EL10. On openSUSE it expects the perl(DB_File) capability and no perl-DB_File
package name. The EL assertions hold the existing behaviour down: EL9 keeps the
hard package requirement, EL10 keeps none.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 08:35:22 -03:00
Daniel Hilst acec18e157 test(packaging): the man page tooling is not declared for openSUSE
Nothing asserted that the specs whose %build runs xpod2man declare something that
ships pod2man on openSUSE. The test reads the BuildRequires of each one for
openSUSE and for EL, so the EL side is held unchanged beside it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 07:09:26 -03:00
Daniel Hilst f0a67f4159 test(debian): the mkinstall branch test dies on the IPv6-only check
subiquity_boot_params now asks whether the node has an IPv4 address, and this
test's xCAT::NetworkUtils stub had no node_is_ipv6_only, so the extracted routine
died at the call and the file reported no plan rather than a failed assertion.

The stub answers that the node has an IPv4 address, which is what every case here
describes. The refusal itself is covered in debian_subiquity_boot_params.t.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 06:42:29 -03:00
Daniel Hilst 20e547aadd test(debian): the live installer is not checked against an IPv6-only node
The test never asked what subiquity_boot_params does for a node with no IPv4
address. The new cases assert that such a node is refused, that the message names
the node and the component without IPv6 support, and that a node which has an IPv4
address is unaffected.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 06:39:15 -03:00
Daniel Hilst 0f479fbb2f test(grub2): the !myipfn! placeholder is not checked on an IPv6-only node
grub2_ipv6.t drove setstate with a command line that has no placeholder, so the
lookup that resolves it was never exercised. The new cases assert the placeholder
becomes the IPv6 facing address and that the IPv4-only lookup, which reports the
node unresolvable, is not used. The IPv4 case beside it holds that path unchanged.

An earlier version of the assertion counted IPv6 facing calls, which the tftpserver
lookup in the same run already makes, so it passed with the defect in place.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 06:39:15 -03:00
Daniel Hilst a1a35fe3af test(kvm): vm.othersettings firmware: is not checked for Secure Boot
The setting accepted one value, efi, and nothing covered what a guest then asks of
Secure Boot. The test holds down which values the setting accepts, what each one
asks, and the guest XML each one produces, including that a guest which does not
ask for EFI gains no firmware element.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 06:23:08 -03:00
Daniel Hilst 3389c1ccd1 test(dhcp): the ISC DHCPv6 reservation of a node is not checked for a boot file
The DHCPv6 half of makedhcp had no test for the boot file, the DHCPv6 service or
the sysconfig file, so a node could be given its reserved address with nothing to
load and the suite stayed green.

The test drives the ISC path of makedhcp and asserts that every DHCPv6 host it
creates carries a bootfile-url naming the grub2 loader, that a node with
netboot=xnba gets none, that the DHCPv6 daemon is restarted, and that a missing
/etc/sysconfig/dhcpd6 is not reported as an error.

The harness now names the operating system instead of reading the host it runs
on. Both sysconfig branches depend on it, so without this the test exercised
whichever branch the build host happened to take, and the error assertion passed
with the defect in place. It also stubs restartservice, which the harness
previously let through to the services of the build host.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 02:41:44 -03:00
Daniel Hilst bfbc014ffe feat(xcat-core): a SUSE node can install over IPv6
sles.pm matched ipv6 nowhere in 2801 lines and the SUSE templates wrote
"<bootproto>dhcp</bootproto>" directly, so an IPv6-only SUSE node had no way to configure its
installer: DHCP cannot serve it, and SUSE has no static handoff on the kernel command line.

_autoyast_network6 builds the networking section of such a node, with a static interface, the
address of the node and a prefix length, which is what AutoYaST takes for IPv6 instead of a
netmask, and a default route carrying the IPv6 gateway.

The #YAST2NET6# directive chooses between that and the DHCP block the templates carried. An IPv4
node gets that block unchanged, which is why the existing #YAST2NET# was not used: its DHCP arm
renders something else, and leap15.6 is a gating cell. compute.leap15.tmpl and compute.sle15.tmpl
take the directive.

autoyast_ipv6_network.t covers the section. Emitting a netmask instead of a prefix length fails 2
of its 11 assertions. The IPv4 output of the directive was compared with the text it replaced and
is identical.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 01:37:57 -03:00
Daniel Hilst 7ab3628353 fix(xcat-core): an IPv6 server is unreadable in the netboot kernel command line
root=nfs:, XCAT=, xcatd= and imgurl=http:// all separate the server from what follows with a
colon, so an IPv6 address in any of them cannot be told from the path or the port. Eight sites
built those values by interpolation, and a diskless, statelite or cloned node of any family took
a command line its initrd could not parse.

build_statelite_nfsroot_parameter brackets the server, which covers the NFS root of all three
netboot plugins at once. debian.pm and sles.pm now build the XCAT endpoint and the image URL
through xcatd_cmdline_address and format_host_port, as anaconda.pm already did for the install
path, and the mksysclone endpoint of anaconda.pm and sles.pm goes the same way.

destiny.pm had a third xcatd= site. The earlier change covered the two genesis branches and left
the legacy nbk branch interpolating the address.

nfs_root_options.t asserts the bracketed form, the IPv4 form and the mount options after a
bracketed address. Removing the brackets fails 2 of its 80 assertions and leaves the IPv4 and the
name cases passing.

zvm.pm carries the same pattern and is left alone: z/VM has no IPv6 netboot path to test it on.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 01:23:24 -03:00
Daniel Hilst 68d10c5111 feat(xcat-core): write the DHCPv6 client identifier on the installed node
makedhcp builds a DUID-UUID from vpd.uuid and the reservation carries one identifier, but no
network manager derives that identifier in the byte order the firmware sends. NetworkManager has
no option for the SMBIOS UUID at all, and systemd-networkd's DUIDType=uuid uses the decoded
product UUID, which is the other order. So a node whose installed OS speaks DHCPv6 matched no
reservation and took a pool address.

configdhcpv6duid writes the identifier for whichever renderer the node has: the whole DUID for
NetworkManager, and the type by name with the sixteen bytes alone for systemd-networkd, which
composes the two. It is in the default postscript list for Linux, after remoteshell. AIX has
neither renderer and keeps its list.

A diskless or statelite node needs nothing: its address comes from the kernel command line and
configeth writes dhcp6: false, so its image sends no DHCPv6 request.

postscript_dhcpv6_duid.bats pins both forms to the literal the two Genesis images already use,
so the four copies of the byte swap cannot drift apart, and asserts the node fails loudly when
it has no renderer. postscript_dhcpv6_duid_registered.t holds the registration down: dropping it
fails 3 of its 7 assertions.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 01:08:42 -03:00
Daniel Hilst 3030ee7995 fix(xcat-core): a statelite and a cloned node ask DHCPv6 for an address no reservation holds
mknetboot excluded a statelite node from the static IPv6 address with no reason recorded, and
mksysclone had no IPv6 code at all. Both reach the same dracut networking as a diskless node, so
both asked DHCPv6 with the identifier their initrd generates. A reservation matches one
identifier, so the node took a pool address and no boot URL.

Statelite now takes the same path as diskless, and mksysclone renders the address beside the
Genesis kernel it boots.

anaconda_ipv6_statelite_sysclone.t drives both commands against a SQLite fixture. Restoring the
statelite guard fails one of its six assertions and removing the mksysclone block fails another,
while the diskless assertion survives both, so the gate did not move for diskless.

debian.pm records why the Ubuntu live filesystem is mounted over IPv4. The comment blamed casper,
which passes nfsroot= through untouched; klibc nfsmount is what cannot read an IPv6 server.
Measured on noble: "[2001:db8::1]:/export" and "2001:db8::1:/export" both answer "need a path",
while "192.0.2.1:/export" is accepted.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 01:01:51 -03:00
Daniel Hilst 18de00c7b4 fix(xcat-core): an openEuler node asks DHCPv6 for an address no reservation holds
The static IPv6 boot path was gated on is_el10_os, which tests the basename against
rh|centos|alma|rocky|ol and the major version against 10 exactly. openEuler reaches the same
kickstart and dracut code through #KICKSTARTNET#, but the predicate answered 0 for it, so an
openEuler node fell to "dhcp --device=X --noipv4 --ipv6=dhcp". Its installer then sent the DUID
that NetworkManager generates, which matches no reservation, and the node took a pool address.

The same equality left a later EL release on the DHCPv6 path for no reason.

SvrUtils::uses_static_ipv6_boot names the capability instead of a version: openEuler of any
release, and EL from 10 upwards. The three gates in Template.pm and anaconda.pm read it, and the
variable that carried the answer is no longer called el10_ipv6_only. is_el10_os keeps its own
tests and its one remaining meaning.

anaconda_ipv6_rendering.t asserts the predicate per family. Removing the openEuler arm fails 2
of its 38 assertions and leaves 36 passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 14:39:14 -03:00
Daniel Hilst 4509c4bb5d fix(xcat-core): the ISC path got no IPv6 reverse zone, and the Kea test passed under JSON::PP
getzonesfornet in dhcp.pm rounded the prefix itself and passed the rounded value beside a
network that still carried its own. getIPv6PrefixLength prefers the embedded prefix, so the
rounded value was ignored and no reverse zone was written at all: dhcpd updated no PTR record
for a /62 or /126 network and reported nothing. The ddns.pm copy stripped the prefix first and
was unaffected, so the previous commit's claim that both copies were fixed was wrong.

The zones now come from xCAT::NetworkUtils::getIPv6ReverseZones, which both copies call. A
network whose prefix is not a multiple of 4 is covered by the zones of the next nibble -- a /62
by its four /64 zones -- which is what the IPv4 arm does with a /22. Rounding down to the /60
made xCAT answer for three networks it does not own.

kea_subnet_id_numeric.t only observes the encoding under the XS backend, and passed 6 of 6
under JSON::PP with the bug in place. It skips unless JSON->backend is the XS one, and the
workflow installs libjson-xs-perl so the backend is there.

dhcp6_boot_server now reports a substituted boot server, so an unresolvable tftpserver is not
silent, and the caller reports a warning that arrives with a server. The routine also moved
below grub2_node_loader, whose comment it had separated from it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 11:38:48 -03:00
Daniel Hilst dc8c5cefed fix(xcat-core): Genesis sends a DUID the reservation does not hold, and makedns aborts on a /62
Both Genesis images built a DUID-UUID from the nil SMBIOS UUID. makedhcp refuses that UUID,
because nodeimport writes it to every PowerKVM node, and reserves the hardware address instead,
so the client sent an identifier no reservation held and the node took a pool address with no
boot file. genesis-duid and doxcat now keep the DUID-LL for it, which is what Kea reads the
hardware address out of.

getzonesfornet died on an IPv6 prefix that is not a multiple of 4, which took makedns and
makedhcp with it for a /62 or a /126 network. A reverse zone is delegated on a nibble, so the
prefix is rounded down and the enclosing zone is returned. Both copies of the routine are fixed.

The test suite needs socat and jq, and five bats files skipped without them, so the workflow
installs both. Template.pm drops the unused _is_el10, credentials.pm drops a repeated import,
and two comments that recorded bug history are cut to the fact the code cannot show.

Reverting any one fix fails named assertions: 1 of 8 and 1 of 3 bats cases for the two Genesis
images, and 4 of 30 in ddns_ipv6.t, which traps the abort so the file still reports.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 10:20:52 -03:00
Daniel Hilst 2811c2761d fix(xcat-core): the byte-order warning cannot be silenced, and a delete keeps one family
makedhcp reported a vpd.uuid that looks byte-swapped for duid=firmware and duid=canonical as
well as for a node with no duid attribute. Setting duid is the remedy the message names, so the
message could not be silenced except by a literal DUID. The check reads the version field, which
also reports a UUID that does not follow RFC 4122. It is now reported only for a node with no
duid attribute, and makedhcp.8 says so.

delnode removed only the lines of the family of the address it was given. A node whose address
changed from IPv4 to IPv6 kept its old A record, and makedhcp then wrote a DHCPv4 reservation
with a boot file for a node whose only address was IPv6. The family filter stays on the update
path, which is what keeps both records of a dual-stack node.

dhcp_dhcpv6_duid.t asserts that each duid value silences the report and that the default still
makes it. makehosts_dual_stack.t asserts a family change followed by a delete. Reverting either
fix fails exactly one assertion in each file.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 10:12:58 -03:00
Daniel Hilst 3324dd7250 test(xcat-core): the Kea subnet-id test did not load the module
kea_subnet_id_numeric.t copied the dedupe-key expression into the test and asserted on the copy.
It never loaded xCAT::DHCP::Backend::Kea, so restoring the aliasing map in the module left the
test passing 4 of 4. It measured Perl, not the product.

The test now calls live_upsert_reservations through an injected control_agent_handler, as
dhcp_kea_renderer.t does, and asserts on the body that encode_config produces, which is what the
HTTP path sends. With the aliasing map restored, 3 of its 6 assertions fail and 3 pass.

xcattest also carries the value class for a [Table_*] line. It was [\w\.\-], so a value of
"2001:db8:176::" matched "2001" and the row was written with that value, and "/64" matched
nothing. The class is now the one [Object_*] already uses. A ';' is deliberately left out:
setup_env_by_configure_file builds a shell command from these values.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 10:07:43 -03:00
Daniel Hilst 21359734b2 test(xcat-core): cover the dual-stack DHCPv6 boot server on a management node
makedhcp_dhcpv6_boot_intent declares a node with no tftpserver, so it measures only the
<xcatmaster> path. A dual-stack node keeps an IPv4 tftpserver, and that is the path on which
makedhcp exited 1 and dropped the boot URL.

makedhcp_dhcpv6_dual_stack_boot_server declares a grub2 node with an IPv6 address and an IPv4
tftpserver, then asserts that makedhcp exits 0, that Kea accepts the configuration, and that the
bootfile-url names the IPv6 address of the management node facing the node. Both values are
compared exactly, so a dropped option and a wrong authority each fail.

The test addresses move to the documentation ranges at the same time. The three networkutils
tests carried a link-local address read off a lab NIC, and dhcp_kea_plugin_intent.t carried two
addresses from the management network. They are fixtures that nothing dials, so this only keeps
the internal topology out of the upstream tree.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 05:35:23 -03:00
Daniel Hilst b667e759db fix(xcat-core): makedhcp fails on a dual-stack grub2 node
kea_boot_server6_for_node resolved the tftpserver of the node as IPv6 and reported
an error when it got no answer. A dual-stack node keeps an IPv4 tftpserver, which
has no IPv6 address, so makedhcp exited non-zero for the whole command and the
DHCPv6 reservation lost its boot URL.

xCAT::DHCP::BootPolicy->dhcp6_boot_server now chooses the server: a configured
value that resolves, else the management node address that faces the node, which
is what <xcatmaster> already does. When neither resolves, the node gets a warning
and keeps its reservation, because the node still boots over IPv4.

xCAT-test/unit/dhcp6_boot_server.t asserts the choice. Removal of the fallback
fails 3 of its 12 assertions and leaves 9 passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-27 02:01:33 -03:00
Daniel Hilst 33373cbc32 fix(makehosts): writing one address of a dual-stack node deletes the other
A node with an A line and an AAAA line in /etc/hosts under one name loses one of them.
Running makehosts for a node whose hosts.ip is IPv4 left only the IPv4 line. A second
line under the same name is the only way to give a node both records through
/etc/hosts and makedns.

_host_line_index_values records node names for any line whose first field looks like an
address, IPv6 included, and addnode overwrites the first match and blanks every other
one. Driving the plugin with 192.0.2.10 node01 and 2001:db8::10 node01 returned both
line indexes for the IPv4 address, so the IPv6 line was blanked.

A node name now matches only lines of the family being written. The reason the index
records node names at all, so a node that changes address does not leave a second
entry, is unchanged and is asserted per family. An unparsable first field counts as the
same family, so a legacy entry keeps the behaviour it had.

makehosts_dual_stack.t fails 6 of its 9 assertions without the family check; the three
that pass include an unknown node matching no line.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 21:02:23 -03:00
Daniel Hilst 204590b43a fix(dhcp): Kea rejects a subnet-id that arrives as a JSON string
Every Control Agent update falls back to a full dhcpd restart, because Kea refuses
"subnet-id":"1" where it expects 1.

The cause is Perl aliasing, not a type declaration. The dedupe key in
_live_delete_reservations was built with map { lc($_) } over a list whose first element
is $reservation->{'subnet-id'}; map binds $_ to that hash element itself, and reading a
numeric scalar through a string function attaches a string form to it. JSON::XS then
serialises the value as a string.

Reproduced: a reservation whose subnet-id is 1 encodes as {"subnet-id":1}; after the
map it encodes as {"subnet-id":"1"}; with the element copied first it stays
{"subnet-id":1}.

The map now copies the element before reading it. The key it builds is unchanged, so
the deduplication behaves as before.

kea_subnet_id_numeric.t pins all three states, so the aliasing cannot return unseen.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 21:02:23 -03:00
Daniel Hilst 5b9ad5fe83 Merge remote-tracking branch 'origin/fix/ipv6-oe-genesis-duid' into feat/ipv6 2026-10-26 17:56:24 -03:00
Daniel Hilst b49ff5aaec Merge remote-tracking branch 'origin/fix/ipv6-duid-collisions' into feat/ipv6 2026-10-26 17:56:24 -03:00
Daniel Hilst f775471804 test(xcat-core): the OpenEmbedded Genesis DUID matches no reservation
The OpenEmbedded Genesis image sets ipv6.dhcp-duid=ll, so NetworkManager sends a
DUID-LL. makedhcp builds a DUID-UUID from vpd.uuid, and kea_node_reservations6 puts
either a duid or a hw-address in a reservation, never both. A node that reported an
SMBIOS UUID therefore gets a DUID-only reservation that its DUID-LL cannot match: it
takes a pool address with no bootfile-url and does not netboot over IPv6. The legacy
image is correct here, because doxcat writes a DUID-UUID in firmware order.

genesis_openembedded_duid.bats asserts the image turns the SMBIOS UUID into the same
DUID that xCAT-test/bats/genesis_duid_uuid.bats pins for the legacy image, and that a
node with no SMBIOS UUID keeps the DUID-LL, which is what a hw-address reservation
needs. genesis_openembedded_duid.t covers the unit that writes it before
NetworkManager, and genesis_metadata.py covers the installed files.

All 15 assertions fail on this commit: there is no genesis-duid script and no unit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 17:51:45 -03:00
Daniel Hilst 6cdc48b595 fix(xcat-core): nothing reports a vpd.uuid left in the old byte order
Before this work xCAT stored vpd.uuid with its first three fields swapped for
nodes from Genesis discovery and for KVM guests from mkvm, clonevm and rscan.
vpd.uuid now holds the UUID that the operating system reports, and no row is
migrated. makedhcp swaps such a row a second time, so the DUID it reserves the
address for is the canonical order of the real UUID, which no client sends. The
node then gets no lease and makedhcp reports nothing. Until now the problem was
only described in makedhcp.8.pod.

A row cannot be rewritten, because nothing tells which spelling it holds. So
makedhcp reports instead. The new dhcp6_uuid_looks_byte_swapped reads the RFC
4122 version field: a swap of the first three fields moves it from the first
nibble of the third field to the third nibble, and moves nothing else. A value
whose version is valid only in the swapped position is therefore a row to look
at. dhcp6_client_duid returns the message as a third value, and addnode6 and
kea_node_reservations6 report it once for the node. Neither changes the value or
the reservation.

What the check cannot know: a swap leaves a valid version in the first field
about half the time, so it misses those rows. It also cannot read the UUID that
the node holds, so a node with a non-conformant firmware UUID can be reported
for nothing.

dhcp_dhcpv6_duid.t adds node cn10 and a block that holds down the detection, the
double swap, and the remedy the message gives. Reading the swapped version from
nibble 15 instead of 14 fails exactly the four assertions that name the report,
and leaves green the five that hold the limits of the check and the four that
hold the DUID values.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 17:43:36 -03:00
Daniel Hilst 587bbaabb3 fix(xcat-core): every PowerKVM node from nodeimport gets the same DHCPv6 DUID
nodeimport writes '00000000-0000-0000-0000-000000000000' to vpd.uuid for every
PowerKVM node it creates (profilednodes.pm). That value is 32 valid hexadecimal
digits, so kea_duid_from_uuid builds a DUID from it and returns
00:04:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 for all of them. makedhcp
then keeps the reservation of the node it wrote last and reports nothing.

kea_duid_from_uuid now refuses the nil UUID, which it reads through the new
dhcp6_uuid_is_placeholder. A node whose vpd.uuid is the nil UUID is treated like
a node with no vpd.uuid: with Kea DHCP the reservation falls back to the MAC
address of the node, and with ISC DHCP addnode6 skips the node and names the
reason. addnode6 carries a third message for the nil UUID, because the existing
'vpd.uuid is not a UUID.' is false for a value of the right form.

The all-f UUID is left alone. Nothing in the tree writes it, and RFC 4122 names
only the nil UUID.

dhcp_dhcpv6_duid.t adds node cn09 and a block for two PowerKVM nodes. Dropping
the one new line from kea_duid_from_uuid fails 15 assertions, among them 'two
nodes with the nil vpd.uuid keep one reservation each', while the three
neighbours that hold the limits of the check stay green.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 17:43:20 -03:00