Bug 1370240

Summary: Tempest validation in OSP 9 doesn't work
Product: Red Hat OpenStack Reporter: Ramon Acedo <racedoro>
Component: openstack-manilaAssignee: Tom Barron <tbarron>
Status: CLOSED ERRATA QA Contact: nlevinki <nlevinki>
Severity: unspecified Docs Contact: Don Domingo <ddomingo>
Priority: unspecified    
Version: 9.0 (Mitaka)CC: apevec, dmellado, dschoenb, egafford, jschluet, lhh, mapiccin, slinaber, tbarron
Target Milestone: asyncKeywords: ZStream
Target Release: 9.0 (Mitaka)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-manila-2.0.0-6.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-05 19:13:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ramon Acedo 2016-08-25 17:04:10 UTC
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".

Comment 2 Dustin Schoenbrun 2016-08-25 17:22:33 UTC
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.

Comment 4 Ramon Acedo 2016-08-26 09:52:32 UTC
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.

Comment 7 errata-xmlrpc 2016-10-05 19:13:10 UTC
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