Merge pull request #148 from rhatdan/selinux

Setup proper labeling for runnin test with selinux
This commit is contained in:
Antonio Murdaca 2016-10-15 01:32:52 +02:00 committed by GitHub
commit 0c7f83dd1f

View file

@ -22,6 +22,11 @@ RUNC_PATH=$(command -v runc || true)
RUNC_BINARY=${RUNC_PATH:-/usr/local/sbin/runc}
TESTDIR=$(mktemp -d)
if selinuxenabled; then
. /etc/selinux/config
filelabel=$(awk -F'"' '/^file.*=.*/ {print $2}' /etc/selinux/${SELINUXTYPE}/contexts/lxc_contexts)
chcon -R ${filelabel} $TESTDIR
fi
OCID_SOCKET="$TESTDIR/ocid.sock"
OCID_CONFIG="$TESTDIR/ocid.conf"