From c406d93bce33fc500041ea030659c78b3551c6c9 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Fri, 4 Sep 2026 19:26:49 -0300 Subject: [PATCH] fix(xcat-core): the genesis lzma case passes when mknb writes no lzma image nodeset_shell_lzma asserts "output=~genesis" on "ls -l /tftpboot/xcat/genesis.fs.*.lzma". The path in the command holds the string the check looks for, so the error "ls: cannot access '/tftpboot/xcat/genesis.fs.*.lzma'" matches too. The check is green whether mknb wrote the lzma image or not. Removing the "xz --format=lzma" fallback from genesis_lzma_command in mknb.pm makes mknb write only the gz image, and this check still passes. The same case starts with a "yum install" of xz-lzma-compat from a rpmfind.net CentOS 8-Stream PowerTools URL. No check follows it. The URL returns 404 since CentOS 8-Stream went end of life, so the step has done nothing for a long time. The check is now "rc==0". ls returns 2 when the glob matches no file, so the check is red exactly when mknb wrote no lzma image. The dead install and its paired "yum remove" are deleted rather than gated, because genesis_lzma_command falls back to "xz --format=lzma" and xz is present on every EL management node: the lzma image the case tests is produced without the package. Verified with the runcmd and check-evaluation code lifted out of xCAT-test/xcattest. With the lzma image present both checks are green. With only the gz image present the old check stays green and "rc==0" is red. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> (cherry picked from commit 942729abecde9cad7c7ac7adcdbe270d97a79051) --- xCAT-test/autotest/testcase/genesis/cases0 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/genesis/cases0 b/xCAT-test/autotest/testcase/genesis/cases0 index e2e7e7ca8..066eac4e8 100644 --- a/xCAT-test/autotest/testcase/genesis/cases0 +++ b/xCAT-test/autotest/testcase/genesis/cases0 @@ -2,14 +2,13 @@ start:nodeset_shell_lzma os:rhels8 label:others,genesis description: verify could log in genesis shell lzma compression -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]]; then yum install -y https://rpmfind.net/linux/centos/8-stream/PowerTools/__GETNODEATTR($$CN,arch)__/os/Packages/xz-lzma-compat-5.2.4-3.el8.__GETNODEATTR($$CN,arch)__.rpm; elif rpm -q xz; then yum download https://rpmfind.net/linux/centos/8-stream/PowerTools/__GETNODEATTR($$CN,arch)__/os/Packages/xz-lzma-compat-5.2.4-3.el8.__GETNODEATTR($$CN,arch)__.rpm; rpm -ivh --nodeps xz-lzma-compat-5.2.4-3.el8.__GETNODEATTR($$CN,arch)__.rpm; fi #Generate genesis network boot with lzma compression cmd:mknb __GETNODEATTR($$CN,arch)__ check:rc==0 cmd:nodeset $$CN shell check:rc==0 cmd:ls -l /tftpboot/xcat/genesis.fs.*.lzma -check:output=~genesis +check:rc==0 cmd:find /tftpboot -type f -name $$CN | xargs grep "lzma" check:output=~genesis cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -g @@ -19,8 +18,7 @@ check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c check:rc==0 cmd:cat /tmp/genesistestlog/* -#Remove lzma compression RPM, cleanup and generate default gz genesis network boot -cmd:yum remove -y xz-lzma-compat +#Cleanup and generate the default gz genesis network boot cmd:rm -f /tftpboot/xcat/genesis.fs.*.lzma cmd:mknb __GETNODEATTR($$CN,arch)__ end