From 4d5fc2b1b64d358c5915023a547eac954f9f024d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Mon, 26 Oct 2026 18:00:28 -0300 Subject: [PATCH] test(netboot): support copied profile payload fixtures --- xCAT-test/native/debian_genimage_profile_assets.t | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/xCAT-test/native/debian_genimage_profile_assets.t b/xCAT-test/native/debian_genimage_profile_assets.t index a54728df04..30326fa183 100644 --- a/xCAT-test/native/debian_genimage_profile_assets.t +++ b/xCAT-test/native/debian_genimage_profile_assets.t @@ -5,17 +5,23 @@ use FindBin; use lib "$FindBin::Bin/../lib"; use File::Path qw(make_path); use Test::More; +use XCAT::Test::File qw(repo_path); use XCAT::Test::ImageSandbox; +use XCAT::Test::Process qw(run_command); plan skip_all => 'Linux namespaces are required' unless $^O eq 'linux'; die 'Run image tests as an unprivileged user' unless $>; +my $payload = shift @ARGV; +my $source = $payload // repo_path('xCAT-server/share/xcat/netboot/debian'); + sub standalone_image { my $box = XCAT::Test::ImageSandbox->new(); make_path("$box->{root}/work/share/xcat/netboot"); - my ($rc, $output, $error) = $box->run('cp', '-R', '--no-preserve=mode,ownership', - '/repo/xCAT-server/share/xcat/netboot/debian', '/work/share/xcat/netboot/'); - die "copy Debian scripts: $output $error" if $rc; + my @copy = ('-R', '--no-preserve=mode,ownership'); + push @copy, '-L' unless defined $payload; + my ($rc, $output) = run_command('cp', @copy, $source, "$box->{root}/work/share/xcat/netboot/"); + die "copy Debian scripts: $output" if $rc; return $box; }