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
This commit is contained in:
Major Hayden 2018-02-07 11:57:27 -06:00
parent 3c595b9c30
commit aeb82835f0
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1
1 changed files with 8 additions and 0 deletions

View File

@ -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"