rinstall prints "Failed to run 'nodeset' against the node: <node>" and returns
1, while nodeset against the same node exits 0 and reports no error. rinstall
returns before rnetboot and rpower, so the node is never powered on and every
provisioning case waits for a machine that nobody booted.
xCAT::Utils::runxcmd returns $::RUNCMD_RC. runxcmd_output ORs the errorcode of
each response into that global, and xCAT::Utils::runcmd and the service helpers
assign their own exit status to it, so the last command of any plugin in the
subrequest replaces the result. makedhcp supplies that command: its ISC branch
restarts dhcpd6 whenever /etc/dhcp/dhcpd6.conf is absent or written by another
program, which is every run of a cluster with no IPv6 network, and the restart
fails with no subnet to serve. A Kea cell restarts kea-dhcp6 only for a run
that has DHCPv6 work, so only ISC cells fail.
runxcmd now collects the errorcodes in $::xcmd_errorcode and assigns that to
$::RUNCMD_RC after the subrequest, so a command of the subrequest can neither
set nor clear the result. dhcp6_restart_needed restarts dhcpd6 only for a run
that serves an IPv6 network.
runxcmd_subrequest_errorcode.t and dhcp_isc_dhcp6_restart.t fail on the parent
commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
rinstall prints "Failed to run 'nodeset' against the node" while nodeset
succeeds and reports no error. xCAT::Utils::runxcmd returns $::RUNCMD_RC, and
xCAT::Utils::runcmd and the service helpers of every plugin inside the
subrequest assign to that global, so the status of the last command of the
subrequest becomes the status of the subrequest. makedhcp supplies that
command: the ISC branch restarts dhcpd6 whenever /etc/dhcp/dhcpd6.conf is
absent or foreign, which is every run of a cluster with no IPv6 network, and
the restart fails because dhcpd6 has no subnet to serve.
runxcmd_subrequest_errorcode.t holds the result of a subrequest to the
errorcode of its responses. dhcp_isc_dhcp6_restart.t holds the restart of
dhcpd6 to a run that serves an IPv6 network. The condition moves out of
dhcp.pm into xCAT::DHCP::Backend::ISC unchanged, so that a test can read it.
Against this tree the first test fails 3 of its 5 assertions and the second
fails 1 of its 4.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
ra_interface_is_served looked up the interface name literally. With
dhcpinterfaces=*, which Kea accepts, no interface was served and
makedhcp wrote no advertisement.
configure_router_advertisements returned when no IPv6 network was
left, and the Kea callers ran it only with a DHCPv6 subnet. radvd then
kept announcing the old prefix and default route.
The wildcard now serves every interface. radvd_config starts its output
with a marker line. When no IPv6 network remains and the file carries
that marker, makedhcp stops and disables radvd and removes the file.
radvd sends a router lifetime of zero when it stops. A radvd
configuration without the marker is left alone. Both Kea paths now
call configure_router_advertisements on every run.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
ra_interface_is_served looks up the interface name literally, so
dhcpinterfaces=* serves no interface and radvd gets no configuration.
When the last IPv6 network is removed, configure_router_advertisements
returns early and radvd keeps the old prefix and route. The Kea callers
do not call it at all when no DHCPv6 subnet remains.
These tests fail on the current tree. The other Kea tests that run
kea_process_request now stub the radvd step, so they do not read or
change the radvd configuration of the host.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
With mac.duid=canonical, addnode6 gave the shim to the host that
answers iPXE, so iPXE never loaded the node script. delnode6 listed
only the ipxe and genesis hosts, so makedhcp -d left <node>-firmware.
On Kea, an entry of a client that holds no address has no hostname.
After a change of netboot, no reservation of the new set matched it,
and makedhcp -d matched only the DUIDs of the current clients.
addnode6 now asks for the boot file of the client that mac.duid
selects, removes the hosts of clients the node no longer has, and
delnode6 also removes <node>-firmware. Each Kea DHCPv6 entry names its
node in user-context. upsert_reservations replaces the entries of a
node as a set, and makedhcp -d matches on that owner.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
With mac.duid=canonical the ISC host named after the node answers
iPXE, but it gets the shim, so iPXE never loads the node script.
makedhcp -d on ISC does not remove the <node>-firmware host.
After a change from netboot=ipxe to grub2, the Kea entry of iPXE holds
no hostname and no address, so neither the update nor makedhcp -d
removes it. The ISC host <node>-ipxe also stays.
These tests fail on the current tree.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
mypostscript assigned DHCP6DUID and did not export it, so configdhcpv6duid, which runs as a
child process, never saw mac.duid and wrote the firmware DUID-UUID. The script also rejected
ll, which makedhcp accepts and selects by default on ppc64le. It read the SMBIOS UUID before
the attribute, so a missing or nil UUID ended the script although a literal DUID needs none.
And it wrote no systemd-networkd configuration for a DUID that is not a DUID-UUID.
mypostscript now exports DHCP6DUID. The script reads the attribute first, builds the DUID-LL
from the first mac.mac address for ll and for an unset value on ppc64le, reads the UUID only
for firmware and canonical, and gives systemd-networkd the type of every DUID through
DUIDType and the rest through DUIDRawData.
postscript_dhcpv6_duid.bats fails without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
configdhcpv6duid writes a DHCPv6 client identifier that does not match the reservation in
four cases. mypostscript does not export DHCP6DUID, so the postscript, a child process,
never sees mac.duid and writes the firmware UUID. The postscript rejects ll, which makedhcp
accepts and which is the default on ppc64le. It exits on a missing or nil SMBIOS UUID before
it reads a literal DUID that needs none. And it writes no systemd-networkd configuration
for a DUID that is not a DUID-UUID, although DUIDType and DUIDRawData express every type.
These tests fail on the current tree for those four reasons. The test that held the old
NetworkManager-only behaviour for a DUID-LLT now expects the networkd file.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
_subiquity_netplan6 wrote dhcp4: false and a static address, and left accept-ra unset. A
router advertisement with the managed flag still starts DHCPv6 in systemd-networkd. The pool
address it gets has no PTR record, so xcatd refuses the completion callback and the node
boots the installer again.
The same sub filtered site.nameservers on a colon, so a resolver given as a host name was
dropped and the management node replaced it.
The netplan now carries dhcp6: false and accept-ra: false, and the resolvers come from
_ipv6_nameservers_for_node, which resolves a host name to its AAAA address as the kickstart
path already does. subiquity_ipv6_netplan.t fails without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The static netplan of an IPv6-only Subiquity node leaves accept-ra unset. A router
advertisement with the managed flag then starts DHCPv6 in systemd-networkd, the pool address
it gets has no PTR record, xcatd refuses the completion callback from it, and the node boots
the installer again.
The same netplan keeps only resolvers that contain a colon, so a site.nameservers entry given
as a host name with an AAAA record is dropped, and the node resolves through the management
node instead.
These assertions fail on the current tree: the rendered keys carry no dhcp6 or accept-ra key,
and the named resolver is replaced by the management node.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xcatconfig now puts configdhcpv6duid in the postscripts of xcatdefaults,
so a node made from a template inherits syslog,remoteshell,
configdhcpv6duid,syncfiles. Eight lsdef and mkdef checks still match
syslog,remoteshell,syncfiles. Four cases failed in xcat_pr_test on
559577a41: mkdef_template_cec_template_without_remainder,
mkdef_template_switch_template_without_attribute,
lsdef_template_switch_template and mkdef_node_with_a_node_template.
The checks now match the list that xcatconfig writes.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An IPv6-only diskless node needs its address in a NetworkManager keyfile, because the
booted system does not repeat the DHCPv6 exchange of the initial ramdisk. This branch
writes that keyfile inside the dhclient and ifcfg handoff of
xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot, and upstream commit
1c42a2c72 deletes the whole handoff. So the branch does not merge, and the keyfile
depends on ETHX and MACX, which getdevfrommac() and the deleted derivation supplied.
The deletion is the base now. xcat_boot_netif() names the provisioning NIC from ifname=,
from netdev=, or by matching the BOOTIF MAC against /sys/class/net/<dev>/address.
xcat_persist_ipv6_boot() reads the MAC of that interface from sysfs and calls
persist_ipv6_nm_connection(). The removal of ifcfg-$ETHX is dropped: the script writes no
ifcfg file any more, so there is no competing profile to remove.
Eight checks in xCAT-test/bats/ipv6_xcatroot_el_stateless.bats run the two functions
against a scratch sysfs tree. Three mutations of the rework each turn one check red. The
checks cannot run against the unreworked file, which holds neither function, so the test
and the change are one commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The OpenEmbedded Genesis image ships one NetworkManager configuration,
10-xcat-genesis.conf, and it sets ipv6.dhcp-duid=ll. The image therefore sends
the DUID-LL of the provisioning NIC on every netboot method. makedhcp reserves
the two DUID-UUID orders that EDK2 and iPXE send, and only a DUID-LL where
mac.duid says ll, so a node with the default selector gets no answer once
Genesis runs and a node with ll leaves the firmware and iPXE unanswered. Three
programs boot one node and each sends an identifier of its own.
dhcp6_client_duid_list in xCAT-server/lib/xcat/plugins/dhcp.pm returned the two
UUID orders alone. It now derives 00:03:00:01 and the MAC, which needs no value
the node reports first, and appends it as a third client. dhcp6_node_clients is
the one place the clients of a node are selected: it drops the iPXE order where
the method does not load iPXE and keeps the DUID-LL for every method, because
Genesis runs whatever loaded it. kea_node_reservations6, the ISC hosts and the
makedhcp -d match list all read that selection, so delnode6 removes the hosts
it writes. The first client still keeps the address and the hostname.
mac.duid=ll, a literal DUID and DHCPv4 are unchanged.
Seventeen assertions in dhcp_dhcpv6_duid.t fail without the appended client.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The OpenEmbedded Genesis image ships one NetworkManager configuration,
10-xcat-genesis.conf, and it sets ipv6.dhcp-duid=ll. The image therefore sends
the DUID-LL of the provisioning NIC. makedhcp reserves the two DUID-UUID orders
that EDK2 and iPXE send, or a DUID-LL when mac.duid asks for one, and the two
forms are exclusive. No test says which identities one node needs, so a
reservation set that answers the firmware and the loader and not the image
passes.
The new block renders the Kea DHCPv6 reservations of a netboot=ipxe node and
asserts the DUIDs, which client keeps the address and the hostname, and the boot
file URL of each. It asserts the same node on ISC DHCP and through
makedhcp -d, and that mac.duid=ll, a literal DUID and the DHCPv4 reservations
are unchanged.
Ten assertions fail on this commit: the DUID-LL is reserved nowhere.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
run_genesis in xCAT-test/bats/helpers/genesis_sandbox.bash compared the status of
"timeout 20 /bin/bash /run/script" with one exact number. GNU coreutils timeout reports
a child that a signal killed as 128+signal, so genesis_discovery_uuid.bats expects 143
for SIGTERM. The uutils coreutils of Ubuntu 26.04 reports the signal number alone, 15,
so the same outcome fails the assertion there.
run_genesis now accepts the expected status or, when that status is above 128, the
signal number alone. A caller that expects 0 keeps one accepted value, and an unrelated
failure is still a failure. The comment names the two conventions.
Evidence: a four-case bats file drives run_genesis with a controlled status. With the
change, 143 and 15 both pass against an expected 143, while status 1 against 143 and
status 15 against 0 still fail. Without the change only the 15 case flips to "Expected
exit 143, got 15"; the control and both discriminators are unchanged.
The five "= 143" comparisons in genesis_openembedded_runtime.bats stay as they are:
terminate_after reads its status from the bash wait builtin, which computes 128+signal
itself and does not call timeout.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xCAT-test/integration/dhcp_dhcpv6_duid.t runs makedhcp through kea_process_request,
which calls configure_router_advertisements on every IPv6 run
(xCAT-server/lib/xcat/plugins/dhcp.pm). The step did not localize
$xCAT_plugin::dhcp::radvdconffile, so it wrote the real /etc/radvd.conf, and it called
enableservice, checkservicestatus and restartservice on the radvd of the management
node. The test plans skip_all unless it runs as root, and "ip netns exec" changes only
the network namespace, so the mount namespace and the services are the host's.
makedhcp_step now points $radvdconffile at the scratch directory of the test and stubs
the three service calls, as xCAT-test/unit/dhcp_dhcpv6_duid.t already does. The DHCPv6
reservations the test measures are unchanged.
Evidence: configure_router_advertisements driven with these four lines writes the
scratch radvd.conf and reports nothing; without them it reports "Cannot write
/etc/radvd.conf, so the IPv6 networks announce no route" and the scratch file stays
absent. No other file in xCAT-test/integration reaches that sub.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
dhcp6_client_duid gained the "ll" choice, so the refusal of an invalid mac.duid now
reads "only firmware, canonical, ll, or a DUID of colon-separated hexadecimal octets
is supported" (xCAT-server/lib/xcat/plugins/dhcp.pm). Two assertions in
xCAT-test/integration/dhcp_dhcpv6_duid.t still held the text without "ll", one for the
Kea backend and one for ISC. Both compare the whole sentence, so both fail against the
current plugin.
The new invalid_duid_error helper calls dhcp6_client_duid and wraps its error in the
sentence that dhcp6_client_duids builds, so the expectation is read from the plugin
instead of written out a second time. The plugin loader moves to require_dhcp_plugin,
which both the helper and makedhcp_step call.
Evidence: against the current plugin the derived sentence matches what
dhcp6_client_duids returns and the old literal does not. A further change of the
wording, to "firmware, canonical, ll, duid-uuid, or ...", keeps the derived sentence
correct and leaves the literal wrong.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The Ubuntu genimage enters dracut mode only when the rootimg holds
/usr/share/dracut or /usr/lib/dracut (netboot/ubuntu/genimage:791). Seven
netboot package lists hold no dracut, so genimage writes the legacy /init.
That /init waits for an "inet addr" line from ifconfig (genimage:1339) and
cuts XCATSERVER at the first colon (genimage:1348). Both steps are IPv4-only,
so an IPv6-only diskless node never boots. Ubuntu 26.04 diskless is the row
this blocks.
Add dracut and dracut-network to the 24.04 ppc64el list, its ppc64le copy,
and the five 26.04 netboot lists. Both packages are published for noble
(universe, 060+5-1ubuntu3) and resolute (main, 110-11) on amd64, ppc64el and
riscv64. dracut-network pulls iproute2 on resolute and iputils-arping on
noble, so no other entry is needed.
The new xCAT-test/unit/ubuntu_netboot_dracut_pkglists.t reads the seven lists
plus the working 24.04 x86_64 reference and asserts both entries.
profile_customization.t now expects dracut in the 26.04 riscv64 list.
Removing dracut from compute.ubuntu26.04.pkglist fails only that list's
assertion; the reference stays green.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The Subiquity autoinstall of an IPv6-only node asked netplan for DHCPv6, and
the late-command wrote the same request into the installed system. A DHCPv6
client is identified by its DUID, which the installer generates in the
initramfs, so it matched no Kea reservation and the node took an address out
of the dynamic range. That address has no PTR record, because makedns writes
PTRs from the hosts table, and xcatd identifies a client over IPv6 only by the
name its address resolves to. post.xcat then fetched a mypostscript that
getpostscript could not build, and the install stopped.
subiquity_dhcp_keys and subiquity_target_dhcp_keys in Template.pm now render
the static address of the node, through a new _subiquity_netplan6, in the shape
xcatroot writes for a diskless IPv6 node. A new subiquity_install_match
replaces the literal name: "e*" of both templates: a static address on each of
three interfaces of one bridge is a broken network, so an IPv6-only node is
matched by its MAC. Each IPv4 return keeps its former string.
casper takes no static ip6=, so the debian.pm docs say where the reserved
address comes from instead.
subiquity_ipv6_netplan.t fails 15 of 30 without this change, and
subiquity_install_match.t has no subroutine to call.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The Subiquity autoinstall of an IPv6-only node asks netplan for DHCPv6, and
the installed system does too. A DHCPv6 client is identified by its DUID, so
the installer and systemd-networkd each send one that matches no Kea
reservation. Both take an address out of the dynamic range, which carries no
PTR record, and xcatd identifies a client over IPv6 only by the name its
address resolves to. The install reaches post.xcat, getpostscript cannot say
which node asked, and the node stops.
The autoinstall also matches the provisioning NIC by the glob name: "e*".
Three interfaces of one bridge match it.
The tests assert the rendered netplan of both stages, the match key, and the
file the late-command writes: one static address, from the node's own network
configuration, on the interface that carries the node's MAC.
xCAT-test/bats holds the late-command, because the template renders the keys
into a printf argument list and the shell decides which lines reach the file.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
site.nameservers holds one list for the whole cluster, and on a normal lab it
names IPv4 resolvers. _static_kickstart_network6 in Template.pm kept only the
entries that resolve to an IPv6 address, so it rendered no --nameserver at all
and the installed node had no /etc/resolv.conf. Measured on a riscv64
openEuler install. EL 10 takes the same path, and EL 8 and EL 9 now take it
too, so the number of nodes exposed grows.
_autoyast_network6 in the same file already answered this: it maps
'<xcatmaster>' through ipv6_server_for_node and falls back to the management
node when the cluster configures no IPv6 resolver. The chooser is now one sub,
_ipv6_nameservers_for_node, and both callers use it. The fallback is the
management node and not the gateway, because a gateway can be a router that
serves no DNS. A management node with no address on the network of the node
yields no resolver, rather than a guess.
template_ipv6_rendering.t asserts the rendered network line for all three
cases. Without the fallback the IPv4-resolver case fails while the configured
IPv6 resolver case and the no-address control keep passing, and
autoyast_ipv6_network.t goes red with it, which shows both callers read the
same chooser.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An IPv6-only EL 8 or EL 9 node presents a different DHCPv6 DUID at each boot
stage: the UEFI firmware, then iPXE, then anaconda. makedhcp reserves the
first two, so the installer takes an address from the dynamic range and every
step that reads the reserved address or its PTR record fails.
xCAT::SvrUtils::uses_static_ipv6_boot accepted the rh family only at major 10,
so Template.pm rendered "dhcp --noipv4 --ipv6=dhcp" for EL 8 and EL 9. The
floor is now 8, by operator decision of 2026-11-05.
pre.rhels8 was IPv4 only in two places. The install monitor opened an AF_INET
socket, so the node reported no status. The install server was cut out of its
URL at the first colon, which splits an IPv6 literal. Both forms come from
pre.rhels10. pre.openeuler includes pre.rhels8 whole, so this also fixes the
reported openEuler defect.
ipv6_pre_rhels8.bats and the EL 8 and EL 9 cases of template_ipv6_rendering.t
capture it. With AF_UNSPEC back to AF_INET the three IPv6 monitor cases fail
and the IPv4 one passes. Without the bracket branch the three IPv6 URL cases
fail and the four IPv4 ones pass. With the floor back at 10 the EL 8 and EL 9
rendering cases fail and the EL 10 ones pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
No package installs an x86_64 grub2 image. grub2-xcat ships powerpc-ieee1275, riscv64-efi and
aarch64-efi, and copycds publishes a grub2 image for riscv64 alone, so an x86_64 node set to
netboot=grub2 asks TFTP for a file that is not there.
The iPXE page told the reader to use netboot=grub2 on the Lenovo UEFI firmware that hangs on
iPXE v2.0.0. That page now records the limit with no x86_64 workaround.
The IPv6 page required Secure Boot off for every node. That is a grub2 constraint: ipxe-xcat
installs a Microsoft-signed shim, so an x86_64 node with netboot=ipxe boots with Secure Boot on.
The same page said nodeset writes the address on the kernel command line. That holds on EL 10,
on openEuler, on an Ubuntu diskless node and on SLES and openSUSE, each through a different
parameter, and not on EL 8, EL 9 or an Ubuntu diskful node. A table names the parameter and the
routine per family, and says that a family which keeps DHCPv6 needs the dynamic range.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xnba.pm started its script server at ${next-server} and replaced it only when the IPv6 lookup
answered. An IPv6 node for which this server has no facing IPv6 address therefore kept the
DHCPv4 variable, an IPv6 client resolved it to the empty string, every URL in the script lost
its host, and nodeset reported success. ipxe.pm runs the same code with SCRIPTS set to
xcat/ipxe, so netboot=ipxe took the same path.
NetworkUtils gains ipxe_script_server_for_node, which makes the decision and returns either the
server or a reason. No value serves such a node, so xnba.pm now stops with that reason instead
of writing a script that cannot work.
netboot_ipxe_method.t and secureboot_ipxe_node_shim.t replace the whole NetworkUtils module
through %INC, so the new sub is stubbed there as well; both carry IPv4 nodes, for which the real
sub answers the iPXE variable.
Restoring the old behaviour in the new sub -- keep ${next-server} when the lookup does not
answer -- fails eight of the sixteen assertions in ipxe_script_server_for_node.t and leaves the
IPv4, unknown-family and IPv6-with-an-address outcomes passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A node that sends its findme request over IPv6 is never discovered. Two
steps fail.
seqdiscovery.pm reads the arp(8) table to turn the client address into a MAC
and looks that MAC up in the mac table. arp(8) prints the IPv4 table only, so
the table holds no row for the client and the plugin logs "Could not find mac
of the <address>" and returns. aaadiscovery.pm, profilednodes.pm, blade.pm and
hpblade.pm carry the same parse. All five interpolate the address into a
regular expression as well, so a dot matches any character and 192.168.201.1
matches the row of 192.168.201.120.
nodediscover.pm then opens a TCP connection to the node to send "restart",
and NetworkUtils::send_tcp_msg does the same for its callers. Both build the
socket with IO::Socket::INET, which has no AF_INET6, so the node receives
nothing and Genesis exits on DISCOVERY_TIMEOUT after 36 attempts.
NetworkUtils gains mac_from_neighbour_table, which takes the text of a
neighbour table and the address and returns the MAC; neighbour_table_text,
which reads arp(8) for IPv4 and "ip -6 neigh show" for IPv6; and
mac_of_neighbour, which joins them. The addresses are compared after both
are normalized, so 2001:db8::2 and its full form are one address. The five
plugins call mac_of_neighbour. open_tcp_socket opens the callback through
IO::Socket::INET6 when it is installed and keeps IO::Socket::INET as the
fallback, the way credentials.pm already does; nodediscover.pm and
send_tcp_msg use it.
networkutils_neighbour_mac.t and networkutils_tcp_callback_family.t fail
without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Sequential discovery resolves the address a findme arrived from to a MAC and
looks that MAC up in the mac table. Five plugins carry the same arp(8) parse,
which reads the IPv4 table only and interpolates the address into a regular
expression. After the match xcatd opens a TCP connection back to the node
with IO::Socket::INET, which cannot reach an IPv6 address.
No test covers either step. networkutils_neighbour_mac.t drives the parse
against the text of an arp(8) table and of an ip(8) neighbour table, both
fixtures, so it measures the parse and not the test host's own cache.
networkutils_tcp_callback_family.t replaces both socket classes and asks
which one the callback uses.
Both files report that the subroutines do not exist on this commit, which is
why the fix commit follows.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xnba.pm starts its script server at ${next-server} and replaces it only when the IPv6 lookup
answers: "$script_server = $resolved if defined $resolved". An IPv6 node for which this server
has no facing IPv6 address therefore keeps the DHCPv4 variable. An IPv6 client resolves that to
the empty string, every URL in the script loses its host, and nodeset reports success. ipxe.pm
runs the same code with SCRIPTS set to xcat/ipxe, so netboot=ipxe takes the same path.
ipxe_script_server_for_node.t drives the three outcomes through Perl-level stubs of
node_address_family and my_ip_facing_family: an IPv4 node keeps the variable, an IPv6 node with a
facing address carries it bracketed, and an IPv6 node without one yields no server and an error
that names the node and the family. It also asserts the error does not offer ${next-server} as a
fallback, and that the two families are not given the same text.
The decision has no sub to call yet, so this file names the sub the next commit adds.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
dhcp6_bootfile_url_for_node in dhcp.pm returned nothing when the UEFI loader was not under the
tftpdir of the node, and reported nothing. The reservation was still written with its address and
its DUID, makedhcp exited 0, and the node reached a firmware timeout with no line anywhere naming
the file it had asked for. On an IPv6 cell that is the whole boot: there is no second method to
fall back to.
BootPolicy gains dhcp6_missing_loader_warning, which takes the tftpdir of the node and the loader
name and returns the sentence or nothing. dhcp6_bootfile_url_for_node reports it through the
callback, once per node per makedhcp, and then drops the boot file as before. Naming the node
matters because the path comes from noderes.tftpdir, which the reader cannot derive from the site
value.
The three assertions the previous commit added to dhcp_dhcpv6_duid.t now pass, and the nine in
dhcp_ipxe_readiness.t with them. Blanking the file check in the new sub fails five of those nine
and leaves the four controls passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
dhcp6_bootfile_url_for_node drops the DHCPv6 boot file when the UEFI loader is not under the
tftpdir of the node, and says nothing. makedhcp exits 0, the reservation is written with its
address and its DUID, and the node then sits at a firmware timeout with no line on the
management node that names the file it was looking for.
upstream_loader_warnings does not cover this. It reads the SITE TFTP directory, and it runs on
makedhcp -n and makedhcp -a only, so a node that carries its own noderes.tftpdir is never
examined and makedhcp <node> warns about nothing at all.
dhcp_dhcpv6_duid.t now asserts the warning reaches the caller for the node whose loader is
absent, exactly once, attributed to the node and naming the full path. The node in the same run
whose loader is present must not be reported. dhcp_ipxe_readiness.t asserts the decision itself
for a present loader, an absent one, a trailing slash on the directory, and the three inputs that
are not a missing file.
These assertions fail on this tree: the three in dhcp_dhcpv6_duid.t report nothing in the
collected warnings, while the assertion that the boot file is absent, and the control on the node
whose loader is present, both still pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An unknown client on an IPv6 provisioning network gets no network boot
script. mknb builds its list of networks from my_nets and my_hexnets, and
both skip inet6 on Linux, so nothing is written under xcat/ipxe/nets and
the client has nothing to fetch.
Where an address does reach a script it is written as
"xcatd=" . $address . ":$port". For 2001:db8:177::1 that is
xcatd=2001:db8:177::1:3001, which parses as an IPv6 literal with no port,
so Genesis contacts a different address and reports nothing. The same
concatenation builds the POWER HTTP URLs and the grub2 roots. xnba.pm and
destiny.pm already bracket an IPv6 address through
NetworkUtils::xcatd_cmdline_address and format_uri_host, so the node
files were correct and the net files were not.
NetworkUtils gains my_nets6, which returns the host's global IPv6
networks keyed the way my_nets keys its IPv4 ones, and
ipv6_network_address, which masks an address to its prefix. my_nets keeps
its IPv4-only behaviour: lsslp.pm and PPCdb.pm read its keys with
dotted-quad arithmetic, so an IPv6 key there would be a wrong answer
rather than a new one. my_hexnets keeps its own, because a hexnet is a
PXELINUX file name built from a hexadecimal IPv4 prefix and DHCPv6 has no
equivalent. mknb merges my_nets6 into the networks it writes nets/
scripts for, asks getipaddr for the IPv6 addresses of site.master as well,
and takes every xcatd= value and every HTTP authority from the two
formatting helpers.
mknb_xcatd_address.t and networkutils_my_nets6.t fail without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
mknb writes the network boot scripts of an unknown client from my_nets and
my_hexnets, both of which skip inet6 on Linux, and it builds every xcatd=
value by concatenation. No test covers either, so an IPv6 management node
gets no script, and an address written as xcatd=2001:db8:177::1:3001 reads
as a valid literal with no port.
mknb_xcatd_address.t stubbed the whole of xCAT::NetworkUtils, so the
formatting helpers were absent from the harness and could not be measured.
The three harnesses now load the real module and replace only the probes
that read the running host's interfaces. The new assertions cover the
nets/ scripts, the UEFI and elilo entries, the POWER URLs, the s390x
APPEND line and the grub2 roots for one IPv6 network, and
networkutils_my_nets6.t covers my_nets6 and the prefix masking.
16 of the mknb assertions fail on this commit, and the my_nets6 file does
not run at all for lack of the subroutine.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A netboot=ipxe node is two DHCPv6 clients. The firmware solicits first and takes the
Microsoft-signed shim over TFTP; the iPXE it chainloads solicits again with a DUID built from
the same vpd.uuid in RFC 4122 order and takes the boot script of the node over HTTP. Its sibling
case makedhcp_dhcpv6_boot_intent defines its node netboot=grub2, so no case read the pair, and a
cell could report green with every iPXE line of dhcp.pm broken.
makedhcp_dhcpv6_ipxe_boot_intent reads the rendered kea-dhcp6.conf. It counts the reservations
keyed on the two expected DUIDs, compares both entries byte for byte, asserts the two DUIDs
differ, and moves the address between the clients with mac.duid to say WHICH client gets WHICH
file. A grub2 arm and a return to iPXE are the discriminator: a case that cannot tell the two
methods apart only measures that a reservation exists.
The loader check is first. dhcp6_bootfile_url_for_node returns empty when the UEFI loader is not
under the tftpdir of the node and makedhcp still exits 0, so every later assertion would pass
vacuously on a management node with no ipxe-xcat.
Measured against the rendered reservations of this tree: reverting dhcp6_chainloads to return 0
takes the count from 2 to 1 and leaves the first reservation and the grub2 arm passing; deleting
the "if ($client eq 'ipxe')" arm of dhcp6_bootfile_url_for_node turns the second URL into the
TFTP shim and leaves nine of the eleven value assertions passing.
ipxe-xcat is packaged for x86_64 only, so a bundle must name this case for an x86_64 cell.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
mac.duid names the DHCPv6 client identifier that a node's reservations match.
A cluster that upgrades carries a mac table with no duid column, and nothing
recreates it, so the column has to arrive on an existing database.
xcatd adds it: at startup it walks every table in the schema and calls
updateschema, which compares the declared columns against the database and
issues the ALTER. Table->new does not do this, so the column arrives when
xcatd restarts and not when a plugin first opens the table.
The test builds a mac table with every column but duid, runs the schema
update, and reads a duid back. It also asserts the row the table already held
survives, and that a node attribute is mapped onto mac.duid so chdef and
lsdef reach it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Two shell routines decide whether an installed or booted node keeps its IPv6
address, and neither was driven by a test.
xcat_is_ipv6_boot in the EL stateless xcatroot answers for ip=dhcp6 and, for
a node given a static address, from the live interface. A dual-stack
interface must answer no, or an IPv4 node is given an IPv6 profile.
persist_ipv6_nm_connection copies the profile the initrd holds, or writes one
from the live address, and must refuse to write a profile with no address:
NetworkManager rejects such a file and leaves the interface unmanaged.
configure_install_nic_ipv6_keyfile renders the install NIC profile with
"nmcli --offline" during Anaconda's chrooted %post. A profile that leaves
IPv4 enabled makes the node wait for a DHCPv4 lease that never arrives, and a
temporary file left in system-connections is read as a second profile for the
same interface.
Both files drive the real routines with ip and nmcli stubbed, inside the
test's own scratch tree.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Two gaps in the ISC DHCPv6 path.
An IPv6 node on an ISC backend gets no resolver and no domain-search list.
addrangedetection keys %netcfgs on networks.net, which a conf may write with
no prefix length, while addnet6 names the subnet "<net>/<prefix>" from the
"ip -6 route" output. addnet6 read the domain, the nameservers and the
ddnsdomain under the long name alone, so all three were undef and the
subnet6 carried neither statement. dynamic_range_for in the same file already
fell back to the bare net, which is why the range was the only value that
survived.
And "makedhcp -d <node>" removed the DHCPv4 host alone. addnode6 creates the
DHCPv6 host as a separate omapi object on port 7912, and delnode never
touched it, so the reservation outlived the node and kept its address and its
boot file.
net_config_for does the lookup with the same fallback dynamic_range_for uses,
and addnet6 takes its values from it. isc_dhcp6_subnet_statements renders the
domain and resolver statements from that entry, so they can be read back.
delnode6 writes the removal over the open DHCPv6 session.
dhcp_isc_dhcpv6_subnet_and_delete.t captures both. Removing the fallback from
net_config_for fails its three lookup assertions and leaves the
dynamic_range_for assertion passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A node discovered by Genesis on an IPv6-only cluster gets no credentials and
reports no state. The credential callback never answers and the install state
never reaches xcatd, so discovery stops with nothing in the log that names an
address family.
The Genesis copies of the two awk helpers were never given the IPv6 branch
that the copies under xCAT/postscripts carry. allowcred.awk hardcoded
"/inet/tcp/300/0/0", so it ignored XCAT_CREDENTIAL_CALLBACK_PORT and opened a
listener that accepts no IPv6 connection. updateflag.awk built "/inet/" from
the raw argument, so a bracketed IPv6 literal reached gawk with its brackets
and resolved to nothing. Neither build script copies these files, so the two
copies are independent and the first never followed the second.
Both Genesis copies now carry the postscripts logic. updateflag.awk keeps
logger and writes no file: Genesis has no /var/log/xcat directory, rsyslog
sends everything to /var/log/xcat.genesis, and gawk is fatal when it cannot
open a redirect.
ipv6_genesis_awk_inet6.bats captures this. Four of its six cases fail on the
previous copies.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The Genesis ramdisk carries its own copies of allowcred.awk and
updateflag.awk, because nothing of xCAT is installed in it. No test drove
those copies, and they had drifted from the copies under xCAT/postscripts
that the IPv6 work changed.
The new bats file runs both Genesis copies against a listener on the
loopback address of the family under test. Against the current copies four
of its six cases fail: the credential listener accepts no connection on the
port it was given, and the state report cannot resolve a bracketed IPv6
literal. The two that pass are the IPv4 and plain-IPv6 state reports, which
show the method reaches a working listener.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A diskful Ubuntu 24.04 install reaches Subiquity, runs curtin, and dies in
exclusive_open on the root partition with curtin.util.NotExclusiveError. The
console names apt-get as a user of the partition.
pre.ubuntu.subiquity starts rsyslogd inside the live installer to forward the
install log to the management node. In the 24.04 installer that process holds
11.9G of a 16G node while its message queue is empty: impstats reports
"main Q: size=0 enqueued=7 maxqsize=6" beside "maxrss=11951868", so no rsyslog
setting bounds it. rsyslogd runs in the cgroup of
snap.subiquity.subiquity-server.service, so the kernel OOM killer stops the
installer. systemd starts a second subiquity-server, and that server runs
curtin partitioning while the first server's curtin is still installing the
kernel into the target, so clear_holders cannot open the root partition.
xcat_start_installer_rsyslog starts the forwarder with systemd-run, in a
transient unit with MemoryMax=128M and MemorySwapMax=0. The kernel then kills
the forwarder alone. Where systemd-run is absent the install forwards no
syslog, because the install is worth more than its remote log.
ubuntu_subiquity_installer_syslog.bats reads the command line the routine asks
for. Dropping the two memory properties fails the limit assertions and leaves
the launcher and the no-fallback assertions green.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 2db399cd6c07e98494353c292990c150a9adce15)
makedns writes the address record of the name server itself into every zone file
it creates, and it wrote one record. The address came from
_preferred_ip_address, which returns the first IPv4 address, so a server with an
A and an AAAA in /etc/hosts published the A alone.
An IPv6-only compute node resolves that name to reach the server. With no AAAA in
the zone it gets no usable address, and behind a NAT64 translator it gets the
synthesis of the IPv4 address, which does not reach the server.
_server_ip_addresses returns every valid address, IPv4 first, and the zone writer
loops over it, taking the record type from _dns_record_type as before.
_preferred_ip_address is unchanged and still names one address for the error path.
xCAT-test/unit/ddns_server_dual_stack.t captures this. With the routine returning
the single preferred address, its first assertion fails and the other six pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An IPv6-only node netboots, installs and reaches the end of its installer, then
fails in any step that resolves a name. The node console reports "no search or
nameservers found in /run/net-*.conf /run/net6-*.conf". On Ubuntu this stops
subiquity in its postinstall package step, seconds after curtin finishes and
before any xCAT late command, so the node never boots from disk.
Three writers were involved, and none of them produced a resolver:
kea_subnet6_intent wrote dns-servers only when a configured nameserver resolved
to an IPv6 address. site.nameservers holds IPv4 addresses and the IPv6 network
row's nameservers column is normally empty, so the option was absent.
addnet6 wrote "nameservers <list>;", which is not an ISC dhcpd statement. RFC
3646 names the option dhcp6.name-servers. dhcpd refuses the whole file on an
unknown statement, so the only networks that could reach that line were the ones
that broke the configuration.
radvd_config emitted no RDNSS, so a node that configures itself from the router
advertisement had no second source.
dhcp6_resolvers_for_network is now the one chooser for all three. It keeps a
configured IPv6 nameserver, and otherwise falls back to the management node's
own address on that network, which is what <xcatmaster> names for IPv4. It
returns undef when the management node has no address on the network, because a
resolver that never answers costs the node a DNS timeout instead of a lease.
Measured with dig against an IPv6 cluster management node: a cluster name and an
external name both resolve over IPv6, so the fallback address answers.
xCAT-test/unit/dhcp6_resolver_fallback.t covers the chooser and all three
writers. Against the previous behaviour 12 of its 17 checks fail, and the 5 that
pass are the controls: a configured IPv6 nameserver is kept, and a management
node with no address on the network yields no resolver, no statement and no
RDNSS.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
nodehm.serialport holds a port number, so the plugin that writes the kernel
command line also names the device. anaconda.pm, debian.pm, sles.pm, destiny.pm
and mknb.pm each chose between hvc for POWER and ttyS for everything else. An
aarch64 platform presents a PL011 serial port, which Linux names ttyAMA, so an
aarch64 node was told console=ttyS0 and wrote its console to a device that is
not there. A provisioning failure on such a node leaves no console record.
Three of those sites named ttyS with no architecture test at all, so a ppc64le
node lost its console the same way in mksysclone.
The device is now chosen in one place, xCAT::ConsolePolicy, which maps the
architecture to hvc, ttysclp, ttyAMA or ttyS and builds the console arguments
from a port and an optional speed. The ten call sites call it.
_genesis_uses_power_console is removed; destiny.pm calls the module.
console_policy.t covers every architecture and the empty-port case.
anaconda_console_device.t drives mknetboot and reads the arguments out of the
command line the plugin wrote: it fails on the unfixed tree with ttyS0,115200
where ttyAMA0,115200 is expected, and the ppc64le and x86_64 cases pass either
way, so a change that renamed every device would not satisfy it.
An aarch64 platform with a 16550 instead of a PL011 is not covered, as a POWER
machine without a hypervisor console is not: the map takes one device per
architecture, which is what the two existing entries already assumed.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 1b984211212a12cd56603bdfb6fab6cecf197314)
nodehm.serialport holds a port number, so the plugin that writes the kernel
command line also names the device. anaconda.pm chooses between hvc and ttyS,
and an aarch64 platform presents its serial port as pl011, which Linux names
ttyAMA. So an aarch64 node is given console=ttyS0 and writes its console to a
device that does not exist.
The test drives mknetboot for aarch64, ppc64le and x86_64 and reads the console
arguments out of the command line the plugin wrote. The aarch64 case fails with
'ttyS0,115200' where 'ttyAMA0,115200' is expected; the other two pass, so a
change that renamed every console device would not satisfy this test.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 42b80b63497022a7d9e19b169ef011d259233fa7)