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/native/ubuntu_genimage_debootstrap_arch.t
T
Vinícius Ferrão 5013f85774 test(ubuntu): check debootstrap architecture arguments
Run genimage and inspect the arguments passed to debootstrap instead of evaluating an extracted assignment. Keep the existing ppc64le pass-through explicit.
2026-10-12 13:58:45 -03:00

34 lines
1.2 KiB
Perl

#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use Test::More;
use XCAT::Test::UbuntuImage;
plan skip_all => 'Linux filesystem namespaces are required' unless $^O eq 'linux';
for my $case (
['x86_64', 'amd64'], ['x86', 'i386'], ['ppc64el', 'ppc64el'],
['ppc64le', 'ppc64le', 'ppc64le is currently passed through unchanged'],
['s390x', 's390x'], ['riscv64', 'riscv64'],
) {
my ($arch, $debian_arch, $name) = @$case;
$name ||= $arch;
subtest $name => sub {
my $image = XCAT::Test::UbuntuImage->new();
my ($status, $output, $args) = $image->bootstrap(
arch => $arch,
pkgdir => '/work/packages,https://mirror.example.invalid/ubuntu noble main');
is($status, 256, 'genimage reports the injected debootstrap failure') or diag($output);
is_deeply($args, ['--verbose', '--arch', $debian_arch, 'noble',
'/work/image/rootimg', 'https://mirror.example.invalid/ubuntu'],
'debootstrap receives the image architecture and configured source') or diag($output);
like($output, qr/Can not create bootstraps for rootimage/,
'the failure reaches the package-source diagnostic');
};
}
done_testing();