From 8620140ce5ce81fe437fc13201a35a3a30248bb1 Mon Sep 17 00:00:00 2001 From: Leslie Giles Date: Fri, 24 Feb 2017 13:50:20 -0500 Subject: [PATCH] One more CAL refactor change Signed-off-by: Leslie Giles --- rwlaunchpad/ra/pytest/conftest.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rwlaunchpad/ra/pytest/conftest.py b/rwlaunchpad/ra/pytest/conftest.py index fc094fae..80d739f6 100644 --- a/rwlaunchpad/ra/pytest/conftest.py +++ b/rwlaunchpad/ra/pytest/conftest.py @@ -23,6 +23,7 @@ import sys import rift.auto.log import rift.auto.session import rift.vcs.vcs +import rift.rwcal.openstack import logging import gi @@ -129,3 +130,22 @@ def cloud_account(cloud_accounts): ''' return cloud_accounts[0] +@pytest.fixture(scope='class') +def openstack_client(cloud_host, cloud_user, cloud_tenant): + """Fixture which returns a session to openstack host. + + Returns: + Session to an openstack host. + """ + password = 'mypasswd' + auth_url = 'http://{cloud_host}:5000/v3/'.format(cloud_host=cloud_host) + mgmt_network = os.getenv('MGMT_NETWORK', 'private') + return rift.rwcal.openstack.OpenstackDriver(**{'username': cloud_user, + 'password': password, + 'auth_url': auth_url, + 'project' : cloud_tenant, + 'mgmt_network': mgmt_network, + 'cert_validate': False, + 'user_domain': 'Default', + 'project_domain':'Default', + 'region': 'RegionOne'}) -- 2.25.1