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

test(netboot): cover the NetworkManager defaults of EL10 images

An EL10 image must turn off the automatic DHCP profiles. An EL9 image
must keep the NetworkManager defaults, and an image without
NetworkManager must get no NetworkManager configuration.
This commit is contained in:
Vinícius Ferrão
2026-10-30 16:52:02 -03:00
parent 9da20e00cd
commit 3e514bc6ee
+15
View File
@@ -69,4 +69,19 @@ for my $os (qw(rhels10.1 rhels9.6)) {
ok(!-e "$bare/etc/sysconfig" && !-e "$bare/etc/NetworkManager", "a $os image without either directory gets no profile");
}
for my $case (['rhels10.1', 1], ['rocky10.2', 1], ['rhels9.6', 0]) {
my ($os, $disabled) = @$case;
my $root = image('etc/NetworkManager/conf.d');
imgutils::disable_auto_profiles($root, $os);
my $conf = "$root/etc/NetworkManager/conf.d/xcat.conf";
if ($disabled) {
is(-f $conf ? read_text($conf) : '', "[main]\nno-auto-default=*\n", "a $os image turns off the automatic DHCP profiles");
} else {
ok(!-e $conf, "a $os image keeps the NetworkManager defaults");
}
}
my $without = image('etc');
imgutils::disable_auto_profiles($without, 'rhels10.1');
ok(!-e "$without/etc/NetworkManager", 'an image without NetworkManager gets no NetworkManager configuration');
done_testing();