From 57dddd4efd11e85abafcece29c5034f13fa88171 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Fri, 11 Sep 2026 16:25:47 -0300 Subject: [PATCH] test(xcat-core): follow the per-architecture Genesis scripts dependency xcat_riscv64_genesis_dependency.t pins the deb dependency on the legacy Genesis scripts as a single xcat-genesis-scripts-amd64 entry qualified [!riscv64]. That entry gives a ppc64el management node the amd64 scripts package, which pulls the amd64 Genesis base with it, and this branch replaces it with one entry per architecture. The test now asserts that every xcat-genesis-scripts entry names an architecture that has a legacy Genesis, and that the ppc64el reduction asks for xcat-genesis-scripts-ppc64el. The riscv64 assertions are unchanged: no entry applies there. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- .../unit/xcat_riscv64_genesis_dependency.t | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/xCAT-test/unit/xcat_riscv64_genesis_dependency.t b/xCAT-test/unit/xcat_riscv64_genesis_dependency.t index 4a1930c4a..67bd0c774 100644 --- a/xCAT-test/unit/xcat_riscv64_genesis_dependency.t +++ b/xCAT-test/unit/xcat_riscv64_genesis_dependency.t @@ -12,8 +12,8 @@ use Test::More; # # The deb side named xcat-genesis-scripts-amd64 in a plain Depends, and that package is # Architecture: all, so apt installed the x86 Genesis scripts (and, through them, the x86 Genesis -# base) on a riscv64 management node. Restrict the dependency to the architectures that have a -# legacy Genesis, and leave amd64 and ppc64el untouched. +# base) on every management node that is not amd64. Name one scripts package per architecture that +# has a legacy Genesis, so riscv64 gets none and ppc64el gets its own. my $repo_root = File::Spec->rel2abs( File::Spec->catdir( $FindBin::Bin, '..', '..' ) @@ -37,10 +37,12 @@ foreach my $pkg ( [ 'xCAT', 'xcat' ], [ 'xCATsn', 'xcatsn' ] ) { my ($recommends) = $control =~ /^Recommends:\s*(.*)$/m; ok( defined $recommends, "$name debian/control has a Recommends line" ); - my ($entry) = grep { /xcat-genesis-scripts/ } split( /\s*,\s*/, $depends ); - ok( defined $entry, "$name depends on a legacy Genesis scripts package" ); - like( $entry, qr/\[!riscv64\]/, - "$name excludes riscv64 from the legacy Genesis scripts dependency" ); + my @entries = grep { /xcat-genesis-scripts/ } split( /\s*,\s*/, $depends ); + ok( scalar(@entries), "$name depends on a legacy Genesis scripts package" ); + my @unqualified = grep { !/\[(?:amd64|ppc64el)\]\s*$/ } @entries; + is_deeply( \@unqualified, [], + "$name asks for the legacy Genesis scripts of an architecture that has them" ) + or diag( "unqualified: @unqualified" ); SKIP: { skip( "Dpkg::Deps is not available", 7 ) unless $have_dpkg_deps; @@ -56,8 +58,8 @@ foreach my $pkg ( [ 'xCAT', 'xcat' ], [ 'xCATsn', 'xcatsn' ] ) { "$name on riscv64 does not pull the legacy Genesis scripts" ); like( $reduced{amd64}, qr/xcat-genesis-scripts-amd64/, "$name on amd64 still pulls them" ); - like( $reduced{ppc64el}, qr/xcat-genesis-scripts-amd64/, - "$name on ppc64el still pulls them" ); + like( $reduced{ppc64el}, qr/xcat-genesis-scripts-ppc64el/, + "$name on ppc64el pulls the ppc64el ones" ); # The restriction must not take anything else with it: every other dependency of the # amd64 package must survive on riscv64.