User credentials not being released when skipException is raised on resource_setup()

Bug #1846236 reported by Douglas Viroel on 2019-10-01
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Douglas Viroel

Bug Description

Manila tempest plugin is facing issues due to insufficient user credentials after skipping some tests. The Manila test class is raising a skipException during the resource_setup method and the credentials are not being release by the setUpClass.

setUpClass (manila_tempest_tests.tests.api.admin.test_migration.MigrationCancelNFSTest) ... SKIPPED: ('Share migration tests are disabled.',)
setUpClass (manila_tempest_tests.tests.api.admin.test_migration.MigrationOfShareWithSnapshotNFSTest) [0.000000s] ... FAILED

'Traceback (most recent call last):'
' File "/opt/stack/new/tempest/tempest/", line 213, in setUpClass'
' six.reraise(etype, value, trace)'
' File "/usr/local/lib/python3.7/dist-packages/", line 693, in reraise'
' raise value'
' File "/opt/stack/new/tempest/tempest/", line 196, in setUpClass'
' cls.setup_credentials()'
' File "/opt/stack/new/tempest/tempest/", line 417, in setup_credentials'
' credential_type=credentials_type)'
' File "/opt/stack/new/tempest/tempest/", line 722, in get_client_manager'
' creds = getattr(cred_provider, credentials_method)()'
' File "/opt/stack/new/tempest/tempest/lib/common/", line 324, in get_admin_creds'
' return self.get_creds_by_roles([self.admin_role])'
' File "/opt/stack/new/tempest/tempest/lib/common/", line 315, in get_creds_by_roles'
' net_creds = self._get_creds(roles=roles)'
' File "/opt/stack/new/tempest/tempest/lib/common/", line 248, in _get_creds'
' free_hash = self._get_free_hash(useable_hashes)'
' File "/usr/local/lib/python3.7/dist-packages/oslo_concurrency/", line 328, in inner'
' return f(*args, **kwargs)'
' File "/opt/stack/new/tempest/tempest/lib/common/", line 203, in _get_free_hash'
' raise lib_exc.InvalidCredentials(msg)'
'tempest.lib.exceptions.InvalidCredentials: Invalid Credentials'
'Details: Insufficient number of users provided. MigrationCancelNFSTest have allocated all the credentials for this allocation request'

The fix seems to be capturing the exception by isn't calling the tearDownClass to cleanup() the allocated resources.

Python version: 3.7
Tempest conf:

Fix proposed to branch: master

Changed in tempest:
assignee: nobody → Douglas Viroel (dviroel)
status: New → In Progress

Submitter: Zuul
Branch: master

commit 7155fdfdf69dcf131742d50e61593d15c214b97b
Author: Douglas Viroel <email address hidden>
Date: Tue Oct 1 13:34:52 2019 -0300

    Call tearDownClass when handling skip exception on setUpClass

    In setUpClass, the workaround to handle skip exception issue is
    not releasing allocated resources when a skip exception is raised
    on resource_setup.

    Change-Id: I2a5d5d60d524bd141b8ad0ffd436040906a2f36a
    Closes-Bug: #1846236

Changed in tempest:
status: In Progress → Fix Released

This issue was fixed in the openstack/tempest 22.0.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers