Hide Forgot
When trying to validate the Overcloud with Tempest as described in our documentation at https://access.redhat.com/documentation/en/red-hat-openstack-platform/9/single/director-installation-and-usage#sect-Validating_the_Overcloud and after having installed openstack-tempest the tests can't be run due to "ImportError: cannot import name test_utils" [stack@undercloud-1 tempest]$ rpm -q python-manila-tests.noarch python-manila-tests-2.0.0-5.el7ost.noarch [stack@undercloud-1 tempest]$ rpm -q openstack-manila openstack-manila-2.0.0-5.el7ost.noarch [stack@undercloud-1 tempest]$ testr list-tests running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \ OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \ ${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --list /usr/lib/python2.7/site-packages/tempest_lib/__init__.py:28: DeprecationWarning: tempest-lib is deprecated for future bug-fixes and code changes in favor of tempest. Please change your imports from tempest_lib to tempest.lib DeprecationWarning) --- import errors --- Failed to import test module: manila_tempest_tests.tests.scenario.test_share_basic_ops Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/unittest2/loader.py", line 445, in _find_test_path module = self._get_module_from_name(name) File "/usr/lib/python2.7/site-packages/unittest2/loader.py", line 384, in _get_module_from_name __import__(name) File "/usr/lib/python2.7/site-packages/manila_tempest_tests/tests/scenario/test_share_basic_ops.py", line 19, in <module> from tempest.lib.common.utils import test_utils ImportError: cannot import name test_utils Non-zero exit code (2) from test listing. I have tried to skip the manila tests adding "manila = False" in the section "[service_available]" in etc/tempest.conf but it still fails. A similar behaviour is reported in https://bugzilla.redhat.com/show_bug.cgi?id=1293840 although the import error comes from "isolated_creds" instead of "test_utils".
I dug into this a little bit this morning and discovered that this is an issue with our Tempest package not including the test_utils.py file in the tempest/lib/common/utils directory. Without that, we cannot import that class. It's also known upstream that the Manila Tempest Scenario tests are in a bad way and need some serious tending to. A possible solution would be to bring the test_utils module into our shipped version of Tempest or to update the Manila Tempest Scenario tests to not use that library.
As a workaround, this worked for me: * Removed all the manila packages, including python-manilaclient, which is a dependency of openstack-tempest * Reinstalled openstack-tempest * Deleted the contents in tempest directory and recreated them with /usr/share/openstack-tempest-10.0.0/tools/configure-tempest-directory After this I can now run tempest tests from the Undercloud in OSP 9.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2033.html