2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-24 03:12:18 +00:00

test(install): run riscv64 %post --nochroot blocks outside the chroot

The riscv64 profile test runs every rendered %post block as if it ran in
the installed system. Anaconda runs a --nochroot block in the installer,
with the installed system at /mnt/sysimage, so give such a block that
view.
This commit is contained in:
Vinícius Ferrão
2026-10-30 12:33:41 -03:00
parent 21984aade8
commit d198efde01
+7 -3
View File
@@ -189,9 +189,13 @@ for my $rendered (@rendered_profiles) {
my ($interpreter) = $post->[0] =~ /--interpreter=(\S+)/;
$interpreter //= '/bin/sh';
write_text("$root/post.sh", $post->[1]);
my ($rc, $log) = sandbox_run($root, {
env => {XCAT_EFI_LOG => '/fixture/efi.log'},
}, 'timeout', '30', $interpreter, '/fixture/post.sh');
my %options = (env => {XCAT_EFI_LOG => '/fixture/efi.log'});
# anaconda runs a --nochroot block in the installer, with the installed system at /mnt/sysimage
if ($post->[0] =~ /(?:^|\s)--nochroot(?:\s|$)/) {
$options{writable} = {map { ("$root/$_->[0]" => "/mnt/sysimage/$_->[1]") }
['boot', 'boot'], ['etc', 'etc'], ['log', 'var/log']};
}
my ($rc, $log) = sandbox_run($root, \%options, 'timeout', '30', $interpreter, '/fixture/post.sh');
is($rc, 0, 'post block ' . ++$index . ' completes')
or diag($log, read_text("$root/log/xcat/xcat.log"));
}