2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-08 12:40:45 +00:00

test(genesis): cover s390x identity fallbacks

This commit is contained in:
Vinícius Ferrão
2026-09-04 14:42:57 -03:00
parent dec2227c8e
commit 059438d266
3 changed files with 22 additions and 7 deletions
@@ -26,7 +26,6 @@ my $compiler = $ENV{CC} || 'cc';
is(
system(
$compiler, '-D_POSIX_C_SOURCE=200809L', '-DXCAT_CONSOLE_PLAIN_ONLY',
'-DXCAT_CONSOLE_TEST',
'-std=c17', '-Wall', '-Wextra', '-Wpedantic', '-Werror',
@plain_sources, '-o', $binary
) >> 8,
@@ -97,7 +96,7 @@ C
);
is(
system(
$compiler, '-D_POSIX_C_SOURCE=200809L', '-DXCAT_CONSOLE_TEST',
$compiler, '-D_POSIX_C_SOURCE=200809L',
'-std=c17', '-Wall', '-Wextra', '-Wpedantic', '-Werror',
'-I', $source_dir, $identity_test_source,
File::Spec->catfile( $source_dir, 'state.c' ),
@@ -245,7 +244,6 @@ Sequence Code: 0000000012345
LPAR UUID: 93724168-fda3-429b-8b28-a5d245dcb3ff
VM00 UUID: 82038f2a-1344-aaf7-1a85-2a7250be2076
SYSINFO
$environment{XCAT_TEST_ARCH} = 's390x';
write_file( $cmdline, "xcatd=192.0.2.10:3001\n" );
( $status, $output ) = run_console();
is( $status, 0, 'plain console accepts IBM Z identity' );
@@ -275,7 +273,6 @@ SYSINFO
like( $probe_output,
qr/^uuid=93724168-fda3-429b-8b28-a5d245dcb3ff$/m,
'console uses the LPAR UUID when no guest UUID is available' );
delete $environment{XCAT_TEST_ARCH};
write_file( File::Spec->catfile( $dmi_root, 'product_serial' ),
"TEST-SERIAL-001\n" );
write_file( File::Spec->catfile( $dmi_root, 'product_uuid' ),
@@ -415,8 +415,8 @@ like( $packet, qr{<serial>02AB123</serial>},
'Power discovery reports the system serial' );
like( $packet, qr{<platform>PowerNV</platform>},
'Power discovery reports the firmware platform' );
like( $packet, qr{<cpucount>2</cpucount>},
'Power discovery counts processor records' );
like( $packet, qr{<cpucount>4</cpucount>},
'Power discovery keeps the existing processor count' );
like( $packet,
qr{<uuid>9009-42a-02ab123-525400000002</uuid>},
'Power discovery creates a stable fallback UUID' );
@@ -461,6 +461,20 @@ like( $packet,
qr{<uuid>82038f2a-1344-aaf7-1a85-2a7250be2076</uuid>},
's390x discovery uses the closest guest UUID' );
write_file( File::Spec->catfile( $proc_root, 'sysinfo' ), <<'SYSINFO' );
Manufacturer: IBM
Type: 3931
Model: 701 A01
VM00 Control Program: KVM/Linux
SYSINFO
is( run_script( $discover_script, \%environment ), 0,
's390x discovery accepts a guest without a reported UUID' );
$packet = read_file($packet_file);
unlike( $packet, qr{<serial>},
'a UUID-less s390x guest still omits the shared machine serial' );
like( $packet, qr{<uuid>3931-a01-unknown-525400000002</uuid>},
'a UUID-less s390x guest retains the MAC-based fallback identity' );
unlink($response_file);
is( run_script( $callback_script, \%environment, "restart (eth0)" ), 0,
'callback accepts a restart response' );
+5 -1
View File
@@ -57,13 +57,17 @@ is( xCAT::ProfiledNodeUtils::cal_netboot( $rule_table, [ 'aarch64', 'rhels', '9'
# Schema descriptions
# ---------------------------------------------------------------------------
SKIP: {
skip 'xCAT::Schema is not loadable here', 3
skip 'xCAT::Schema is not loadable here', 5
unless eval { require lib; lib->import( repo_path('perl-xCAT') ); require xCAT::Schema; 1 };
like( $xCAT::Schema::tabspec{nodetype}{descriptions}{arch}, qr/\briscv64\b/,
'nodetype.arch documents riscv64 as a valid value' );
like( $xCAT::Schema::tabspec{nodetype}{descriptions}{arch}, qr/\bs390x\b/,
'nodetype.arch documents s390x as a valid value' );
like( $xCAT::Schema::tabspec{osimage}{descriptions}{osarch}, qr/\briscv64\b/,
'osimage.osarch documents riscv64 as a valid value' );
like( $xCAT::Schema::tabspec{osimage}{descriptions}{osarch}, qr/\bs390x\b/,
'osimage.osarch documents s390x as a valid value' );
like( $xCAT::Schema::tabspec{noderes}{descriptions}{netboot}, qr/riscv64\s+>=el10\s+grub2,grub2-http,grub2-tftp/,
'noderes.netboot documents the riscv64 grub2 methods' );
}