summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-01-12 20:38:07 +0000
committerGerrit Code Review <review@openstack.org>2018-01-12 20:38:07 +0000
commit0df9383b7d9d5eaa59f29b4ffa1137ebd97ce8d0 (patch)
tree9c0c3990e3b9a150eae14c85c2f9535c6de3a93f
parentf999f3446e07caa9a33c2b54a29e8a41cf6ea43e (diff)
parent54ad53e5e90c1bbb0fb7743a715712c9c604cec1 (diff)
Merge "Stop using set_protocols() method from Neutron's ovs_lib"
-rwxr-xr-xnetworking_vsphere/agent/ovsvapp_agent.py2
-rwxr-xr-xnetworking_vsphere/tests/unit/agent/test_ovsvapp_agent.py26
2 files changed, 14 insertions, 14 deletions
diff --git a/networking_vsphere/agent/ovsvapp_agent.py b/networking_vsphere/agent/ovsvapp_agent.py
index a8b35a2..598cfca 100755
--- a/networking_vsphere/agent/ovsvapp_agent.py
+++ b/networking_vsphere/agent/ovsvapp_agent.py
@@ -403,7 +403,7 @@ class OVSvAppAgent(agent.Agent, ovs_agent.OVSNeutronAgent):
403 def set_openflow_version(self, bridge): 403 def set_openflow_version(self, bridge):
404 try: 404 try:
405 if bridge is not None: 405 if bridge is not None:
406 bridge.set_protocols( 406 bridge.add_protocols(
407 ["OpenFlow%d" % i for i in range(10, 15)]) 407 ["OpenFlow%d" % i for i in range(10, 15)])
408 except RuntimeError as e: 408 except RuntimeError as e:
409 LOG.error(_LE("Unable to set openflow version: %s"), e) 409 LOG.error(_LE("Unable to set openflow version: %s"), e)
diff --git a/networking_vsphere/tests/unit/agent/test_ovsvapp_agent.py b/networking_vsphere/tests/unit/agent/test_ovsvapp_agent.py
index 4ba15a4..cf13cbd 100755
--- a/networking_vsphere/tests/unit/agent/test_ovsvapp_agent.py
+++ b/networking_vsphere/tests/unit/agent/test_ovsvapp_agent.py
@@ -249,16 +249,16 @@ class TestOVSvAppAgentRestart(base.TestCase):
249 mock.patch.object(self.agent.int_br, 'get_port_name_list', 249 mock.patch.object(self.agent.int_br, 'get_port_name_list',
250 return_value=int_br_ports 250 return_value=int_br_ports
251 ) as mock_br_get_ports, \ 251 ) as mock_br_get_ports, \
252 mock.patch.object(self.agent.int_br, "set_protocols" 252 mock.patch.object(self.agent.int_br, "add_protocols"
253 ) as mock_set_protocols: 253 ) as mock_add_protocols:
254 self.assertFalse(self.agent.check_ovsvapp_agent_restart()) 254 self.assertFalse(self.agent.check_ovsvapp_agent_restart())
255 self.assertTrue(mock_br_exists.called) 255 self.assertTrue(mock_br_exists.called)
256 self.assertTrue(mock_dump_flows.called) 256 self.assertTrue(mock_dump_flows.called)
257 self.assertFalse(mock_br_get_ports.called) 257 self.assertFalse(mock_br_get_ports.called)
258 self.assertTrue(mock_set_protocols.called) 258 self.assertTrue(mock_add_protocols.called)
259 mock_dump_flows.return_value = 'cookie = 0x0' 259 mock_dump_flows.return_value = 'cookie = 0x0'
260 self.assertTrue(self.agent.check_ovsvapp_agent_restart()) 260 self.assertTrue(self.agent.check_ovsvapp_agent_restart())
261 self.assertTrue(mock_set_protocols.called) 261 self.assertTrue(mock_add_protocols.called)
262 self.assertTrue(mock_br_exists.called) 262 self.assertTrue(mock_br_exists.called)
263 self.assertTrue(mock_dump_flows.called) 263 self.assertTrue(mock_dump_flows.called)
264 self.assertTrue(mock_br_get_ports.called) 264 self.assertTrue(mock_br_get_ports.called)
@@ -409,11 +409,11 @@ class TestOVSvAppAgent(base.TestCase):
409 "add_patch_port", 409 "add_patch_port",
410 return_value=6), \ 410 return_value=6), \
411 mock.patch.object(mock_ovs_br.return_value, 411 mock.patch.object(mock_ovs_br.return_value,
412 "set_protocols" 412 "add_protocols"
413 ) as mock_set_protocols: 413 ) as mock_add_protocols:
414 self.agent.setup_security_br() 414 self.agent.setup_security_br()
415 self.assertTrue(mock_ovs_br.called) 415 self.assertTrue(mock_ovs_br.called)
416 self.assertTrue(mock_set_protocols.called) 416 self.assertTrue(mock_add_protocols.called)
417 self.assertTrue(self.agent.sec_br.add_patch_port.called) 417 self.assertTrue(self.agent.sec_br.add_patch_port.called)
418 self.assertTrue(mock_logger_info.called) 418 self.assertTrue(mock_logger_info.called)
419 419
@@ -474,8 +474,8 @@ class TestOVSvAppAgent(base.TestCase):
474 mock.patch.object(p_utils, 'get_interface_name' 474 mock.patch.object(p_utils, 'get_interface_name'
475 ) as mock_int_name, \ 475 ) as mock_int_name, \
476 mock.patch.object(mock_ovs_br.return_value, 476 mock.patch.object(mock_ovs_br.return_value,
477 "set_protocols" 477 "add_protocols"
478 ) as mock_set_protocol, \ 478 ) as mock_add_protocol, \
479 mock.patch.object(self.agent.int_br, 479 mock.patch.object(self.agent.int_br,
480 "get_port_ofport", 480 "get_port_ofport",
481 return_value=6) as mock_get_ofport: 481 return_value=6) as mock_get_ofport:
@@ -483,7 +483,7 @@ class TestOVSvAppAgent(base.TestCase):
483 self.assertTrue(mock_logger_info.called) 483 self.assertTrue(mock_logger_info.called)
484 self.assertFalse(mock_logger_error.called) 484 self.assertFalse(mock_logger_error.called)
485 self.assertTrue(mock_ovs_br.called) 485 self.assertTrue(mock_ovs_br.called)
486 self.assertTrue(mock_set_protocol.called) 486 self.assertTrue(mock_add_protocol.called)
487 self.assertTrue(mock_get_ofport.called) 487 self.assertTrue(mock_get_ofport.called)
488 self.assertTrue(mock_int_name.called) 488 self.assertTrue(mock_int_name.called)
489 self.assertEqual(self.agent.int_ofports['physnet1'], 6) 489 self.assertEqual(self.agent.int_ofports['physnet1'], 6)
@@ -491,10 +491,10 @@ class TestOVSvAppAgent(base.TestCase):
491 def test_set_openflow_versions(self): 491 def test_set_openflow_versions(self):
492 bridge = mock.Mock() 492 bridge = mock.Mock()
493 with mock.patch.object(bridge, 493 with mock.patch.object(bridge,
494 "set_protocols" 494 "add_protocols"
495 ) as mock_set_protocol: 495 ) as mock_add_protocol:
496 self.agent.set_openflow_version(bridge) 496 self.agent.set_openflow_version(bridge)
497 self.assertTrue(mock_set_protocol.called) 497 self.assertTrue(mock_add_protocol.called)
498 498
499 def test_init_ovs_flows(self): 499 def test_init_ovs_flows(self):
500 cfg.CONF.set_override('bridge_mappings', 500 cfg.CONF.set_override('bridge_mappings',