From 3c254f221a0d217bb22087eb1e1a17c3f67a1847 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Mon, 9 Nov 2026 12:09:16 -0300 Subject: [PATCH] fix(xcat-test): the SELinux suite requires an enforcing compute node selinux_cn_diskful_enforcing provisions a diskful compute node with SELinux enforcing and expects no xCAT denial on it. The SELinux support covers the management node only: xcatd runs in xcat_t and the image build in xcat_image_t, and no policy is shipped for a compute node. The case therefore cannot pass, and its failure reads as a defect in the management-node policy. Remove the case from testcase/selinux/cases1 and from selinux.bundle. selinux_bundle.t still passes: every remaining case is in a bundle. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/autotest/bundle/selinux.bundle | 1 - xCAT-test/autotest/testcase/selinux/cases1 | 46 ---------------------- 2 files changed, 47 deletions(-) diff --git a/xCAT-test/autotest/bundle/selinux.bundle b/xCAT-test/autotest/bundle/selinux.bundle index d893351af1..b78594c3eb 100644 --- a/xCAT-test/autotest/bundle/selinux.bundle +++ b/xCAT-test/autotest/bundle/selinux.bundle @@ -2,7 +2,6 @@ selinux_xcatd_domain selinux_client_domain selinux_mn_labels selinux_restapi_avc -selinux_cn_diskful_enforcing selinux_cn_diskless_disabled_by_design selinux_cn_diskless_site_disabled selinux_sn_enforcing diff --git a/xCAT-test/autotest/testcase/selinux/cases1 b/xCAT-test/autotest/testcase/selinux/cases1 index defdf7c18c..d4f81183a0 100644 --- a/xCAT-test/autotest/testcase/selinux/cases1 +++ b/xCAT-test/autotest/testcase/selinux/cases1 @@ -1,49 +1,3 @@ -start:selinux_cn_diskful_enforcing -description:on an enforcing management node, a diskful compute node with noderes.selinux=enforcing boots enforcing, with correct labels and no denial. The labels of /xcatpost are reported and not asserted: the kickstart relabel runs in %post, the xCAT post scripts write that tree at the first boot, and the node carries no xCAT-selinux -label:selinux,provision -os:Linux -cmd:getenforce -check:rc==0 -check:output=~^Enforcing$ -cmd:sh -c '/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/selinux_avc_check.sh --init /tmp/selinux_cn_diskful.avcck' -check:rc==0 -check:output=~BASELINE=[1-9] -cmd:chdef -t node -o $$CN selinux=enforcing -check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -check:output=~Provision node\(s\)\: $$CN -cmd:xdsh $$CN getenforce -check:rc==0 -check:output=~Enforcing -cmd:xdsh $$CN cat /proc/cmdline -check:rc==0 -check:output!~selinux=0 -cmd:xdsh $$CN "ls -dZ /root/.ssh /etc/ssh/sshd_config /opt/xcat /xcatpost" -check:rc==0 -check:output=~ssh_home_t -check:output!~default_t -check:output!~unlabeled_t -cmd:xdsh $$CN "restorecon -Rnv /opt/xcat /root /etc/ssh /var/log/xcat" -check:rc==0 -check:output!~Would relabel -cmd:xdsh $$CN "restorecon -Rnv /xcatpost; true" -check:rc==0 -cmd:xdcp $$CN /opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/selinux_avc_check.sh /tmp/ -check:rc==0 -cmd:xdsh $$CN "sh /tmp/selinux_avc_check.sh boot" -check:rc==0 -check:output=~XCAT_AVC=0 -cmd:xdsh $$CN "rm -f /tmp/selinux_avc_check.sh" -check:rc==0 -cmd:sh -c '/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/selinux_avc_check.sh --since /tmp/selinux_cn_diskful.avcck' -check:rc==0 -check:output=~XCAT_AVC=0 -cmd:chdef -t node -o $$CN selinux= -check:rc==0 -cmd:rm -f /tmp/selinux_cn_diskful.avcck -end - start:selinux_cn_diskless_disabled_by_design description:a stateless compute node asked for SELinux enforcing still boots with selinux=0, because a stateless root cannot be labelled, and nodeset says so label:selinux,provision