2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-04 20:17:55 +00:00

test(genesis): cover offline repository gaps

This commit is contained in:
Vinícius Ferrão
2026-08-24 23:47:00 -03:00
parent 2c5351683d
commit ecce32a3d6
2 changed files with 67 additions and 1 deletions
@@ -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();
+28
View File
@@ -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 =