From d198efde019c8898c616b6a79b98d85f6465366d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Fri, 30 Oct 2026 12:33:41 -0300 Subject: [PATCH] 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. --- xCAT-test/native/install_profile_riscv64.t | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xCAT-test/native/install_profile_riscv64.t b/xCAT-test/native/install_profile_riscv64.t index 2fe46f52ca..3703c9c460 100644 --- a/xCAT-test/native/install_profile_riscv64.t +++ b/xCAT-test/native/install_profile_riscv64.t @@ -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")); }