From 2b150830c97f155e997b017d88f3f3cddf648049 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Fri, 11 Sep 2026 17:15:47 -0300 Subject: [PATCH] test(xcat-core): the Ubuntu ppc64el netboot image has no dig genimage stops with "Failed to find usr/bin/dig in /install/netboot/ubuntu24.04.4/ppc64el/compute/rootimg" and returns 2, so packimage writes no initrd.gz and nodeset reports "Did you run genimage before running packimg?". The diskless compute node never boots. xCAT-server/share/xcat/netboot/ubuntu ships a package list for ppc64el on 20.04 and on 26.04 only. imgutils::get_profile_def_filename finds no ppc64el list for 22.04 or 24.04 and falls back to compute.pkglist, which installs no dig. mkinitrd copies usr/bin/dig into the initrd and find_rootimg_file calls xdie when the file is absent. The test reads the four ppc64el package lists the pipeline provisions and asserts each one installs dig, a kernel and nfs-common. It fails on 22.04 and 24.04 and passes on 20.04 and 26.04. Evidence: reg_linux_diskless_installation_flat on ubuntu-24-ppc64le-devel in xcat-core-devel-ubuntu-cd build 120, xcattest.log.20260911175800 on xcat25-mn. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/ubuntu_ppc64el_pkglists.t | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 xCAT-test/unit/ubuntu_ppc64el_pkglists.t diff --git a/xCAT-test/unit/ubuntu_ppc64el_pkglists.t b/xCAT-test/unit/ubuntu_ppc64el_pkglists.t new file mode 100644 index 000000000..af36e606b --- /dev/null +++ b/xCAT-test/unit/ubuntu_ppc64el_pkglists.t @@ -0,0 +1,46 @@ +#!/usr/bin/env perl +use strict; +use warnings; + +use FindBin; +use Test::More; + +# genimage builds the netboot initrd for ppc64el with mkinitrd, not dracut, and mkinitrd +# copies usr/bin/dig out of the rootimg. A release with no ppc64el package list falls back +# to compute.pkglist, which installs no dig, and genimage stops with +# "Failed to find usr/bin/dig". The package that holds dig changed name in 22.04. + +use lib "$FindBin::Bin/../lib"; +use XCAT::Test::File qw(repo_path); + +my $netboot = 'xCAT-server/share/xcat/netboot/ubuntu'; + +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(20.04 22.04 24.04 26.04)) { + my $list = packages("$netboot/compute.ubuntu$release.ppc64el.pkglist"); + ok($list, "$release has a ppc64el netboot package list"); + + SKIP: { + skip "no $release ppc64el package list to inspect", 4 unless $list; + + ok(scalar(grep { $_ eq 'dnsutils' || $_ eq 'bind9-dnsutils' } @{$list}), + "the $release ppc64el image installs the dig that mkinitrd copies"); + ok(scalar(grep { $_ eq 'linux-image-generic' } @{$list}), + "the $release ppc64el image installs a kernel"); + ok(scalar(grep { $_ eq 'nfs-common' } @{$list}), + "the $release ppc64el image can mount its root over NFS"); + is_deeply(packages("$netboot/compute.ubuntu$release.ppc64le.pkglist"), $list, + "the $release ppc64le list matches the ppc64el list"); + } +} + +done_testing();