Currently the tests fail on master if running without root user, because we try to create a symlink on the system:
=========================
Failures during discovery
=========================
--- import errors ---
Failed to import test module: tripleoclient.tests.v1.tripleo.test_tripleo_deploy
Traceback (most recent call last):
File "/home/hobbestigrou/python-tripleoclient/.tox/py27/lib/python2.7/site-packages/unittest2/loader.py", line 456, in _find_test_path
module = self._get_module_from_name(name)
File "/home/hobbestigrou/python-tripleoclient/.tox/py27/lib/python2.7/site-packages/unittest2/loader.py", line 395, in _get_module_from_name
__import__(name)
File "tripleoclient/tests/v1/tripleo/test_tripleo_deploy.py", line 30, in <module>
from tripleoclient.v1 import tripleo_deploy
File "tripleoclient/v1/tripleo_deploy.py", line 92, in <module>
class Deploy(command.Command):
File "tripleoclient/v1/tripleo_deploy.py", line 119, in Deploy
'/usr/local/bin/' + ansible_playbook_cmd)
OSError: [Errno 13] Permission denied
Failed to import test module: tripleoclient.tests.v1.tripleo.test_tripleo_upgrade
Traceback (most recent call last):
File "/home/hobbestigrou/python-tripleoclient/.tox/py27/lib/python2.7/site-packages/unittest2/loader.py", line 456, in _find_test_path
module = self._get_module_from_name(name)
File "/home/hobbestigrou/python-tripleoclient/.tox/py27/lib/python2.7/site-packages/unittest2/loader.py", line 395, in _get_module_from_name
__import__(name)
File "tripleoclient/tests/v1/tripleo/test_tripleo_upgrade.py", line 24, in <module>
from tripleoclient.v1 import tripleo_upgrade
File "tripleoclient/v1/tripleo_upgrade.py", line 18, in <module>
from tripleoclient.v1.tripleo_deploy import Deploy
File "tripleoclient/v1/tripleo_deploy.py", line 92, in <module>
class Deploy(command.Command):
File "tripleoclient/v1/tripleo_deploy.py", line 119, in Deploy
'/usr/local/bin/' + ansible_playbook_cmd)
OSError: [Errno 13] Permission denied
Failed to import test module: tripleoclient.tests.v1.undercloud.test_deploy
Traceback (most recent call last):
File "/home/hobbestigrou/python-tripleoclient/.tox/py27/lib/python2.7/site-packages/unittest2/loader.py", line 456, in _find_test_path
module = self._get_module_from_name(name)
File "/home/hobbestigrou/python-tripleoclient/.tox/py27/lib/python2.7/site-packages/unittest2/loader.py", line 395, in _get_module_from_name
__import__(name)
File "tripleoclient/tests/v1/undercloud/test_deploy.py", line 21, in <module>
from tripleoclient.v1 import undercloud_deploy
File "tripleoclient/v1/undercloud_deploy.py", line 19, in <module>
from tripleoclient.v1.tripleo_deploy import Deploy
File "tripleoclient/v1/tripleo_deploy.py", line 92, in <module>
class Deploy(command.Command):
File "tripleoclient/v1/tripleo_deploy.py", line 119, in Deploy
'/usr/local/bin/' + ansible_playbook_cmd)
OSError: [Errno 13] Permission denied
So the solution it's run a first time with root user to create the symlink, then tests can be run with normal user. A simple workaround is check the user is root before try create the symlink.
Fix proposed to branch: master /review. openstack. org/637564
Review: https:/