From 0123f521239b8d621fa2cfc5513215ce0605734e Mon Sep 17 00:00:00 2001 From: Soniya Vyas Date: Thu, 24 Sep 2020 17:43:26 +0530 Subject: [PATCH] Need to have stable implementation of apis The implementation of method create_port() varies between plugins and scenario manager. This patch addresses the same requirement to make scenario_manager stable Implements: blueprint tempest-scenario-manager-stable Signed-off by: Soniya Vyas Change-Id: Ia743c3a93a0b8e9ffe995db8046047b6e87458c1 --- tempest/scenario/manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py index ff860d5b90..13ad4c1833 100644 --- a/tempest/scenario/manager.py +++ b/tempest/scenario/manager.py @@ -143,10 +143,10 @@ class ScenarioTest(tempest.test.BaseTestCase): # resp part which is not used in scenario tests def create_port(self, network_id, client=None, **kwargs): - """Creates port""" + """Creates port for the respective network_id""" if not client: client = self.ports_client - name = data_utils.rand_name(self.__class__.__name__) + name = kwargs.pop('namestart', self.__class__.__name__) if CONF.network.port_vnic_type and 'binding:vnic_type' not in kwargs: kwargs['binding:vnic_type'] = CONF.network.port_vnic_type if CONF.network.port_profile and 'binding:profile' not in kwargs: @@ -155,6 +155,7 @@ class ScenarioTest(tempest.test.BaseTestCase): name=name, network_id=network_id, **kwargs) + self.assertIsNotNone(result, 'Unable to allocate port') port = result['port'] self.addCleanup(test_utils.call_and_ignore_notfound_exc, client.delete_port, port['id'])