From: Leslie Giles Date: Fri, 24 Feb 2017 18:50:20 +0000 (-0500) Subject: One more CAL refactor change X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=e3557154a55e8b611eae0e2cadf922947dd5461e;p=osm%2FSO.git One more CAL refactor change Signed-off-by: Leslie Giles --- 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'})