mirror of
https://github.com/xcat2/xcat-dep.git
synced 2026-09-30 14:55:17 +00:00
test(xcat-dep): a bail-out in one test file stops the whole suite
Five files under t/ call BAIL_OUT at eleven places: a missing command, a manifest section that is not there, an extraction that stopped matching, a run_bounded that never returned. prove stops every remaining file on a bail-out, not only the file that called it, so one of these hides the results of every test that would have run after it. die is just as loud and costs only its own file. The header of genesis_native_deb.t also retold how an EL image reached an Ubuntu node. The fallback and its effect are one sentence. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -94,7 +94,7 @@ is($bad->{ec}, 3, 'a failing command keeps its exit status');
|
||||
my $hang = drive(name => 'hang', cmd => 'exec sleep 600 >/dev/null 2>&1',
|
||||
timeout => 4, sample => 2, deadline => 90);
|
||||
ok($hang->{finished}, 'a hanging command does NOT hang the caller')
|
||||
or BAIL_OUT('run_bounded never returned: the bound is missing, so a hung build has no failure');
|
||||
or die('run_bounded never returned: the bound is missing, so a hung build has no failure');
|
||||
is($hang->{timed_out}, 1, 'the hang is reported as a timeout');
|
||||
is($hang->{ec}, 124, 'the timeout exit status is 124, as timeout(1) uses');
|
||||
cmp_ok($hang->{wall}, '<', 60, 'it fails soon after the budget, not later');
|
||||
|
||||
@@ -42,7 +42,7 @@ if (command_exists('tar')) {
|
||||
}
|
||||
if (@missing_requirements) {
|
||||
my $message = 'requires ' . join(', ', @missing_requirements);
|
||||
BAIL_OUT($message) if $ENV{XCAT_GENESIS_CI};
|
||||
die($message) if $ENV{XCAT_GENESIS_CI};
|
||||
plan skip_all => $message;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
# suite publishes three images per suite and lets apt pick the newest, which is the image of
|
||||
# another release.
|
||||
#
|
||||
# sbuild-all.pl also keeps an rpm->deb fallback: the EL image converted with rpm2cpio. That is how
|
||||
# an Ubuntu management node came to install an image built from an EL kernel, and it is removed.
|
||||
# sbuild-all.pl also kept an rpm->deb fallback, the EL image converted with rpm2cpio, which gave
|
||||
# an Ubuntu node an image built from an EL kernel. It is removed.
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
||||
@@ -51,9 +51,9 @@ my @APT_SUITES = qw(focal jammy noble resolute);
|
||||
test_activation_helper();
|
||||
|
||||
if ($ENV{XCAT_GENESIS_CI}) {
|
||||
BAIL_OUT('CI requires Linux root') unless $^O eq 'linux' && $> == 0;
|
||||
die('CI requires Linux root') unless $^O eq 'linux' && $> == 0;
|
||||
for my $command (qw(apt-ftparchive bash createrepo_c dpkg-deb gpg rpm rpmbuild)) {
|
||||
BAIL_OUT("CI requires $command") unless command_exists($command);
|
||||
die("CI requires $command") unless command_exists($command);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ sub run_apt_consumer {
|
||||
sub write_apt_manifest {
|
||||
my ($path, $mutate) = @_;
|
||||
my %shipped = read_manifest("$repo_root/debs-manifest.conf");
|
||||
BAIL_OUT('debs-manifest.conf has no [shared] section')
|
||||
die('debs-manifest.conf has no [shared] section')
|
||||
unless exists $shipped{shared};
|
||||
my %shared = %{ $shipped{shared} };
|
||||
$mutate->(\%shared) if $mutate;
|
||||
@@ -1083,7 +1083,7 @@ sub test_activation_helper {
|
||||
unlike($activation, qr/XCAT_GENESIS_ROOT/,
|
||||
'the root package helper has no environment-controlled execution root');
|
||||
$activation =~ s/\ngenesis_activation_main "\$\@"\s*\z/\n/
|
||||
or BAIL_OUT('the activation helper has no reusable main boundary');
|
||||
or die('the activation helper has no reusable main boundary');
|
||||
|
||||
my $driver = "$tmp/activation-driver";
|
||||
my $log = "$tmp/activation.log";
|
||||
|
||||
@@ -49,7 +49,7 @@ my $epoch = 1787293573;
|
||||
|
||||
if ($ENV{XCAT_GENESIS_CI}) {
|
||||
for my $command (qw(git dpkg-deb rpm rpmbuild tar)) {
|
||||
BAIL_OUT("CI requires $command") unless command_exists($command);
|
||||
die("CI requires $command") unless command_exists($command);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -736,7 +736,7 @@ STUB
|
||||
};
|
||||
|
||||
my ($scan) = $src =~ /\n( my %u = \(\$arch => 1\);\n if \(\$mode eq 'publish'\) \{\n.*?\n \}\n)/ms;
|
||||
BAIL_OUT('could not extract the staged-arch scan from sbuild-all.pl') unless defined $scan;
|
||||
die('could not extract the staged-arch scan from sbuild-all.pl') unless defined $scan;
|
||||
|
||||
my $staging = tempdir( CLEANUP => 1 );
|
||||
make_path("$staging/noble/$_") for qw(amd64 ppc64el riscv64 s390x);
|
||||
@@ -770,7 +770,7 @@ STUB
|
||||
};
|
||||
|
||||
my ($sub) = $src =~ /\n(sub genesis_in_manifest \{\n.*?\n\})\n/ms;
|
||||
BAIL_OUT('could not extract genesis_in_manifest from sbuild-all.pl') unless defined $sub;
|
||||
die('could not extract genesis_in_manifest from sbuild-all.pl') unless defined $sub;
|
||||
|
||||
our %MANIFEST = (
|
||||
'noble-amd64' => { 'xcat-genesis-base' => '2.*', 'ipmitool-xcat' => '1.8.18-4' },
|
||||
@@ -804,10 +804,10 @@ STUB
|
||||
};
|
||||
|
||||
my ($sub) = $src =~ /\n(sub ensure_foreign_arch_support \{\n.*?\n\})\n/ms;
|
||||
BAIL_OUT('could not extract ensure_foreign_arch_support from sbuild-all.pl') unless defined $sub;
|
||||
die('could not extract ensure_foreign_arch_support from sbuild-all.pl') unless defined $sub;
|
||||
|
||||
my ($map) = $src =~ /\n(my %BINFMT_HANDLER = \(.*?\);)\n/ms;
|
||||
BAIL_OUT('could not extract the binfmt handler map') unless defined $map;
|
||||
die('could not extract the binfmt handler map') unless defined $map;
|
||||
|
||||
my $fake = tempdir( CLEANUP => 1 );
|
||||
( my $driver = "$map\n$sub" ) =~ s{/proc/sys/fs/binfmt_misc}{$fake}g;
|
||||
|
||||
Reference in New Issue
Block a user