2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-21 15:18:19 +00:00

test(nodeset): cover the SLES statelite ramdisk boot files

A SLES statelite ramdisk node built with dracut must boot
initrd-stateless.gz, and nodeset must copy that file to TFTP. A statelite
ramdisk node without dracut and a statelite NFS node must still boot
initrd-statelite.gz.
This commit is contained in:
Vinícius Ferrão
2026-10-13 15:29:24 -03:00
parent 810e3bf66d
commit 6c665f8ce1
@@ -23,6 +23,7 @@ require xCAT::Table;
require xCAT::SvrUtils;
require xCAT::DBobjUtils;
require(repo_path('xCAT-server/lib/xcat/plugins/debian.pm'));
require(repo_path('xCAT-server/lib/xcat/plugins/sles.pm'));
xCAT::Table->new('site', -create => 1)->setAttribs({ key => $_->[0] }, { value => $_->[1] })
for ([ installdir => "$fixture/install" ], [ tftpdir => "$fixture/tftpboot" ]);
@@ -87,4 +88,14 @@ sub nodeset {
unlike($boot->{kcmdline} // '', qr{imgurl=}, 'Ubuntu: a statelite NFS node downloads no archive');
}
for my $case ([ ramdisk => 1, 'initrd-stateless.gz' ], [ ramdisk => 0, 'initrd-statelite.gz' ], [ nfs => 1, 'initrd-statelite.gz' ]) {
my ($rootfstype, $dracut, $initrd) = @$case;
my $label = "SLES $rootfstype" . ($dracut ? ' with dracut' : ' without dracut');
my ($node, $name, $dir) = image(plugin => 'sles', os => 'sle15.6', rootfstype => $rootfstype, dracut => $dracut);
my ($boot, $errors) = nodeset(sles => $node);
is_deeply($errors, [], "$label: nodeset reports no error");
like($boot->{initrd} // '', qr{/\Q$initrd\E$}, "$label: the node boots $initrd");
is(content("$fixture/tftpboot/xcat/osimage/$name/$initrd"), "$initrd of $name\n", "$label: $initrd is copied to TFTP");
}
done_testing();