Refactor Keystone test to use OpenStackSDK
By using OpenStack SDK, the tests are more uniform, and we reduce the direct dependencies we have to install. Change-Id: Ic5ee06367904ba6bc569399432908de1b08233cd
This commit is contained in:
parent
72e1f18036
commit
bf6a0ac805
@ -148,19 +148,12 @@ class KeystoneTest(ServiceTest):
|
||||
description = 'Obtain a token then a project list to validate it worked'
|
||||
|
||||
def run(self):
|
||||
self.get_connection()
|
||||
|
||||
auth_url = os.environ['OS_AUTH_URL']
|
||||
password = os.environ['OS_PASSWORD']
|
||||
|
||||
auth = v3.Password(auth_url=auth_url, username="admin",
|
||||
password=password, project_name="admin",
|
||||
user_domain_id="default",
|
||||
project_domain_id="default")
|
||||
|
||||
sess = session.Session(auth=auth)
|
||||
keystone = key_client.Client(session=sess)
|
||||
keystone.projects.list()
|
||||
msg = "Project list retrieved"
|
||||
projects = self.get_objects('identity', 'projects')
|
||||
msg = "API reached, no projects found."
|
||||
if projects:
|
||||
msg = "Project list retrieved"
|
||||
return msg
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user