2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-10 19:46:24 +00:00

test(xCAT-test): cover the riscv64 Ubuntu package lists

Pin that both releases carry a riscv64 list, that it holds what the x86_64 list
holds, and that it keeps the kernel and the NFS client a diskless node needs.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
This commit is contained in:
Vinícius Ferrão
2026-09-04 12:17:25 -03:00
parent 7d161b822b
commit fc73cd91f1
+46
View File
@@ -0,0 +1,46 @@
#!/usr/bin/env perl
use strict;
use warnings;
use File::Spec;
use FindBin;
use Test::More;
# A diskless image needs a kernel and the tools its boot scripts call. Without a package
# list for the architecture, genimage debootstraps whatever the generic list holds and the
# image cannot boot. Compare the riscv64 lists with the x86_64 ones they follow.
use lib "$FindBin::Bin/../lib";
use XCAT::Test::File qw(repo_path);
sub packages {
my ($path) = @_;
my $full = repo_path($path);
return unless -r $full;
open(my $fh, '<', $full) or die "cannot read $full: $!";
my @packages = grep { length && !/^#/ } map { my $l = $_; chomp $l; $l =~ s/\s+//g; $l } <$fh>;
close($fh);
return \@packages;
}
foreach my $release (qw(24.04 26.04)) {
my $netboot = "xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu$release.riscv64.pkglist";
my $x86 = "xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu$release.x86_64.pkglist";
my $riscv_packages = packages($netboot);
ok($riscv_packages, "$release has a riscv64 netboot package list");
is_deeply($riscv_packages, packages($x86),
"the $release riscv64 image installs what the x86_64 image installs");
ok(scalar(grep { $_ eq 'linux-image-generic' } @{$riscv_packages}),
"the $release riscv64 image installs a kernel");
ok(scalar(grep { $_ eq 'nfs-common' } @{$riscv_packages}),
"the $release riscv64 image can mount its root over NFS");
}
my $install = packages(
'xCAT-server/share/xcat/install/ubuntu/compute.ubuntu26.04.riscv64.pkglist');
ok($install, '26.04 has a riscv64 install package list');
is_deeply($install,
packages('xCAT-server/share/xcat/install/ubuntu/compute.ubuntu26.04.x86_64.pkglist'),
'the 26.04 riscv64 install takes what the x86_64 install takes');
done_testing();