Merge "Revert changes removing OVSBridge return"
This commit is contained in:
commit
49acad12bd
@ -75,6 +75,7 @@ class BaseOVS(object):
|
|||||||
|
|
||||||
def add_bridge(self, bridge_name):
|
def add_bridge(self, bridge_name):
|
||||||
self.run_vsctl(["--", "--may-exist", "add-br", bridge_name])
|
self.run_vsctl(["--", "--may-exist", "add-br", bridge_name])
|
||||||
|
return OVSBridge(bridge_name, self.root_helper)
|
||||||
|
|
||||||
def delete_bridge(self, bridge_name):
|
def delete_bridge(self, bridge_name):
|
||||||
self.run_vsctl(["--", "--if-exists", "del-br", bridge_name])
|
self.run_vsctl(["--", "--if-exists", "del-br", bridge_name])
|
||||||
|
@ -42,9 +42,12 @@ class TestBaseOVS(base.BaseTestCase):
|
|||||||
|
|
||||||
def test_add_bridge(self):
|
def test_add_bridge(self):
|
||||||
with mock.patch.object(self.ovs, 'run_vsctl') as mock_vsctl:
|
with mock.patch.object(self.ovs, 'run_vsctl') as mock_vsctl:
|
||||||
self.ovs.add_bridge(self.br_name)
|
bridge = self.ovs.add_bridge(self.br_name)
|
||||||
|
|
||||||
mock_vsctl.assert_called_with(["--", "--may-exist",
|
mock_vsctl.assert_called_with(["--", "--may-exist",
|
||||||
"add-br", self.br_name])
|
"add-br", self.br_name])
|
||||||
|
self.assertEqual(bridge.br_name, self.br_name)
|
||||||
|
self.assertEqual(bridge.root_helper, self.ovs.root_helper)
|
||||||
|
|
||||||
def test_delete_bridge(self):
|
def test_delete_bridge(self):
|
||||||
with mock.patch.object(self.ovs, 'run_vsctl') as mock_vsctl:
|
with mock.patch.object(self.ovs, 'run_vsctl') as mock_vsctl:
|
||||||
|
Loading…
Reference in New Issue
Block a user