Ask Your Question
1

Issue when running tempest: AttributeError

asked 2013-05-13 16:21:37 -0500

robparrott gravatar image

Hi Folks,

I'm working on a reproducible build for Grizzly, and want to run a set of tempest tests at the end of the build process. I'm pulling the grizzly branch of tempest from GitHub, and configure tempest.conf. When I run a set of tests, some work, but then I get failures which seem to be related to python and the nose, and not OpenStack. Here's an example error:

======================================================================
ERROR: Failure: AttributeError ('module' object has no attribute 'attr')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/nose/loader.py", line 364, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.6/site-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.6/site-packages/nose/importer.py", line 84, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/tmp/tempest/tempest/tests/identity/admin/test_tenants.py", line 24, in <module>
    class TenantsTestJSON(base.BaseIdentityAdminTest):
  File "/tmp/tempest/tempest/tests/identity/admin/test_tenants.py", line 61, in TenantsTestJSON
    @attr(type='negative')
  File "/tmp/tempest/tempest/test.py", line 46, in decorator
    return nose.plugins.attrib.attr(*args, **kwargs)(f)
AttributeError: 'module' object has no attribute 'attr'

From poking around in the code, this seems to occur for all tests that are decorated with

@attr(type='negative')

and occurs on the "else: return ..." in this decorator function:

def attr(*args, **kwargs):

    def decorator(f):
        testtool_attributes = ('smoke')

        if 'type' in kwargs and kwargs['type'] in testtool_attributes:
            return nose.plugins.attrib.attr(*args, **kwargs)(
                testtools.testcase.attr(kwargs['type'])(f))
        else:
            return nose.plugins.attrib.attr(*args, **kwargs)(f)

    return decorator

However, some tests that are decorated with @attr(typr='smoke') appear to work OK.

Can anyone provide a hint on what I'm missing here?

System is CentOS 6.4 using RDO packages. Python is 2.6 and nose is python-nose-0.10.4-3.1.el6.noarch

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
3

answered 2013-05-14 10:00:43 -0500

robparrott gravatar image

FWIW, this was due to an old version of nosetests, which didn't include the "attrib.py" module. It may be useful for the tempest folks to make the version requirements more explicit.

edit flag offensive delete link more

Comments

1

thanks for posting the solution here. Have you already filed a bug on https://bugs.launchpad.net/tempest?

smaffulli gravatar imagesmaffulli ( 2013-05-15 20:48:35 -0500 )edit
0

answered 2015-11-05 22:12:22 -0500

shashidhar gravatar image

Please try "Kilo" release of OpenStack, which is latest and this may not have the issues that you have reported. Choose the stable version from the git say for example “Juno” or any latest release.

$ git clone -b stable/juno https://github.com/OpenStack-dev/devs...

Cloning into 'devstack'... remote: Counting objects: 28160, done. remote: Compressing objects: 100% (14/14), done. remote: Total 28160 (delta 3), reused 0 (delta 0), pack-reused 28146 Receiving objects: 100% (28160/28160), 9.59 MiB | 6.00 KiB/s, done. Resolving deltas: 100% (19543/19543), done. Checking connectivity... done.

edit flag offensive delete link more

Comments

I have run refstack bucket and still see the same behavior as described here. If commenting out the @attr(type='negative'), then those test cases would run fine. Any additional suggestion? Thx.

tuannguyen gravatar imagetuannguyen ( 2016-02-18 10:40:29 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2013-05-13 16:21:37 -0500

Seen: 1,395 times

Last updated: Nov 05 '15