From 81e08e711bf39b31a4ee1c6543fdf8cfdd7f6fd5 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 5 Nov 2026 16:51:35 -0300 Subject: [PATCH] test(xcat-core): the DUID integration test rewrites the radvd configuration of the host 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> --- xCAT-test/integration/dhcp_dhcpv6_duid.t | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xCAT-test/integration/dhcp_dhcpv6_duid.t b/xCAT-test/integration/dhcp_dhcpv6_duid.t index 7d87369981..c6094e644c 100644 --- a/xCAT-test/integration/dhcp_dhcpv6_duid.t +++ b/xCAT-test/integration/dhcp_dhcpv6_duid.t @@ -426,7 +426,17 @@ sub makedhcp_step { require_dhcp_plugin(); my ( @errors, @warnings ); - no warnings 'once'; + # kea_process_request calls configure_router_advertisements on every IPv6 run, and + # "ip netns exec" shares the mount namespace of the host. Without the next four lines the + # step rewrites /etc/radvd.conf of the management node and restarts its radvd. + my ($scratch) = ( $ENV{XCATCFG} // '' ) =~ /\ASQLite:(.+)\z/; + die "The makedhcp step needs the scratch directory of the test\n" unless $scratch && -d $scratch; + + no warnings qw(once redefine); + local $xCAT_plugin::dhcp::radvdconffile = "$scratch/radvd.conf"; + local *xCAT::Utils::enableservice = sub { return 0; }; + local *xCAT::Utils::checkservicestatus = sub { return 0; }; + local *xCAT::Utils::restartservice = sub { return 0; }; local $xCAT_plugin::dhcp::callback = sub { my ($resp) = @_; push @errors, @{ $resp->{error} || [] };