Update tests to work w/ secure_path update

The tests in this role were crafted to work with an upstream image
config that persisted a user's PATH when the user sudos to root.  We
raised this issue with openstack-infra as it was a non-standard config
and difficult to debug. This was reverted in [1] and this commit now
updates the tests to not assume that packages are being installed into
tox's functional venv.

[1] https://review.openstack.org/#/c/296598/

Change-Id: Ibb068f558fcc05c57f291698023459c92cbe12d6
This commit is contained in:
Matt Thompson 2016-03-24 12:19:41 +00:00
parent ad5736d3f3
commit 55b68f63ec
2 changed files with 3 additions and 16 deletions

View File

@ -1,8 +1,8 @@
[all]
localhost ansible_connection=local ansible_become=True ansible_python_interpreter=ENVPYTHON
localhost ansible_connection=local ansible_become=True
[cinder_volume]
localhost ansible_connection=local ansible_become=True ansible_python_interpreter=ENVPYTHON
localhost ansible_connection=local ansible_become=True
[cinder_all]
localhost ansible_connection=local ansible_become=True ansible_python_interpreter=ENVPYTHON
localhost ansible_connection=local ansible_become=True

13
tox.ini
View File

@ -15,8 +15,6 @@ whitelist_externals =
bash
git
rm
ln
sed
setenv =
VIRTUAL_ENV={envdir}
ANSIBLE_HOST_KEY_CHECKING = False
@ -108,17 +106,6 @@ commands =
[testenv:functional]
commands =
rm -rf {homedir}/.ansible
# Ansible is run using python in the tox venv, which doesn't have python-apt in it.
# Installing python-apt is non-trivial at first glance so for now we just symlink
# these in from the host.
ln -snf /usr/lib/python2.7/dist-packages/apt/ {envsitepackagesdir}/apt
ln -snf /usr/lib/python2.7/dist-packages/aptsources/ {envsitepackagesdir}/aptsources
ln -snf /usr/lib/python2.7/dist-packages/apt_pkg.so {envsitepackagesdir}/apt_pkg.so
ln -snf /usr/lib/python2.7/dist-packages/apt_inst.so {envsitepackagesdir}/apt_inst.so
# This forces Ansible to use the venv interpreter for localhost, which means we don't
# run into issues where things are being installed into the venv but then Ansible
# complains that it doesn't exist in /usr/local/lib.
sed -i 's@ENVPYTHON@{envpython}@g' tests/inventory
git clone https://git.openstack.org/openstack/openstack-ansible-plugins \
{homedir}/.ansible/plugins
ansible-galaxy install \