summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Pretorius <jesse.pretorius@rackspace.co.uk>2019-01-28 14:39:13 +0000
committerJesse Pretorius <jesse.pretorius@rackspace.co.uk>2019-01-28 14:39:13 +0000
commit03aa9c1e2b08823949511a1f0dbecdfaffb0b8e2 (patch)
tree85084b62567c7ebb06b795722e0910328af6c658
parent6223a72d1818b25d50c9acbec21e8d3ddaa91785 (diff)
Ensure selinux bindings are linked into the venv
When running role tests, the tox venv does not have the selinux bindings, and they are not installable via pip. To ensure that Ansible is able to use the file module which requires these bindings, we symlink them into the venv. Change-Id: Ie8426653b4843fdae0946a49c02fa11db139fd4e
Notes
Notes (review): Code-Review+1: Chandan Kumar <chkumar@redhat.com> Code-Review+2: Jonathan Rosser <jonathan.rosser@rd.bbc.co.uk> Code-Review+2: Jean-Philippe Evrard <jean-philippe@evrard.me> Workflow+1: Jesse Pretorius (odyssey4me) <jesse.pretorius@rackspace.co.uk> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 29 Jan 2019 13:48:22 +0000 Reviewed-on: https://review.openstack.org/633513 Project: openstack/openstack-ansible-tests Branch: refs/heads/master
-rwxr-xr-xtest-ansible-env-prep.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/test-ansible-env-prep.sh b/test-ansible-env-prep.sh
index c18ac3c..378f132 100755
--- a/test-ansible-env-prep.sh
+++ b/test-ansible-env-prep.sh
@@ -231,3 +231,12 @@ fi
231 231
232# Setup ARA 232# Setup ARA
233setup_ara 233setup_ara
234
235# Ensure that SElinux bindings are linked into the venv
236source /etc/os-release || source /usr/lib/os-release
237if [[ ${ID,,} =~ (centos|rhel|fedora) ]]; then
238 PYTHON_FOLDER=$(find ${VIRTUAL_ENV}/lib -maxdepth 1 -type d -name "python*")
239 SELINUX_FOLDER=$(rpm -ql libselinux-python | egrep '^.*python2.7.*/(site|dist)-packages/selinux$')
240 echo "RHEL variant found. Linking ${PYTHON_FOLDER}/site-packages/selinux to ${SELINUX_FOLDER}..."
241 ln -sfn ${SELINUX_FOLDER} ${PYTHON_FOLDER}/site-packages/selinux
242fi