From 35f333a05a15c76e8ad9c24e916ca61000d409af Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sat, 24 Oct 2026 11:43:24 -0300 Subject: [PATCH 1/5] test(xcat-core): xCAT cannot be installed on either openSUSE node Both openSUSE test cells fail the install step: leap15.6: nothing provides 'perl-DB_File' needed by xCAT-server sles12: nothing provides (/usr/sbin/dhcpd if openEuler-release else ((kea and kea-hooks) if (system-release >= 10) else /usr/sbin/dhcpd)) needed by xCAT Both requirements are written for EL and have no answer on openSUSE. No package named perl-DB_File exists on Leap 15.6 or 42.3. The dhcpd expression is a rich dependency, and the sles12 management node is openSUSE 42.3 with rpm 4.11, which has none. The test states what the openSUSE branch of each spec must ask for, and that no rich dependency reaches an openSUSE build. It also holds down that EL and openEuler keep the expressions they have. Four of its nine assertions fail because no spec has an openSUSE branch for these requirements yet. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/opensuse_mn_requires.t | 110 ++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100755 xCAT-test/unit/opensuse_mn_requires.t diff --git a/xCAT-test/unit/opensuse_mn_requires.t b/xCAT-test/unit/opensuse_mn_requires.t new file mode 100755 index 0000000000..43446b8efa --- /dev/null +++ b/xCAT-test/unit/opensuse_mn_requires.t @@ -0,0 +1,110 @@ +#!/usr/bin/env perl +# xCAT cannot be installed on either openSUSE management node: +# +# leap15.6: nothing provides 'perl-DB_File' needed by xCAT-server +# sles12: nothing provides (/usr/sbin/dhcpd if openEuler-release else +# ((kea and kea-hooks) if (system-release >= 10) else /usr/sbin/dhcpd)) +# needed by xCAT +# +# Both requirements are written for EL and have no answer on openSUSE. +# +# perl-DB_File: no package of that name exists on Leap 15.6 or 42.3. Leap 15.6 calls it +# perl-core-DB_File and 42.3 has no such package either, but BOTH provide the capability +# perl(DB_File), so the capability is the portable name. +# +# The dhcpd expression: the sles12 cell is an openSUSE 42.3 management node whose rpm is 4.11, +# which has no rich dependencies -- it reports the whole expression as a capability nothing +# provides. Neither Leap release carries kea, and both carry chrony, ntp and ISC dhcpd, so the +# plain names are what these expressions resolve to on openSUSE anyway. +# +# A spec is a packaging manifest: the text IS the contract, there is nothing to execute, and +# these assertions are on package names in it. The build that proves the requirements resolve is +# the openSUSE core build plus the install step on each management node. +use strict; +use warnings; + +use FindBin qw($RealBin); +use Test::More; +use File::Slurper qw(read_text); + +my $root = "$RealBin/../.."; + +# Each entry: the spec, and what its openSUSE branch must and must not ask for. +my @cases = ( + { + spec => 'xCAT/xCAT.spec', + require => [ 'chrony', '/usr/sbin/dhcpd' ], + }, + { + spec => 'xCATsn/xCATsn.spec', + require => [ '/usr/sbin/dhcpd' ], + }, + { + spec => 'xCAT-server/xCAT-server.spec', + require => [ 'perl(DB_File)' ], + }, +); + +for my $c (@cases) { + my $path = "$root/$c->{spec}"; + ok(-f $path, "$c->{spec} exists") or next; + my $text = read_text($path); + + # The openSUSE branch is the region guarded by %if 0%{?suse_version}. Collect those regions + # so an assertion cannot be satisfied by a line that only EL ever sees. + my @suse; + my $depth = 0; + for my $line (split /\n/, $text) { + if ($line =~ /^\s*%if\s+0%\{\?suse_version\}/) { $depth = 1; next } + if ($depth) { + if ($line =~ /^\s*%(?:endif|else)/) { $depth = 0; next } + push @suse, $line; + } + } + my $suse = join "\n", @suse; + + for my $want (@{ $c->{require} }) { + my $q = quotemeta $want; + like($suse, qr/^\s*Requires:\s*(?:\S+\s+)*\Q$want\E\s*$/m, + "$c->{spec} asks openSUSE for $want"); + } +} + +subtest 'no rich dependency reaches an openSUSE build' => sub { + # rpm 4.11 on the sles12 management node cannot evaluate one, and a single core build serves + # both the sles15 and sles12 cells, so the openSUSE branch must carry none. + for my $spec (qw(xCAT/xCAT.spec xCATsn/xCATsn.spec)) { + my $path = "$root/$spec"; + my $text = read_text($path); + my @suse; + my $depth = 0; + for my $line (split /\n/, $text) { + if ($line =~ /^\s*%if\s+0%\{\?suse_version\}/) { $depth = 1; next } + if ($depth) { + if ($line =~ /^\s*%(?:endif|else)/) { $depth = 0; next } + push @suse, $line; + } + } + my @rich = grep { /^\s*Requires:\s*\(/ } @suse; + is(scalar @rich, 0, "$spec gives openSUSE no rich dependency"); + diag("rich dependency in the openSUSE branch: $_") for @rich; + } +}; + +# The EL and openEuler expressions must survive: this is an addition for openSUSE, not a +# replacement of the behaviour every other platform has today. +subtest 'EL and openEuler keep the expressions they have' => sub { + my $xcat = read_text("$root/xCAT/xCAT.spec"); + like($xcat, qr/\Qif openEuler-release else\E/, + 'xCAT.spec still carries the openEuler/EL10 dhcpd expression'); + like($xcat, qr/\Q(chrony or ntp)\E/, + 'xCAT.spec still offers EL the choice of chrony or ntp'); + my $sn = read_text("$root/xCATsn/xCATsn.spec"); + like($sn, qr/\Qif openEuler-release else\E/, + 'xCATsn.spec still carries the openEuler/EL10 dhcpd expression'); + my $srv = read_text("$root/xCAT-server/xCAT-server.spec"); + like($srv, qr/^\s*Recommends:\s*perl-DB_File\s*$/m, + 'xCAT-server.spec still asks EL10 weakly for perl-DB_File'); +}; + +done_testing(); From 844a5ba350b31638bb0b3c76a5f157132775859b Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sat, 24 Oct 2026 11:44:53 -0300 Subject: [PATCH 2/5] fix(xcat-core): xCAT cannot be installed on either openSUSE node Both openSUSE test cells fail the install step: leap15.6: nothing provides 'perl-DB_File' needed by xCAT-server sles12: nothing provides (/usr/sbin/dhcpd if openEuler-release else ((kea and kea-hooks) if (system-release >= 10) else /usr/sbin/dhcpd)) needed by xCAT Two requirements are written for EL and have no answer on openSUSE. xCAT-server asks for perl-DB_File. No package of that name exists on Leap 15.6 or 42.3: 15.6 calls it perl-core-DB_File and 42.3 has neither. Both provide the capability perl(DB_File), so openSUSE asks for the capability. xCAT and xCATsn ask for dhcpd through a rich dependency. The sles12 cell is an openSUSE 42.3 management node whose rpm is 4.11, which has no rich dependencies and reports the whole expression as an unprovided capability. Neither Leap release carries kea and both carry chrony and ISC dhcpd, so openSUSE takes the plain names the expressions resolve to there anyway. One core build serves both openSUSE cells, so the openSUSE branch must emit no rich dependency at all. Verified per platform with rpmspec. openSUSE now gets perl(DB_File), /usr/sbin/dhcpd and chrony; EL9 keeps perl-DB_File and both expressions; EL10 keeps perl-DB_File as a Recommends; openEuler keeps both expressions. xCAT-test/unit/opensuse_mn_requires.t fails on the commit before this one. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-server/xCAT-server.spec | 6 ++++++ xCAT/xCAT.spec | 11 ++++++++++- xCATsn/xCATsn.spec | 7 +++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 8fc21abee1..43ab9e20a9 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -58,13 +58,19 @@ Requires: perl-Net-Telnet perl-Net-DNS perl-Crypt-CBC perl-Crypt-Rijndael # and skipped where it cannot. The dependency generator still turns that "use DB_File" # into a hard perl(DB_File) requirement; drop it there too, appending to any filter the # build root already set. Every other platform keeps the hard requirement it has today. +# openSUSE has no package of that name: Leap 15.6 calls it perl-core-DB_File and 42.3 has +# neither, but both provide the capability, so ask for the capability there. %if 0%{?rhel} >= 10 Recommends: perl-DB_File %global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(DB_File\\)$ %else +%if 0%{?suse_version} +Requires: perl(DB_File) +%else Requires: perl-DB_File %endif %endif +%endif Obsoletes: atftp-xcat %endif diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index ee174a1cb0..b5f9c4c1c9 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -78,9 +78,18 @@ Requires: net-tools Requires: /usr/bin/killall # makentp/setupntp configure the MN as an NTP server for its compute nodes and support chronyd/ntpd # only. chrony is the default on EL7+/SLES15+ (and the only option on EL8+); ntp covers the rest. -Requires: (chrony or ntp) # openEuler's system-release version does not identify an EL release. +# +# openSUSE takes plain names. The sles12 cell is an openSUSE 42.3 node whose rpm is 4.11, which +# has no rich dependencies and reports the whole expression as an unprovided capability. Neither +# Leap release carries kea, so these expressions resolve to chrony and ISC dhcpd there anyway. +%if 0%{?suse_version} +Requires: chrony +Requires: /usr/sbin/dhcpd +%else +Requires: (chrony or ntp) Requires: (/usr/sbin/dhcpd if openEuler-release else ((kea and kea-hooks) if (system-release >= 10) else /usr/sbin/dhcpd)) +%endif # On RHEL this pulls in openssh-server, on SLES it pulls in openssh Requires: /usr/bin/ssh %if %nots390x diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index cea6eeda81..ea25966fd5 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -63,7 +63,14 @@ Requires: /usr/bin/killall # yaboot-xcat is pulled in so any SN can manage ppc nodes Requires: httpd nfs-utils nmap bind # openEuler's system-release version does not identify an EL release. +# +# openSUSE takes the plain name: rpm 4.11 on the sles12 node has no rich dependencies, and +# neither Leap release carries kea, so the expression resolves to ISC dhcpd there anyway. +%if 0%{?suse_version} +Requires: /usr/sbin/dhcpd +%else Requires: (/usr/sbin/dhcpd if openEuler-release else ((kea and kea-hooks) if (system-release >= 10) else /usr/sbin/dhcpd)) +%endif # On RHEL this pulls in openssh-server, on SLES it pulls in openssh Requires: /usr/bin/ssh %ifnarch s390x From 12ac35da0375a9cfc1ce85b4c31894bbc41cfe17 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sat, 24 Oct 2026 13:47:32 -0300 Subject: [PATCH 3/5] test(xcat-core): xcatd does not start on an openSUSE node With the install dependencies resolved, xCAT installs on the leap15.6 node and the install gate still fails: [install] GATE: xcatd running + reachable with NO xcatconfig GATE FAIL: xcatd not active GATE FAIL: lsdef cannot reach xcatd GATE FAIL: site.xcatdport not seeded journalctl for xcatd has no entries at all, and loading the library by hand on the node says why: Can't locate JSON.pm in @INC ... (@INC contains: /opt/xcat/lib/perl ...) openSUSE has no perl-generators, so no perl(...) requirement is generated for any xCAT package and nothing installs the modules the code loads. Measured on xcat20-mn against the 85 external modules the EL build auto-requires: five are absent -- Date::Parse, Expect, HTML::Form, JSON and SNMP -- and the other 80 are present. The test names, per spec, the modules that package's openSUSE branch must ask for, mirroring what EL's generator emits for it. Nine assertions fail because no spec names them yet. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/opensuse_mn_requires.t | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/xCAT-test/unit/opensuse_mn_requires.t b/xCAT-test/unit/opensuse_mn_requires.t index 43446b8efa..cc81411b5b 100755 --- a/xCAT-test/unit/opensuse_mn_requires.t +++ b/xCAT-test/unit/opensuse_mn_requires.t @@ -40,8 +40,23 @@ my @cases = ( require => [ '/usr/sbin/dhcpd' ], }, { + # openSUSE has no perl-generators, so no perl(...) requirement is auto-generated and the + # modules each package loads must be named. Measured on xcat20-mn after a successful + # install: xcatd stayed inactive because xCAT::Table dies loading JSON, and Date::Parse, + # Expect, HTML::Form and SNMP were absent too. The other 80 modules the EL build + # auto-requires were present. Each list below mirrors what EL's generator emits for that + # package. spec => 'xCAT-server/xCAT-server.spec', - require => [ 'perl(DB_File)' ], + require => [ 'perl(DB_File)', + 'perl(Date::Parse)', 'perl(Expect)', 'perl(JSON)', 'perl(SNMP)' ], + }, + { + spec => 'perl-xCAT/perl-xCAT.spec', + require => [ 'perl(Expect)', 'perl(HTML::Form)', 'perl(JSON)', 'perl(SNMP)' ], + }, + { + spec => 'xCAT-client/xCAT-client.spec', + require => [ 'perl(Expect)' ], }, ); @@ -64,9 +79,9 @@ for my $c (@cases) { my $suse = join "\n", @suse; for my $want (@{ $c->{require} }) { - my $q = quotemeta $want; - like($suse, qr/^\s*Requires:\s*(?:\S+\s+)*\Q$want\E\s*$/m, - "$c->{spec} asks openSUSE for $want"); + # a Requires: line may name several capabilities, so match the token anywhere on it + my $found = grep { /^\s*Requires:/ && /(?:^|\s)\Q$want\E(?:\s|$)/ } @suse; + ok($found, "$c->{spec} asks openSUSE for $want"); } } From ef7989112f615550599ff164c73388cfecdfc9a7 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sat, 24 Oct 2026 13:48:00 -0300 Subject: [PATCH 4/5] fix(xcat-core): xcatd does not start on an openSUSE node xCAT installs on the leap15.6 node and the install gate still fails: GATE FAIL: xcatd not active GATE FAIL: lsdef cannot reach xcatd GATE FAIL: site.xcatdport not seeded journalctl for xcatd has no entries, and loading the library by hand on the node says why: Can't locate JSON.pm in @INC ... (@INC contains: /opt/xcat/lib/perl ...) openSUSE has no perl-generators. Nothing generates a perl(...) requirement for any xCAT package there, so no spec installs the modules its code loads, and perl-xCAT names no Requires at all. Measured on xcat20-mn against the 85 external modules the EL build auto-requires: five are absent -- Date::Parse, Expect, HTML::Form, JSON and SNMP -- and the other 80 are present. Each openSUSE branch now names the modules EL's generator emits for that package, as capabilities, so the same core build serves the sles15 and sles12 cells: both Leap releases provide all five, from perl-TimeDate, perl-Expect, perl-HTML-Form, perl-JSON and perl-SNMP. Verified with rpmspec that only openSUSE gets these; EL and openEuler are unchanged and keep generating them. xCAT-test/unit/opensuse_mn_requires.t fails on the commit before this one. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- perl-xCAT/perl-xCAT.spec | 9 +++++++++ xCAT-client/xCAT-client.spec | 6 ++++++ xCAT-server/xCAT-server.spec | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/perl-xCAT/perl-xCAT.spec b/perl-xCAT/perl-xCAT.spec index aad2d042e9..d97f7dfb73 100644 --- a/perl-xCAT/perl-xCAT.spec +++ b/perl-xCAT/perl-xCAT.spec @@ -16,6 +16,15 @@ BuildArch: noarch BuildRequires: perl perl-DBI perl-JSON # Do not need the SOAP rpm require, because rpm will generate it automatically if hpoa.pm is included #Requires: perl-SOAP-Lite +# openSUSE has no perl-generators, so no perl(...) requirement is generated here and nothing +# installs the modules this code loads. xcatd stays inactive without them: xCAT::Table dies +# loading JSON. EL and openEuler generate these automatically and need no list. +%if 0%{?suse_version} +Requires: perl(Expect) +Requires: perl(HTML::Form) +Requires: perl(JSON) +Requires: perl(SNMP) +%endif %endif %description diff --git a/xCAT-client/xCAT-client.spec b/xCAT-client/xCAT-client.spec index 2f6b71e288..6c0daf8df1 100644 --- a/xCAT-client/xCAT-client.spec +++ b/xCAT-client/xCAT-client.spec @@ -31,6 +31,12 @@ BuildArch: noarch Requires: perl-xCAT = 4:%{version}-%{release} Requires: cpio +# openSUSE has no perl-generators, so no perl(...) requirement is generated here and nothing +# installs the modules this code loads. xcatd stays inactive without them: xCAT::Table dies +# loading JSON. EL and openEuler generate these automatically and need no list. +%if 0%{?suse_version} +Requires: perl(Expect) +%endif # fping or nmap is needed by pping (in case xCAT-client is installed by itself on a remote client) %ifos linux diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 43ab9e20a9..f1d94acb5e 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -52,6 +52,15 @@ Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser perl-Digest-SHA1 pe # Time::HiRes and Text::Balanced) are not pulled in transitively by perl-xCAT # either. List them here or the affected subcommands die at load time. Requires: perl-Net-Telnet perl-Net-DNS perl-Crypt-CBC perl-Crypt-Rijndael +# openSUSE has no perl-generators, so no perl(...) requirement is generated here and nothing +# installs the modules this code loads. xcatd stays inactive without them: xCAT::Table dies +# loading JSON. EL and openEuler generate these automatically and need no list. +%if 0%{?suse_version} +Requires: perl(Date::Parse) +Requires: perl(Expect) +Requires: perl(JSON) +Requires: perl(SNMP) +%endif # DB_File is only used by the Confluent client (lib/xcat/Confluent/Client.pm). EL10 # dropped libdb: EPEL still carries perl-DB_File for x86_64 and ppc64le, but riscv64 has # no EPEL at all, so on EL10 ask for the module weakly -- it is installed where it exists From 001edc1a9f2c4c82adcd065b25cb602ec801815e Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 29 Oct 2026 14:36:35 -0300 Subject: [PATCH 5/5] fix(xcat-core): package_relations.t expects perl-DB_File on openSUSE xCAT-server now asks for the perl(DB_File) capability on openSUSE, because no openSUSE release ships a package named perl-DB_File. The native package relation test still counted perl-DB_File in the SLES12 and SLES15 requirements, so both checks failed in xcat_pr_test. Expect perl(DB_File) on the SLES platforms and keep perl-DB_File for the others. The test fails against the upstream master spec and passes with this branch. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/native/package_relations.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-test/native/package_relations.t b/xCAT-test/native/package_relations.t index a49b6670fc..726a41827e 100644 --- a/xCAT-test/native/package_relations.t +++ b/xCAT-test/native/package_relations.t @@ -46,7 +46,8 @@ for my $platform (@platforms) { like($requires, qr/^perl\(Digest::SHA\)$/m, "$name server s390x=$s390 requires Digest::SHA"); next if $s390; my $recommends = query('xCAT-server', 'x86_64', $macro, '--recommends'); - is(scalar(grep { $_ eq 'perl-DB_File' } split /\n/, $requires), $name eq 'EL10' ? 0 : 1, + my $db_file = $name =~ /^SLES/ ? 'perl(DB_File)' : 'perl-DB_File'; + is(scalar(grep { $_ eq $db_file } split /\n/, $requires), $name eq 'EL10' ? 0 : 1, "$name server hard DB_File dependency"); is(scalar(grep { $_ eq 'perl-DB_File' } split /\n/, $recommends), $name eq 'EL10' ? 1 : 0, "$name server weak DB_File dependency");