mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-10-15 08:12:02 +00:00
test(genesis): cover final review gaps
This commit is contained in:
@@ -30,6 +30,18 @@ is(
|
||||
'ppc64le keeps the legacy POWER fallback when no exact image exists',
|
||||
);
|
||||
|
||||
open(my $marker_fh, '>', "$tftp/xcat/genesis.exact-arch.ppc64")
|
||||
or die "create exact POWER marker: $!";
|
||||
close($marker_fh) or die "close exact POWER marker: $!";
|
||||
|
||||
is(
|
||||
_genesis_boot_arch($tftp, 'ppc64le'),
|
||||
'ppc64le',
|
||||
'ppc64le does not fall back to a canonical big-endian ppc64 image',
|
||||
);
|
||||
unlink("$tftp/xcat/genesis.exact-arch.ppc64")
|
||||
or die "remove exact POWER marker: $!";
|
||||
|
||||
open(my $kernel_fh, '>', "$tftp/xcat/genesis.kernel.ppc64le")
|
||||
or die "create exact POWER kernel: $!";
|
||||
close($kernel_fh) or die "close exact POWER kernel: $!";
|
||||
|
||||
@@ -125,8 +125,8 @@ unlike(
|
||||
my $offline_guide = read_file('docs/source/guides/install-guides/common_sections.rst');
|
||||
like(
|
||||
$offline_guide,
|
||||
qr/reposync.*--repoid=xcat-dep-common.*--download-metadata/s,
|
||||
'the offline guide explains how to mirror the common repository',
|
||||
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,
|
||||
|
||||
@@ -124,6 +124,11 @@ my ($published_kernel, $published_initramfs) =
|
||||
published_files($tftpdir, 'x86_64');
|
||||
is(read_file($published_kernel), 'new kernel', 'the kernel is published');
|
||||
is(read_file($published_initramfs), 'new initramfs', 'the initramfs is published');
|
||||
is(
|
||||
read_file("$tftpdir/xcat/genesis.exact-arch.x86_64"),
|
||||
export_manifest('x86_64'),
|
||||
'the canonical architecture marker is published with the image',
|
||||
);
|
||||
is(sprintf('%04o', (stat($published_kernel))[2] & oct('7777')), '0644', 'the kernel is readable by TFTP');
|
||||
is(sprintf('%04o', (stat($published_initramfs))[2] & oct('7777')), '0644', 'the initramfs is readable by TFTP');
|
||||
is_deeply([temporary_files("$tftpdir/xcat")], [], 'staging files are removed');
|
||||
@@ -131,16 +136,19 @@ is_deeply([temporary_files("$tftpdir/xcat")], [], 'staging files are removed');
|
||||
write_file("$tftpdir/xcat/genesis.kernel.ppc64le", 'stale kernel');
|
||||
write_file("$tftpdir/xcat/genesis.fs.ppc64le.gz", 'stale initramfs');
|
||||
write_file("$tftpdir/xcat/genesis.fs.ppc64le.lzma", 'stale legacy initramfs');
|
||||
write_file("$tftpdir/xcat/genesis.exact-arch.ppc64le", export_manifest('ppc64le'));
|
||||
write_file("$tftpdir/xcat/genesis.kernel.ppc64", 'legacy kernel');
|
||||
my ($removed, $remove_error) =
|
||||
xCAT_plugin::mknb::_remove_openembedded_genesis($tftpdir, 'ppc64le');
|
||||
is($remove_error, undef, 'OpenEmbedded boot artifacts can be retired cleanly');
|
||||
is($removed, 3, 'all exact-architecture boot artifacts are retired');
|
||||
is($removed, 4, 'all exact-architecture boot artifacts are retired');
|
||||
ok(!-e "$tftpdir/xcat/genesis.kernel.ppc64le",
|
||||
'the exact OpenEmbedded kernel is removed');
|
||||
ok(!-e "$tftpdir/xcat/genesis.fs.ppc64le.gz"
|
||||
&& !-e "$tftpdir/xcat/genesis.fs.ppc64le.lzma",
|
||||
'the exact OpenEmbedded initramfs files are removed');
|
||||
ok(!-e "$tftpdir/xcat/genesis.exact-arch.ppc64le",
|
||||
'the canonical architecture marker is removed');
|
||||
ok(-f "$tftpdir/xcat/genesis.kernel.ppc64",
|
||||
'retiring ppc64le does not remove the legacy ppc64 fallback');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user