[openstack-qa] Issue with global variable

Jérôme Gallard jeronimo974 at gmail.com
Fri May 31 15:47:48 UTC 2013


Hi all,

I am working on a review: https://review.openstack.org/#/c/30760/7
I have an issue with global variables.

L123 of this file :
https://review.openstack.org/#/c/30760/7/tempest/api/volume/admin/test_multi_backend.py
there is a skipIf.
The skipIf depends of the "backends_have_same_name" global variable
(declared L30).
"backends_have_same_name is initialized at False.

During setUp, if backend1_name and backend2_name are equals,
"backends_have_same_name" is set to True (L41).

The issue is that, when backends_have_same_name is set to True (L41), it's
not taken into account on the skipIf (L123).

More details:
In my case, the skipIf is not working properly. In my tempest.conf I set
both backend name to the same name. Then, I run the following command:
nosetests -sv tempest/api/volume/admin/test_multi_backend.py.
I expect to get a "Backends configured with same name" (L124) but, instead
of that, I get an error:
----
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
tempest.api.volume.admin.test_multi_backend.VolumeMultiBackendTest.test_backend_name_distinction[gate]
... ERROR
tempest.api.volume.admin.test_multi_backend.VolumeMultiBackendTest.test_backend_name_reporting[gate,smoke]
... ok

======================================================================
ERROR:
tempest.api.volume.admin.test_multi_backend.VolumeMultiBackendTest.test_backend_name_distinction[gate]
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/opt/stack/tempest/tempest/api/volume/admin/test_multi_backend.py",
line 132, in test_backend_name_distinction
    resp, fetched_volume = self.client.get_volume(self.volume2['id'])
AttributeError: 'VolumeMultiBackendTest' object has no attribute 'volume2'
----

But of course, I understand this error, because, "volume2" was never
created (L76).

May someone has an idea about why this skip is not taken into account?

Thanks a lot!

Regards,
Jérôme
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-qa/attachments/20130531/6c0fc1e5/attachment.html>


More information about the openstack-qa mailing list