diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-12 09:52:21 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-12 09:55:29 +0200 |
commit | ffbd6a2df2298b3277530f18a447abd34f35ed9f (patch) | |
tree | d0b3b9996a8e013a35b5a540ddc8523cced83c56 | |
parent | 9ee6578f53897adfb08fb810d243b35bd1ed2b23 (diff) |
Protect vs former interface format
Compass still set publicURL [1]
[1] https://build.opnfv.org/ci/view/functest/job/functest-compass-baremetal-daily-fraser/lastFailedBuild/consoleFull
Change-Id: I88c6ca336a7017f97f4c07719156e567d1afb9df
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 06b9ace7a0333d723972502ab3ce5784b6cba689)
-rw-r--r-- | functest/opnfv_tests/sdn/odl/odl.py | 6 | ||||
-rw-r--r-- | functest/tests/unit/odl/test_odl.py | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/functest/opnfv_tests/sdn/odl/odl.py b/functest/opnfv_tests/sdn/odl/odl.py index 9ba2931f0..0da71b23f 100644 --- a/functest/opnfv_tests/sdn/odl/odl.py +++ b/functest/opnfv_tests/sdn/odl/odl.py @@ -161,8 +161,10 @@ class ODLTests(robotframework.RobotFramework): cloud_config=os_client_config.get_config()) neutron_id = cloud.search_services('neutron')[0].id endpoint = cloud.search_endpoints( - filters={'interface': os.environ.get('OS_INTERFACE', 'public'), - 'service_id': neutron_id})[0].url + filters={ + 'interface': os.environ.get( + 'OS_INTERFACE', 'public').replace('URL', ''), + 'service_id': neutron_id})[0].url kwargs = {'neutronurl': endpoint} kwargs['odlip'] = env.get('SDN_CONTROLLER_IP') kwargs['odlwebport'] = '8080' diff --git a/functest/tests/unit/odl/test_odl.py b/functest/tests/unit/odl/test_odl.py index 5d147a96b..0e11f796a 100644 --- a/functest/tests/unit/odl/test_odl.py +++ b/functest/tests/unit/odl/test_odl.py @@ -398,8 +398,10 @@ class ODLRunTesting(ODLTesting): args[0].assert_called_once_with(cloud_config=mock.ANY) args[0].return_value.search_services.assert_called_once_with('neutron') args[0].return_value.search_endpoints.assert_called_once_with( - filters={'interface': os.environ.get("OS_INTERFACE", "public"), - 'service_id': self._neutron_id}) + filters={ + 'interface': os.environ.get( + "OS_INTERFACE", "public").replace('URL', ''), + 'service_id': self._neutron_id}) @mock.patch('os_client_config.get_config') @mock.patch('shade.OperatorCloud') @@ -486,6 +488,13 @@ class ODLRunTesting(ODLTesting): odlip=self._sdn_controller_ip, odlwebport=self._odl_webport) + def test_os_interface_publicurl(self): + os.environ["OS_INTERFACE"] = "publicURL" + os.environ["SDN_CONTROLLER_IP"] = self._sdn_controller_ip + self._test_run(testcase.TestCase.EX_OK, None, + odlip=self._sdn_controller_ip, + odlwebport=self._odl_webport) + def test_os_interface_internal(self): os.environ["OS_INTERFACE"] = "internal" os.environ["SDN_CONTROLLER_IP"] = self._sdn_controller_ip |