From f47541e19b839b4cf3196e58ef7576d14a5e9d4f Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sat, 24 Oct 2026 17:52:34 -0300 Subject: [PATCH] fix(xcat-core): an openSUSE management node is not recognised, so no case runs current_os reads /etc/os-release and returns undef for openSUSE. The word sles appears nowhere in Leap's os-release -- ID is opensuse-leap on 15.x and opensuse on 42.3 -- and Leap ships none of /etc/redhat-release, /etc/lsb-release or /etc/SuSE-release, so no other arm is reached. xcattest rejects every case on the resulting undef, and 328 of the shipped cases declare os:Linux. openSUSE now answers with the SLE family whose package set it shares, which is the answer decided on 2026-09-18 for the same bug: sles.pm claims leap15 and xcat.org publishes the Leap dependencies under sles15. It also lets the 18 cases written os:sles select a Leap node, which a name of its own would not. current_os has one consumer -- the os: comparison at xcattest:1052 -- so the answer affects nothing else. The match is on the whole file rather than on ID alone, because Leap 42.3 spells its ID opensuse and Tumbleweed opensuse-tumbleweed. It is placed after the sles test, so a real SLES node is unaffected. xcattest_os_selection.t passes, 19 of 19. Reverting this file alone fails its five openSUSE assertions and nothing else. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/lib/xCAT/Test/OS.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT-test/lib/xCAT/Test/OS.pm b/xCAT-test/lib/xCAT/Test/OS.pm index 7bb05c0539..b50076881d 100644 --- a/xCAT-test/lib/xCAT/Test/OS.pm +++ b/xCAT-test/lib/xCAT/Test/OS.pm @@ -49,6 +49,13 @@ sub current_os { if (-f "$root/etc/os-release") { my $text = _slurp("$root/etc/os-release") // ''; return 'sles' if $text =~ /sles/; + # openSUSE answers with the SLE family whose package set it shares: sles.pm claims + # leap15 and xcat.org publishes the Leap dependencies under sles15. Leap's os-release + # says ID="opensuse-leap" and carries no SLES string, and Leap ships no + # /etc/SuSE-release, so without this arm the sub returns undef -- which matches no + # case's os: restriction, so xcattest skips every os-restricted case and reports it as + # "has an invalid OS option", blaming the case. + return 'sles' if $text =~ /opensuse/i; if ($text =~ /^ID\s*=\s*"?openeuler"?\s*$/mi) { my ($version) = $text =~ /^VERSION\s*=\s*"?([^"\n]+?)"?\s*$/mi; my $release = _openeuler_release($version);