Add sahara_service_type support for auth for sahara
Add support setting up service type for sahara in scenario integration tests. It's needed for support various service types in service catalog. Change-Id: I18af5ee1c3e8d6a67dad821890a35dce42e1cccf
This commit is contained in:
parent
6ffcedf219
commit
fe42710aa0
@ -59,19 +59,21 @@ Section "credential"
|
||||
|
||||
This section is dictionary-type.
|
||||
|
||||
+-------------+--------+----------+------------------------------+-------------------------+
|
||||
+---------------------+--------+----------+------------------------------+-------------------------+
|
||||
| Fields | Type | Required | Default | Value |
|
||||
+=============+========+==========+==============================+=========================+
|
||||
+=====================+========+==========+==============================+=========================+
|
||||
| os_username | string | True | admin | user name for login |
|
||||
+-------------+--------+----------+------------------------------+-------------------------+
|
||||
+---------------------+--------+----------+------------------------------+-------------------------+
|
||||
| os_password | string | True | nova | password name for login |
|
||||
+-------------+--------+----------+------------------------------+-------------------------+
|
||||
+---------------------+--------+----------+------------------------------+-------------------------+
|
||||
| os_tenant | string | True | admin | tenant name |
|
||||
+-------------+--------+----------+------------------------------+-------------------------+
|
||||
+---------------------+--------+----------+------------------------------+-------------------------+
|
||||
| os_auth_url | string | True | `http://localhost:5000/v2.0` | url for login |
|
||||
+-------------+--------+----------+------------------------------+-------------------------+
|
||||
+---------------------+--------+----------+------------------------------+-------------------------+
|
||||
| sahara_service_type | string | | data-processing | service type for sahara |
|
||||
+---------------------+--------+----------+------------------------------+-------------------------+
|
||||
| sahara_url | string | | None | url of sahara |
|
||||
+-------------+--------+----------+------------------------------+-------------------------+
|
||||
+---------------------+--------+----------+------------------------------+-------------------------+
|
||||
|
||||
|
||||
Section "network"
|
||||
|
@ -93,12 +93,14 @@ class BaseTestCase(base.BaseTestCase):
|
||||
password = self.credentials['os_password']
|
||||
tenant_name = self.credentials['os_tenant']
|
||||
auth_url = self.credentials['os_auth_url']
|
||||
sahara_service_type = self.credentials['sahara_service_type']
|
||||
sahara_url = self.credentials['sahara_url']
|
||||
|
||||
self.sahara = clients.SaharaClient(username=username,
|
||||
api_key=password,
|
||||
project_name=tenant_name,
|
||||
auth_url=auth_url,
|
||||
service_type=sahara_service_type,
|
||||
sahara_url=sahara_url)
|
||||
self.nova = clients.NovaClient(username=username,
|
||||
api_key=password,
|
||||
|
@ -40,6 +40,7 @@ def set_defaults(config):
|
||||
creds['os_tenant'] = creds.get('os_tenant', 'admin')
|
||||
creds['os_auth_url'] = creds.get('os_auth_url',
|
||||
'http://localhost:5000/v2.0')
|
||||
creds.setdefault('sahara_service_type', 'data-processing')
|
||||
creds['sahara_url'] = creds.get('sahara_url', None)
|
||||
|
||||
# set up network
|
||||
|
@ -43,6 +43,10 @@ SCHEMA = {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"sahara_service_type": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"sahara_url": {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
|
@ -66,6 +66,8 @@ class TestBase(testtools.TestCase):
|
||||
'os_tenant': 'admin',
|
||||
'os_auth_url':
|
||||
'http://localhost:5000/v2.0',
|
||||
'sahara_service_type':
|
||||
'data-processing-local',
|
||||
'sahara_url':
|
||||
'http://sahara_host:8386/v1.1'}
|
||||
self.base_scenario.plugin_opts = {'plugin_name': 'vanilla',
|
||||
@ -141,6 +143,7 @@ class TestBase(testtools.TestCase):
|
||||
api_key='nova',
|
||||
project_name='admin',
|
||||
auth_url='http://localhost:5000/v2.0',
|
||||
service_type='data-processing-local',
|
||||
sahara_url='http://sahara_host:8386/v1.1')
|
||||
nova.assert_called_with('2',
|
||||
username='admin',
|
||||
|
@ -44,6 +44,7 @@ class RunnerUnitTest(testtools.TestCase):
|
||||
"os_username": "admin",
|
||||
"os_auth_url": "http://localhost:5000/v2.0",
|
||||
"sahara_url": None,
|
||||
"sahara_service_type": "data-processing",
|
||||
"os_password": "nova",
|
||||
"os_tenant": "admin"
|
||||
}
|
||||
@ -143,7 +144,8 @@ class RunnerUnitTest(testtools.TestCase):
|
||||
"os_auth_url": "http://127.0.0.1:5000/v2.0",
|
||||
"sahara_url": "http://127.0.0.1",
|
||||
"os_password": "changed_nova",
|
||||
"os_tenant": "changed_admin"
|
||||
"os_tenant": "changed_admin",
|
||||
"sahara_service_type": "data-processing"
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user