Tempest client with new user credentials always gets 'Unauthorized'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tempest |
New
|
Undecided
|
Unassigned |
Bug Description
I am writing a tempest scenario for keystone. In this scenario I create a domain, project and a user with admin rights on the project. I then try to instantiate a Manager, to have all the tempest clients with the new user credentials, but the clients constantly fail on every call with an 'Unauthorized' reply. I made sure that the permissions are fine by manually getting a token for this user and making a few calls successfully.
My code is provided below, in the hopes that someone will be able to fix it:
from tempest.test import BaseTestCase
from tempest import clients
from tempest.
from tempest.exceptions import Unauthorized
from tempest.auth import KeystoneV3Crede
from tempest.auth import KeystoneV3AuthP
class TestRbac (BaseTestCase):
_interface = 'json'
@classmethod
def setUpClass(cls):
cls.os_adm = clients.
cls.os = clients.
def setUp(self):
def tearDown(self):
def _delete_
# It is necessary to disable the domain before deleting,
# or else it would result in unauthorized error
def test_v3_
# create a domain
dom_name = data_utils.
resp, domain = self.os_
dom_id = domain['id']
# create a project in the domain
proj_name = data_utils.
resp, body = self.os_
proj_id = body['id']
# create a user in the domain, with the previous project as his default project
user_name = data_utils.
resp, body = self.os_
user_id = body['id']
# get roles and find the admin role
resp, body = self.os_
role_ids = [role['id'] for role in body if role['name'] == "admin"]
# grant the admin role to the user on his project
resp, body = self.os_
# create a new client with the new user's credentials
creds = KeystoneV3Crede
creds = auth_provider.
# list domains with the new credentials
resp, body = admin_client.