From 55b68f63ec87acdb43de855f22b5083c51d076c6 Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Thu, 24 Mar 2016 12:19:41 +0000 Subject: [PATCH] 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 --- tests/inventory | 6 +++--- tox.ini | 13 ------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/tests/inventory b/tests/inventory index a6eb73c4..ba414392 100644 --- a/tests/inventory +++ b/tests/inventory @@ -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 diff --git a/tox.ini b/tox.ini index a5fdf08e..d55c1cb5 100644 --- a/tox.ini +++ b/tox.ini @@ -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 \