Switch from OS_ENDPOINT_TYPE to OS_INTERFACE 69/58269/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Tue, 5 Jun 2018 19:31:43 +0000 (21:31 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Tue, 5 Jun 2018 19:46:05 +0000 (21:46 +0200)
It also set endpoint_type to public in tempest.conf if unset.

JIRA: FUNCTEST-975

Change-Id: I91bd1d7171b4bcf58dbe818696d5b864d5036619
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
functest/api/swagger/creds.yaml
functest/api/swagger/creds_action.yaml
functest/opnfv_tests/openstack/tempest/conf_utils.py
functest/tests/unit/openstack/tempest/test_conf_utils.py

index eec7cb3..4acc167 100644 (file)
@@ -23,9 +23,8 @@ responses:
             "OS_AUTH_URL": "https://192.16.1.222:5000/v3"
             "OS_AUTH_VERSION": "3"
             "OS_CACERT": "/home/opnfv/functest/conf/os_cacert"
-            "OS_ENDPOINT_TYPE": "publicURL"
             "OS_IDENTITY_API_VERSION": "3"
-            "OS_INTERFACE": "publicURL"
+            "OS_INTERFACE": "public"
             "OS_NO_CACHE": "1"
             "OS_PASSWORD": "990232e0885da343ac805528522d"
             "OS_PROJECT_DOMAIN_NAME": "Default"
index 7e7653b..c943422 100644 (file)
@@ -28,9 +28,8 @@ parameters:
                               description: this is the test case name
                               default:
                                   "OS_AUTH_URL": "http://192.16.1.222:5000/v3"
-                                  "OS_ENDPOINT_TYPE": "publicURL"
                                   "OS_IDENTITY_API_VERSION": "3"
-                                  "OS_INTERFACE": "publicURL"
+                                  "OS_INTERFACE": "public"
                                   "OS_PASSWORD": "admn"
                                   "OS_PROJECT_DOMAIN_NAME": "Default"
                                   "OS_PROJECT_NAME": "admin"
index 36ff77f..062d75e 100644 (file)
@@ -220,20 +220,19 @@ def configure_tempest_update_params(
     rconfig.set('object-storage', 'operator_role',
                 getattr(config.CONF, 'tempest_object_storage_operator_role'))
 
-    if os.environ.get('OS_ENDPOINT_TYPE') is not None:
-        rconfig.set('identity', 'v3_endpoint_type',
-                    os.environ.get('OS_ENDPOINT_TYPE'))
-
-    if os.environ.get('OS_ENDPOINT_TYPE') is not None:
-        sections = rconfig.sections()
-        services_list = [
-            'compute', 'volume', 'image', 'network', 'data-processing',
-            'object-storage', 'orchestration']
-        for service in services_list:
-            if service not in sections:
-                rconfig.add_section(service)
-            rconfig.set(service, 'endpoint_type',
-                        os.environ.get('OS_ENDPOINT_TYPE'))
+    rconfig.set(
+        'identity', 'v3_endpoint_type',
+        os.environ.get('OS_INTERFACE', 'public'))
+
+    sections = rconfig.sections()
+    services_list = [
+        'compute', 'volume', 'image', 'network', 'data-processing',
+        'object-storage', 'orchestration']
+    for service in services_list:
+        if service not in sections:
+            rconfig.add_section(service)
+        rconfig.set(
+            service, 'endpoint_type', os.environ.get('OS_INTERFACE', 'public'))
 
     LOGGER.debug('Add/Update required params defined in tempest_conf.yaml '
                  'into tempest.conf file')
index 91108e1..bc3c983 100644 (file)
@@ -168,7 +168,7 @@ class OSTempestConfUtilsTesting(unittest.TestCase):
             mock.patch('__builtin__.open', mock.mock_open()), \
             mock.patch('functest.utils.functest_utils.yaml.safe_load',
                        return_value={'validation': {'ssh_timeout': 300}}):
-            os.environ['OS_ENDPOINT_TYPE'] = ''
+            os.environ['OS_INTERFACE'] = ''
             if not alt:
                 conf_utils.configure_tempest_update_params(
                     'test_conf_file', image_id=image_id,