2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-19 17:02:15 +00:00

test(template): the IPv6 networking section carries an element the schema refuses

AutoYaST validated the generated profile and reported "Extra element networking
in interleave", then told the operator no profile could be retrieved. The
element is dhcp_resolv, which the schema of Leap 15.6 does not accept.

The test asserts the section has no dhcp_resolv and keeps dhcp_hostname, which
the schema does accept.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-10-28 13:28:53 -03:00
parent 9f5d9be84f
commit ebefdec9f8
+8 -1
View File
@@ -12,7 +12,7 @@ no warnings 'once';
use File::Spec;
use FindBin;
use Test::More tests => 11;
use Test::More tests => 13;
my $repo_root = File::Spec->catdir($FindBin::Bin, '..', '..');
$ENV{XCATROOT} = File::Spec->catdir($repo_root, 'xCAT-server');
@@ -47,6 +47,13 @@ unlike($xml, qr{<netmask>(?!-)}, 'no IPv4 netmask is emitted for the interface')
like($xml, qr{<gateway>\Q2001:db8:1::fe\E</gateway>}, 'the default route carries the IPv6 gateway');
like($xml, qr{<nameserver>\Q2001:db8:1::fe\E</nameserver>}, 'and the resolver is the IPv6 one');
# dhcp_resolv says whether DHCP may overwrite resolv.conf. The AutoYaST schema of Leap 15.6
# does not accept it, and one invalid element makes YaST reject the whole profile: it reports
# "Extra element networking in interleave" and then that no profile could be retrieved. The
# section configures the node statically, so there is no DHCP to keep away from resolv.conf.
unlike($xml, qr{<dhcp_resolv}, 'no dhcp_resolv, which the Leap 15.6 schema refuses');
like($xml, qr{<dhcp_hostname}, 'dhcp_hostname stays, which the schema does accept');
# A node with no gateway still installs; it simply gets no default route.
my $nogw = xCAT::Template::_autoyast_network6('cn6nogw');
ok(defined($nogw), 'a node with no gateway still gets a section');