<div dir="ltr">Hi all,<div><br></div><div style>I am working on a review: <a href="https://review.openstack.org/#/c/30760/7">https://review.openstack.org/#/c/30760/7</a></div><div style>I have an issue with global variables.</div>

<div style><br></div><div style>L123 of this file : <a href="https://review.openstack.org/#/c/30760/7/tempest/api/volume/admin/test_multi_backend.py">https://review.openstack.org/#/c/30760/7/tempest/api/volume/admin/test_multi_backend.py</a></div>

<div style>there is a skipIf.</div><div style>The skipIf depends of the "backends_have_same_name" global variable (declared L30).</div><div style>"backends_have_same_name is initialized at False.</div><div style>

<br></div><div style>During setUp, if backend1_name and backend2_name are equals, "backends_have_same_name" is set to True (L41).</div><div style><br></div><div style>The issue is that, when backends_have_same_name is set to True (L41), it's not taken into account on the skipIf (L123).</div>

<div style><br></div><div style>More details:</div><div style>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.</div>

<div style>I expect to get a "Backends configured with same name" (L124) but, instead of that, I get an error:</div><div style>----</div><div style><div>nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']</div>

<div>tempest.api.volume.admin.test_multi_backend.VolumeMultiBackendTest.test_backend_name_distinction[gate] ... ERROR</div><div>tempest.api.volume.admin.test_multi_backend.VolumeMultiBackendTest.test_backend_name_reporting[gate,smoke] ... ok</div>

<div><br></div><div>======================================================================</div><div>ERROR: tempest.api.volume.admin.test_multi_backend.VolumeMultiBackendTest.test_backend_name_distinction[gate]</div><div>

----------------------------------------------------------------------</div><div>_StringException: Traceback (most recent call last):</div><div>  File "/opt/stack/tempest/tempest/api/volume/admin/test_multi_backend.py", line 132, in test_backend_name_distinction</div>

<div>    resp, fetched_volume = self.client.get_volume(self.volume2['id'])</div><div>AttributeError: 'VolumeMultiBackendTest' object has no attribute 'volume2'</div><div>----</div><div><br></div><div style>

But of course, I understand this error, because, "volume2" was never created (L76).</div><div style><br></div><div style>May someone has an idea about why this skip is not taken into account?</div><div style><br>

</div><div style>Thanks a lot!</div><div style><br></div><div style>Regards,</div><div style>Jérôme</div></div></div>