X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=RO-VIM-openstack%2Fosm_rovim_openstack%2Ftests%2Ftest_vimconn_openstack.py;h=09991244a2e748571bb39bc7bbc33993fb8b6cae;hp=c5f7038ad7b8daac6e50a3937eb690d9e19ecd8e;hb=562623c1fc60ffb0756070f48943bfc8bb428202;hpb=b70f4ed7ed2bce01050a05ea01f9c676200edac9 diff --git a/RO-VIM-openstack/osm_rovim_openstack/tests/test_vimconn_openstack.py b/RO-VIM-openstack/osm_rovim_openstack/tests/test_vimconn_openstack.py index c5f7038a..09991244 100644 --- a/RO-VIM-openstack/osm_rovim_openstack/tests/test_vimconn_openstack.py +++ b/RO-VIM-openstack/osm_rovim_openstack/tests/test_vimconn_openstack.py @@ -25,6 +25,7 @@ Run this directly with python2 or python3. """ import copy +import logging import unittest import mock @@ -37,8 +38,13 @@ __date__ = "$23-aug-2017 23:59:59$" class TestSfcOperations(unittest.TestCase): - def setUp(self): - # instantiate dummy VIM connector so we can test it + @mock.patch("logging.getLogger", autospec=True) + def setUp(self, mock_logger): + # Instantiate dummy VIM connector so we can test it + # It throws exception because of dummy parameters, + # We are disabling the logging of exception not to print them to console. + mock_logger = logging.getLogger() + mock_logger.disabled = True self.vimconn = vimconnector( "123", "openstackvim", @@ -210,10 +216,15 @@ class TestSfcOperations(unittest.TestCase): # call the VIM connector if sfc_encap is None: + dict_to_neutron["port_chain"]["chain_parameters"] = {"correlation": "mpls"} if spi is None: - result = self.vimconn.new_sfp(name, classifications, sfs) + result = self.vimconn.new_sfp( + name, classifications, sfs, sfc_encap=False + ) else: - result = self.vimconn.new_sfp(name, classifications, sfs, spi=spi) + result = self.vimconn.new_sfp( + name, classifications, sfs, sfc_encap=False, spi=spi + ) else: if spi is None: result = self.vimconn.new_sfp(name, classifications, sfs, sfc_encap) @@ -360,8 +371,8 @@ class TestSfcOperations(unittest.TestCase): @mock.patch.object(Client, "create_sfc_port_chain") def test_new_sfp_without_sfc_encap(self, create_sfc_port_chain): - self._test_new_sfp(create_sfc_port_chain, False, None) - self._test_new_sfp(create_sfc_port_chain, False, 25) + self._test_new_sfp(create_sfc_port_chain, None, None) + self._test_new_sfp(create_sfc_port_chain, None, 25) @mock.patch.object(Client, "create_sfc_port_chain") def test_new_sfp_default_sfc_encap(self, create_sfc_port_chain):