From ecce32a3d6007a9e1fc4e241040b90f434890d67 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, 24 Aug 2026 23:47:00 -0300 Subject: [PATCH] test(genesis): cover offline repository gaps --- .../unit/genesis_openembedded_activation.t | 40 ++++++++++++++++++- xCAT-test/unit/mknb_exported_genesis.t | 28 +++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/xCAT-test/unit/genesis_openembedded_activation.t b/xCAT-test/unit/genesis_openembedded_activation.t index 552563fb1..820a8567e 100644 --- a/xCAT-test/unit/genesis_openembedded_activation.t +++ b/xCAT-test/unit/genesis_openembedded_activation.t @@ -128,20 +128,58 @@ like( qr/reposync.*--repofrompath=xcat-dep-common,https:\/\/xcat\.org\/.*\/xcat-dep\/common.*--repoid=xcat-dep-common.*--download-metadata/s, 'the offline mirror command defines the common repository itself', ); +like( + $offline_guide, + qr{repodata/repomd\.xml\.asc}s, + 'the offline mirror includes the repository metadata signature', +); +like( + $offline_guide, + qr{repodata/repomd\.xml\.key}s, + 'the offline mirror includes its signing key', +); like( $offline_guide, qr{baseurl=file://.*xcat-dep/common}s, - 'the offline guide points the packaged repository file at the mirror', + 'the offline guide points a repository file at the mirror', ); like( $offline_guide, qr/dnf makecache.*--enablerepo=xcat-dep-common/s, 'the offline guide verifies the mirrored common repository', ); +unlike( + $offline_guide, + qr/install .*xCAT-release.*local xcat-core/is, + 'the offline guide does not assume xCAT-release is in the core tarball', +); unlike( $offline_guide, qr/Run .*mklocalrepo\.sh.*mirrored directory/is, 'the offline guide does not depend on files reposync cannot download', ); +my $yum_guide = read_file( + 'docs/source/guides/install-guides/yum/configure_xcat.rst' +); +like( + $yum_guide, + qr/start-after: BEGIN_configure_xcat_local_repo_xcat-dep_DNF/, + 'the DNF guide includes the DNF common repository steps', +); + +my $zypper_guide = read_file( + 'docs/source/guides/install-guides/zypper/configure_xcat.rst' +); +like( + $zypper_guide, + qr/start-after: BEGIN_configure_xcat_local_repo_xcat-dep_ZYPPER/, + 'the zypper guide includes its own common repository steps', +); +unlike( + $zypper_guide, + qr/start-after: BEGIN_configure_xcat_local_repo_xcat-dep_DNF/, + 'the zypper guide does not include DNF-only setup', +); + done_testing(); diff --git a/xCAT-test/unit/mknb_exported_genesis.t b/xCAT-test/unit/mknb_exported_genesis.t index 7160541f7..46f32e40e 100644 --- a/xCAT-test/unit/mknb_exported_genesis.t +++ b/xCAT-test/unit/mknb_exported_genesis.t @@ -397,6 +397,34 @@ like($ppc64le_config, qr/genesis\.kernel\.ppc64le/, like($ppc64le_config, qr/genesis\.fs\.ppc64le\.gz/, 'POWER boot configuration uses the exact ppc64le initramfs name'); +remove_tree($openembedded_process_export); +write_file( + "$xCAT::TableUtils::tftpdir/xcat/genesis.kernel.ppc64", + 'canonical big-endian ppc64 kernel', +); +write_file( + "$xCAT::TableUtils::tftpdir/xcat/genesis.exact-arch.ppc64", + export_manifest('ppc64'), +); +@responses = (); +xCAT_plugin::mknb::process_request( + { arg => ['ppc64le'] }, + sub { push(@responses, @_); }, +); +ok( + grep( + { ref($_) eq 'HASH' && $_->{error} + && $_->{error} =~ /canonical ppc64 image/ } + @responses + ), + 'the legacy ppc64le fallback cannot replace a canonical ppc64 image', +); +is( + read_file("$xCAT::TableUtils::tftpdir/xcat/genesis.kernel.ppc64"), + 'canonical big-endian ppc64 kernel', + 'a refused ppc64le fallback leaves the canonical ppc64 kernel intact', +); + my $selection_root = "$tmpdir/selection-root"; my $legacy_x86 = "$selection_root/share/xcat/netboot/genesis/x86_64"; my $openembedded_x86 =