2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-25 20:02:19 +00:00
Files
xcat-core/xCAT-test/unit/netboot_options_ipv6.t
T
Daniel Hilst 82b00278bc fix(ipv6): the ported IPv6 tests measure a design that is not on master
The ported branch predates the Kea control-socket detection, the iPXE netboot
method and the isValidIp validator that master now carries, so seven unit
files failed: six on the isValidIPAddress name the branch added beside
master's isValidIp, and netboot_options_ipv6.t on the netboot method list.

Every caller now uses isValidIp. netboot_options_ipv6.t no longer names a
method list: it reads the netboot value each node template ships, and asserts
that lookupNetboot offers it for that architecture and that a plugin of that
name exists. The Kea renderer loses the control_socket_name assertions, which
expected a socket basename; control_socket_path reads the real runtime
directory out of the Kea build report instead. getipaddr keeps one address per
host, so the cache assertion now states the invariant master implements: an
IPv6 cache entry is never served to an OnlyV4 caller.

kea_node_reservations resolves the next server on first use, because
next_server_for_node reports an unresolvable tftpserver and an IPv6-only node
leaves the loop before it needs one. kea_sync_node_client_classes skips an
IPv6-only node before the mac column is read, so a *NOIP* alias on such a node
no longer produces a DHCPv4 DROP class, while the same alias on an IPv4 node
still does.

network_utils_ip_validation.t is renamed networkutils_ipv6_helpers.t, one
character away from master's networkutils_ip_validation.t being too close to
tell apart.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 15:27:18 -03:00

43 lines
1.7 KiB
Perl

#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../perl-xCAT", "$FindBin::Bin/../lib";
use Test::More;
use File::Slurper qw(read_text);
use XCAT::Test::File qw(repo_path);
use xCAT::Utils;
# An IPv6-only node still has to be given a netboot method it can use, so the
# method the node templates ship must be one lookupNetboot offers for that
# architecture, and a plugin of that name must exist to serve it. The method
# names themselves are not asserted: the shipped set changes per release and a
# literal list here would pass after the plugin it names is removed.
my @cases = (
[ 'x86_64.stanza', 'x86_64', 'alma10.1' ],
[ 'x86_64kvmguest.stanza', 'x86_64', 'alma10.1' ],
[ 'ppc64le-ipmi.stanza', 'ppc64le', 'alma10.1' ],
[ 'ppc64lekvmguest.stanza', 'ppc64le', 'alma10.1' ],
);
foreach my $case (@cases) {
my ( $stanza, $osarch, $osvers ) = @{$case};
my $text = read_text( repo_path("xCAT/templates/objects/node/$stanza") );
my ($shipped) = $text =~ /^\s*netboot=(\S+)\s*$/m;
ok( $shipped, "$stanza ships a netboot method" ) or next;
my %offered = map { $_ => 1 } split( /,/, xCAT::Utils->lookupNetboot( $osvers, $osarch, 'Linux' ) );
ok( $offered{$shipped}, "lookupNetboot offers '$shipped' for $osarch" );
ok( -f repo_path("xCAT-server/lib/xcat/plugins/$shipped.pm"),
"a netboot plugin serves '$shipped'" );
}
# lookupNetboot answers per architecture, and an architecture it does not know
# must answer nothing rather than fall back to another architecture's method.
ok( !xCAT::Utils->lookupNetboot( 'alma10.1', 's390x', 'Linux' ),
'an unknown architecture is offered no netboot method' );
done_testing();