From aeb82835f0a9bbf064be3424de8c1d097e1ec6bb Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Wed, 7 Feb 2018 11:57:27 -0600 Subject: [PATCH] Add a status line for SELinux status Some gate jobs appear to have SELinux in enforcing mode occasionally. SELinux support is improving but OSA is not ready to run in enforcing more until some remaining bugs are fixed. This patch adds a line that prints the current SELinux status during testing. Change-Id: I054c1849e5426801f6fdde761b7f64a2e8867af4 --- test-ansible-functional.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test-ansible-functional.sh b/test-ansible-functional.sh index 8b82059a..94a11b67 100755 --- a/test-ansible-functional.sh +++ b/test-ansible-functional.sh @@ -85,6 +85,14 @@ if [[ -x /usr/bin/yum-config-manager ]] && [[ -e /etc/centos-release ]]; then sudo yum-config-manager --enable updates > /dev/null fi +# Check if SELinux is present and which mode is currently set. +if [[ -x /usr/sbin/getenforce ]]; then + SELINUX_STATUS=$(/usr/sbin/getenforce) +else + SELINUX_STATUS="Unavailable" +fi +echo "Current SELinux status: ${SELINUX_STATUS}" + # Ensure that the Ansible environment is properly prepared source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh"