2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-21 23:28:19 +00:00
Files
xcat-core/xCAT-test/unit/aarch64_packaging.t
T
Timothy Middelkoop d95b190461 aarch64: management-node support (EL10 netboot pkglist + spec Requires)
xCAT builds and runs on aarch64, but two pieces were missing for an EL10
aarch64 management node:

- No compute.rhels10.aarch64.{pkglist,exlist,postinstall}, so genimage
  fell back to the generic EL8/9-shaped compute.pkglist (dhclient,
  busybox-anaconda), which does not resolve on EL10 aarch64. Add the rh
  files (same content as the other EL10 architectures) with alma/rocky
  aliases, following the x86_64/ppc64le layout.
- xCAT.spec had Requires blocks for x86, ppc and riscv64 but none for
  aarch64, so an aarch64 install pulled no ipmitool-xcat. Add the block,
  mirroring riscv64: ipmitool-xcat plus ipxe-xcat (an aarch64 management
  node can serve x86 nodes); the x86-only PXE stack stays excluded.

Tests: extend el10_netboot_dhcp_client.t to the aarch64 lists and add
aarch64_packaging.t for the spec block and the netboot file layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Timothy Middelkoop <tmiddelkoop@internet2.edu>
2026-10-06 10:51:37 -05:00

51 lines
2.2 KiB
Perl

#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use Test::More;
use XCAT::Test::File qw(repo_path slurp_repo_file);
# aarch64 management node: xCAT.spec must pull the BMC tool and the iPXE loader
# (an aarch64 management node can serve x86 nodes), but not the x86-only PXE
# stack. aarch64 nodes boot through UEFI and grub2.
my $xcat = slurp_repo_file('xCAT/xCAT.spec');
my ($xcat_aa) = $xcat =~ /^%ifarch aarch64\n((?:#[^\n]*\n|Requires:[^\n]*\n)+)%endif$/m;
ok( defined $xcat_aa, 'xCAT.spec has an aarch64 Requires block' );
like( $xcat_aa || '', qr/^Requires: ipmitool-xcat >= 1\.8\.18-4$/m, 'xCAT.spec requires ipmitool-xcat on aarch64' );
like( $xcat_aa || '', qr/^Requires: ipxe-xcat >= 2\.0\.0-1$/m, 'xCAT.spec requires ipxe-xcat on aarch64 for mixed clusters' );
unlike( $xcat_aa || '', qr/xnba-undi|syslinux-xcat|elilo-xcat/, 'xCAT.spec does not require the x86 PXE loaders on aarch64' );
SKIP: {
my $rpmspec = qx(command -v rpmspec 2>/dev/null);
chomp($rpmspec);
skip 'rpmspec is not installed', 2 unless $rpmspec && -x $rpmspec;
my $spec = repo_path('xCAT/xCAT.spec');
open( my $requires_fh, '-|',
$rpmspec, '-q', '--target', 'aarch64', '--requires', $spec )
or BAIL_OUT("unable to run $rpmspec: $!");
my $requires = do { local $/; <$requires_fh> };
close($requires_fh)
or BAIL_OUT("rpmspec failed for $spec with status " . ($? >> 8));
like( $requires, qr/^ipmitool-xcat >= 1\.8\.18-4$/m, 'an aarch64 build requires ipmitool-xcat' );
unlike( $requires, qr/^(?:xnba-undi|syslinux-xcat)\b/m, 'an aarch64 build requires no x86-only PXE loader' );
}
# The EL10 aarch64 netboot files follow the other EL10 architectures: one rh
# file per kind, aliased by each rebuild distribution.
foreach my $kind (qw(pkglist exlist postinstall)) {
my $rh = "xCAT-server/share/xcat/netboot/rh/compute.rhels10.aarch64.$kind";
ok( -f repo_path($rh) && !-l repo_path($rh), "$rh is a regular file" );
foreach my $distro (qw(alma rocky)) {
my $alias = "xCAT-server/share/xcat/netboot/$distro/compute.${distro}10.aarch64.$kind";
is( readlink( repo_path($alias) ), "../rh/compute.rhels10.aarch64.$kind", "$alias uses the EL10 file" );
}
}
done_testing();