mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-21 16:39:30 +00:00
e82af69caf
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>
56 lines
2.4 KiB
Perl
56 lines
2.4 KiB
Perl
#!/usr/bin/env perl
|
|
use strict;
|
|
use warnings;
|
|
|
|
use FindBin;
|
|
use Test::More;
|
|
|
|
# Ubuntu has two installers and two pre-install scripts that are not interchangeable.
|
|
# pre.ubuntu.subiquity writes a curtin "storage:" document that the autoinstall
|
|
# 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,
|
|
# 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";
|
|
my $plugin = "$FindBin::Bin/../../xCAT-server/lib/xcat/plugins/debian.pm";
|
|
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 die('mkinstall still chooses the pre-install script inline, so nothing can drive it');
|
|
|
|
sub chosen {
|
|
my ($platform, $arch, $subiquity) = @_;
|
|
my $path = xCAT_plugin::debian::install_prescript($platform, $arch, $subiquity);
|
|
$path =~ s{.*/}{};
|
|
return $path;
|
|
}
|
|
|
|
# --- subiquity: the arch never changes the script -------------------------
|
|
is(chosen('ubuntu', 'x86_64', 1), 'pre.ubuntu.subiquity',
|
|
'an x86_64 subiquity install gets the subiquity pre-install script');
|
|
is(chosen('ubuntu', 'ppc64el', 1), 'pre.ubuntu.subiquity',
|
|
'a ppc64el subiquity install gets the subiquity pre-install script, not the partman one');
|
|
is(chosen('ubuntu', 'ppc64le', 1), 'pre.ubuntu.subiquity',
|
|
'the ppc64le spelling reaches the same script');
|
|
is(chosen('ubuntu', 'ppc64', 1), 'pre.ubuntu.subiquity',
|
|
'so does the bare ppc64 spelling');
|
|
|
|
# --- debian-installer: ppc64 keeps its own script -------------------------
|
|
is(chosen('ubuntu', 'ppc64el', 0), 'pre.ubuntu.ppc64',
|
|
'a ppc64el debian-installer install keeps the partman pre-install script');
|
|
is(chosen('ubuntu', 'ppc64', 0), 'pre.ubuntu.ppc64',
|
|
'and so does the bare ppc64 spelling');
|
|
is(chosen('ubuntu', 'x86_64', 0), 'pre.ubuntu',
|
|
'an x86_64 debian-installer install gets the plain script');
|
|
|
|
# --- the override is Ubuntu only -----------------------------------------
|
|
is(chosen('debian', 'ppc64el', 0), 'pre.debian',
|
|
'Debian on POWER has no ppc64 pre-install script to select');
|
|
|
|
done_testing();
|