2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-26 01:34:05 +00:00

test(mknb): cover the BIOS Genesis BOOTIF format

Check both paths that write the script: mknb --configfileonly on an
installed Genesis, and a full mknb run from an x86_64 OpenEmbedded export.
This commit is contained in:
Vinícius Ferrão
2026-09-24 02:33:01 -03:00
parent b4eb93be86
commit 43e008cf99
2 changed files with 42 additions and 0 deletions
+28
View File
@@ -553,4 +553,32 @@ my $unsafe = xCAT_plugin::mknb::_select_genesis_source(
);
is($unsafe, undef, 'unsupported architecture names cannot escape the image root');
$::XCATROOT = "$tmpdir/openembedded-x86_64-xcatroot";
prepare_export(
"$::XCATROOT/share/xcat/netboot/genesis-openembedded/x86_64",
'openembedded x86_64 kernel',
'openembedded x86_64 initramfs',
'x86_64',
);
$xCAT::TableUtils::tftpdir = "$tmpdir/openembedded-x86_64-tftpboot";
@responses = ();
xCAT_plugin::mknb::process_request(
{ arg => ['x86_64'] },
sub { push(@responses, @_); },
);
ok(
!grep({ ref($_) eq 'HASH' && $_->{error} } @responses),
'mknb installs an x86_64 OpenEmbedded export',
);
is(
read_file("$xCAT::TableUtils::tftpdir/xcat/genesis.kernel.x86_64"),
'openembedded x86_64 kernel',
'mknb publishes the OpenEmbedded x86_64 kernel',
);
like(
read_file("$xCAT::TableUtils::tftpdir/xcat/xnba/nets/192.0.2.0_24"),
qr{^imgfetch -n kernel \S+/xcat/genesis\.kernel\.x86_64 .* BOOTIF=01-\$\{netX/mac:hexhyp\}$}m,
'the OpenEmbedded BIOS Genesis script takes BOOTIF from mac:hexhyp',
);
done_testing();
+14
View File
@@ -232,6 +232,20 @@ foreach my $relative_path (
);
}
my $bios_genesis = read_config(
"$xCAT::TableUtils::tftpdir/xcat/xnba/nets/192.168.144.0_20"
);
like(
$bios_genesis,
qr{^imgfetch -n kernel \S+/xcat/genesis\.kernel\.x86_64 .* BOOTIF=01-\$\{netX/mac:hexhyp\}$}m,
'the BIOS Genesis script takes BOOTIF from mac:hexhyp',
);
unlike(
$bios_genesis,
qr/machyp/,
'the BIOS Genesis script does not use the xNBA-only machyp setting',
);
use_reporter_address_maps();
prepare_tftpdir($tmpdir, 'tftpboot-x86-legacy', 'x86_64', 'legacy');
$responses = run_mknb('x86_64');