From dd1d517d80791b6d2b5bd1aaaefa1271c65f4696 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Mon, 9 Nov 2026 07:55:24 -0300 Subject: [PATCH] test(xcat-core): sequential discovery over IPv6 finds no nic in the deploy network On xcat88-mn the findme from the OpenEmbedded Genesis reached xcatd over IPv6 and seqdiscovery matched seqdisc1, then zzzdiscovery failed with "No nic found in deploy network for seqdisc1". NetworkManager installs a DHCPv6 lease as a /128, so Genesis reports the boot nic as 2001:db8:188::1004/128. hosttag_for_ipv6_nic masks both addresses with that prefix length, and a /128 never matches the address of the node. The test asserts that a /128 lease inside an xCAT IPv6 network of the node is the node itself. It fails today. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/discovery_hosttag_ipv6_nic.t | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/xCAT-test/unit/discovery_hosttag_ipv6_nic.t b/xCAT-test/unit/discovery_hosttag_ipv6_nic.t index ff8eb7707b..e6397d4708 100644 --- a/xCAT-test/unit/discovery_hosttag_ipv6_nic.t +++ b/xCAT-test/unit/discovery_hosttag_ipv6_nic.t @@ -7,7 +7,7 @@ # $localnic and stops process_request returning "No nic found in deploy network". use strict; use warnings; -use Test::More tests => 6; +use Test::More tests => 9; use FindBin; use lib "$FindBin::Bin/../../perl-xCAT"; @@ -38,3 +38,20 @@ my %taken = ( seqdisc1 => 1 ); is( xCAT::DiscoveryUtils::hosttag_for_ipv6_nic( 'seqdisc1', '2001:db8:188::21', 'eth2', '2001:db8:188::32', 64, \%taken ), 'seqdisc1-eth2', 'a second nic on that network takes an interface-qualified name' ); + +# NetworkManager installs a DHCPv6 lease as a /128 and takes the on-link route from the router +# advertisement, so Genesis reports the boot nic as 2001:db8:188::1004/128. A /128 names one +# address and no network, so the network comes from the xCAT networks table. +my @networks = ( [ '2001:db8:188::', 64 ] ); +my %fresh; +is( xCAT::DiscoveryUtils::hosttag_for_ipv6_nic( + 'seqdisc1', '2001:db8:188::21', 'eth0', '2001:db8:188::1004', 128, \%fresh, \@networks ), + 'seqdisc1', 'a /128 DHCPv6 lease in the network of the node is the node itself' ); + +is( xCAT::DiscoveryUtils::hosttag_for_ipv6_nic( + 'seqdisc1', '2001:db8:188::21', 'eth0', '2001:db8:99::1004', 128, \%fresh, \@networks ), + undef, 'a /128 lease on another network is not the node' ); + +is( xCAT::DiscoveryUtils::hosttag_for_ipv6_nic( + 'seqdisc1', '2001:db8:188::21', 'eth0', '2001:db8:188::1004', 128, \%fresh ), + undef, 'with no networks to compare a /128 against, it is not the node' );