From e82af69cafd71da3bd1965d15a2b9b5d8a55f75f Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Mon, 14 Sep 2026 08:35:54 -0300 Subject: [PATCH] test(xcat-core): a missing fixture in two POWER install tests stops the whole suite debian_install_prescript.t and ubuntu_subiquity_storage.t called BAIL_OUT at eight places where an extraction or a fixture was not what they expected. prove stops every remaining file on a bail-out, so one changed script hides the results of every test that would have run after it. die is just as loud and costs only its own file. Three comments also carried the incident rather than the constraint. The prescript test header named a build number, a cell, a case and the ssh error the node produced nine times; the boot-file test repeated the nodeset message and the media table below it. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/debian_install_boot_files.t | 17 +++++++---------- xCAT-test/unit/debian_install_prescript.t | 15 ++++----------- xCAT-test/unit/ubuntu_subiquity_storage.t | 17 ++++++++--------- 3 files changed, 19 insertions(+), 30 deletions(-) diff --git a/xCAT-test/unit/debian_install_boot_files.t b/xCAT-test/unit/debian_install_boot_files.t index 3bcbcfd31..d866c36b2 100644 --- a/xCAT-test/unit/debian_install_boot_files.t +++ b/xCAT-test/unit/debian_install_boot_files.t @@ -7,10 +7,9 @@ use File::Temp qw(tempdir); use FindBin; use Test::More; -# The installer kernel and initrd sit in a different place on every Ubuntu media layout: -# netboot trees name them after the Debian architecture, live images keep them under -# casper, and a hardware-enablement kernel ships beside the release one. Build each layout -# on disk and ask the resolver, rather than reading the table that describes them. +# The installer kernel and initrd sit in a different place on every Ubuntu media layout. +# Build each layout on disk and ask the resolver, rather than read the table that +# describes them. use lib "$FindBin::Bin/../../perl-xCAT"; use lib "$FindBin::Bin/../../xCAT-server/lib/perl"; @@ -103,10 +102,9 @@ is( 'riscv64 does not accept the kernel name the other live images use', ); -# The Ubuntu ppc64el live-server ISO carries no netboot tree at all. 22.04 and 24.04 ship -# casper/hwe-vmlinux + casper/hwe-initrd beside casper/vmlinux + casper/initrd; 26.04 ships -# the release pair only. Without these entries nodeset stops the diskful install with -# "The network boot initrd.gz is not found in /install/netboot". +# The Ubuntu ppc64el live-server ISO carries no netboot tree. 22.04 and 24.04 ship the +# hardware-enablement pair under casper beside the release pair; 26.04 ships the release +# pair only. is( resolved('ppc64le', 'ppc64el', media('casper/vmlinux', 'casper/initrd')), 'casper/vmlinux|casper/initrd', @@ -127,8 +125,7 @@ is( 'a POWER netboot tree still wins over a live image on the same media', ); -# mkinstall refused POWER media that carried no install/netboot/initrd.gz, whatever -# install_boot_files could resolve. One routine answers the question now. +# mkinstall asks this routine, so it accepts every media install_boot_files resolves. can_ok('xCAT_plugin::debian', 'install_media_is_bootable'); is( xCAT_plugin::debian::install_media_is_bootable('ppc64le', 'ppc64el', diff --git a/xCAT-test/unit/debian_install_prescript.t b/xCAT-test/unit/debian_install_prescript.t index 9edfde213..db20da711 100644 --- a/xCAT-test/unit/debian_install_prescript.t +++ b/xCAT-test/unit/debian_install_prescript.t @@ -10,16 +10,9 @@ use Test::More; # early-commands append to /autoinstall.yaml. pre.ubuntu.ppc64 writes a partman recipe # for the debian-installer, which is not YAML at all. # -# mkinstall chose the subiquity script, then overwrote that choice for every ppc64 -# node. A ppc64el 24.04 install therefore appended a partman recipe to its -# autoinstall.yaml, Subiquity failed on the malformed document, the error-commands -# tarred /var/log/installer and the node rebooted into the installer again -- nine -# times in build #121 of xcat-core-devel-ubuntu-cd, cell ubuntu-24-ppc64le-devel, -# case reg_linux_diskfull_installation_flat. The node answered ping from the live -# installer the whole time, so the case failed on -# "root@xcat25-cn: Permission denied (publickey,password)". -# -# The ppc64 script belongs to the debian-installer path only. +# mkinstall chose the subiquity script, then overwrote that choice for every ppc64 node, +# so a ppc64el Subiquity install appended a partman recipe to its autoinstall.yaml. The +# ppc64 script belongs to the debian-installer path only. use lib "$FindBin::Bin/../../perl-xCAT"; use lib "$FindBin::Bin/../../xCAT-server/lib/perl"; @@ -28,7 +21,7 @@ plan skip_all => 'debian.pm not found' unless -r $plugin; eval { require $plugin; 1 } or plan skip_all => "could not load debian.pm: $@"; can_ok('xCAT_plugin::debian', 'install_prescript') - or BAIL_OUT('mkinstall still chooses the pre-install script inline, so nothing can drive it'); + or die('mkinstall still chooses the pre-install script inline, so nothing can drive it'); sub chosen { my ($platform, $arch, $subiquity) = @_; diff --git a/xCAT-test/unit/ubuntu_subiquity_storage.t b/xCAT-test/unit/ubuntu_subiquity_storage.t index a41f1ac4a..7403d41cb 100644 --- a/xCAT-test/unit/ubuntu_subiquity_storage.t +++ b/xCAT-test/unit/ubuntu_subiquity_storage.t @@ -31,12 +31,12 @@ is( system("bash -n $pre_path 2>/dev/null"), 0, # redirected into a scratch tree. Both substitutions are asserted: if either stops # matching, this bails out rather than silently covering nothing or writing to /tmp. my ($storage_block) = $script =~ /(^if \[ -d \/sys\/firmware\/efi \]; then\n.*?\n^fi$)/ms; -BAIL_OUT('the firmware branch that writes the partition file no longer matches') +die('the firmware branch that writes the partition file no longer matches') unless $storage_block; -BAIL_OUT('the firmware test the shadow below answers is gone') +die('the firmware test the shadow below answers is gone') unless $storage_block =~ /\[ -d \/sys\/firmware\/efi \]/; -BAIL_OUT('the block no longer asks uname for the machine architecture') +die('the block no longer asks uname for the machine architecture') unless $storage_block =~ /uname -m/; my $sandbox = File::Temp::tempdir( CLEANUP => 1 ); @@ -46,9 +46,9 @@ my $partfile = File::Spec->catfile( $sandbox, 'partitionfile' ); # escapes the sandbox. my $branches = () = $storage_block =~ /^\s*cat <\/tmp\/partitionfile$/mg; my $rewrites = ( $storage_block =~ s{/tmp/partitionfile}{$partfile}g ); -BAIL_OUT("the block writes the partition file in $branches places and $rewrites were rewritten") +die("the block writes the partition file in $branches places and $rewrites were rewritten") unless $branches >= 2 && $rewrites == $branches; -BAIL_OUT('a partition-file path escaped the sandbox') +die('a partition-file path escaped the sandbox') if $storage_block =~ m{/tmp/partitionfile}; my %YAML_FOR; @@ -66,8 +66,7 @@ sub partition_config_for { INSTALL_DISK=/dev/sdz logger() { :; } uname() { builtin echo $machine; } -# `[` is shadowed only for the firmware probe; every other test runs unmodified, -# so the architecture branch is taken by the block's own comparison. +# Only the firmware probe is answered here; every other test falls through to the builtin. [() { case "\$1 \$2" in "-d /sys/firmware/efi") return @{[ $firmware eq 'uefi' ? 0 : 1 ]} ;; @@ -80,9 +79,9 @@ SHELL unlink $partfile; system( 'bash', $script ) == 0 - or BAIL_OUT("the extracted partitioning block failed to run for $firmware"); + or die("the extracted partitioning block failed to run for $firmware"); open( my $out_fh, '<', $partfile ) - or BAIL_OUT("the partitioning block wrote no file for $firmware: $!"); + or die("the partitioning block wrote no file for $firmware: $!"); my $yaml = do { local $/; <$out_fh> }; close($out_fh); $YAML_FOR{$firmware} = $yaml;