From 14c45107d03bca61a9c6556c91f0c03fe9eb23c2 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:20:55 -0300 Subject: [PATCH] test(genesis): cover final review gaps --- xCAT-test/unit/destiny_genesis_architecture.t | 12 ++++++++++++ xCAT-test/unit/genesis_openembedded_activation.t | 4 ++-- xCAT-test/unit/mknb_exported_genesis.t | 10 +++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/xCAT-test/unit/destiny_genesis_architecture.t b/xCAT-test/unit/destiny_genesis_architecture.t index 4bfa74f11..e98aa678d 100644 --- a/xCAT-test/unit/destiny_genesis_architecture.t +++ b/xCAT-test/unit/destiny_genesis_architecture.t @@ -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: $!"; diff --git a/xCAT-test/unit/genesis_openembedded_activation.t b/xCAT-test/unit/genesis_openembedded_activation.t index 07c72916a..552563fb1 100644 --- a/xCAT-test/unit/genesis_openembedded_activation.t +++ b/xCAT-test/unit/genesis_openembedded_activation.t @@ -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, diff --git a/xCAT-test/unit/mknb_exported_genesis.t b/xCAT-test/unit/mknb_exported_genesis.t index bfab2fe11..7160541f7 100644 --- a/xCAT-test/unit/mknb_exported_genesis.t +++ b/xCAT-test/unit/mknb_exported_genesis.t @@ -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');