From 47efd8bd3409e439239ebda2364b79ed4c3ebc04 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Tue, 27 Oct 2026 06:29:12 -0300 Subject: [PATCH] test(xcat-core): the dual-stack DHCPv6 case measured nothing makedhcp_dhcpv6_dual_stack_boot_server defined its network and went straight to makedhcp . A reservation only reaches a subnet that kea-dhcp6.conf already carries, so makedhcp skipped the node with "Unable to find a Kea DHCPv6 subnet", exited 0, and the case asserted an empty bootfile-url against the expected one. The run reported the case as failing for the wrong reason, and an assertion on the exit status alone would have passed. The case now runs makedhcp -n after makehosts, as makedhcp_dhcpv6_boot_intent does, and asserts two things the earlier version could not tell apart: that the subnet is in the configuration, and that the node has exactly one reservation. A skip now fails on the reservation count rather than on the URL. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/autotest/testcase/makedhcp/cases0 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index 6751dcba25..ce5fdd4e8a 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -321,10 +321,24 @@ cmd:mkdef -t node ci-ipv6-ds groups=all mgt=kvm netboot=grub2 ip=2001:db8:177::2 check:rc==0 cmd:makehosts ci-ipv6-ds check:rc==0 +# REGENERATE THE SERVER CONFIG. makedhcp only writes a reservation into a subnet that is +# already in kea-dhcp6.conf, so without this the node has no subnet, makedhcp SKIPS it with a +# warning and still exits 0 -- and an assertion on the exit status alone then passes while +# nothing was measured. +cmd:makedhcp -n +check:rc==0 +# The subnet must be there, or the next assertions cannot tell a skipped node from a wrong URL. +cmd:python3 -c 'import json;d=json.load(open("/etc/kea/kea-dhcp6.conf"));print(" ".join(s["subnet"] for s in d["Dhcp6"]["subnet6"]))' +check:rc==0 +check:output=~2001:db8:177::/64 # makedhcp MUST SUCCEED. It resolved the tftpserver as IPv6, got no answer, and reported an error # with errorcode 1, so the whole command exited 1 for a node that boots over IPv4. cmd:makedhcp ci-ipv6-ds check:rc==0 +# The node MUST get a reservation. A skip leaves none and says so only in a warning. +cmd:python3 -c 'import json;d=json.load(open("/etc/kea/kea-dhcp6.conf"));print(sum(1 for s in d["Dhcp6"]["subnet6"] for r in s.get("reservations",[]) if r.get("hostname")=="ci-ipv6-ds"))' +check:rc==0 +check:output==1 cmd:kea-dhcp6 -t /etc/kea/kea-dhcp6.conf check:rc==0 # The boot URL survives, and its authority is the address of this management node that faces the