Stub out check for OVS installed to avoid failing tests

The tests for the method that checks to see if OVS is installed
only pass if OVS is not installed. This change stubs out the
function so the tests pass on systems with OVS.

Closes-bug: #1783240

Change-Id: I70bee7a7556aada186ccec89dbe800c8eb870aa5
This commit is contained in:
Dan Sneddon 2018-07-23 19:22:44 -07:00
parent 5e1424f965
commit 6641c9f8c0
1 changed files with 9 additions and 0 deletions

View File

@ -1734,6 +1734,9 @@ class TestVppBond(base.TestCase):
class TestOvsRequiredObjects(base.TestCase):
def stub_is_ovs_installed(self):
return False
def test_ovs_bond(self):
data = """{
"type": "ovs_bond",
@ -1752,6 +1755,8 @@ class TestOvsRequiredObjects(base.TestCase):
}
"""
self.stub_out('os_net_config.utils.is_ovs_installed',
self.stub_is_ovs_installed)
err = self.assertRaises(objects.InvalidConfigException,
objects.OvsBond.from_json,
json.loads(data))
@ -1770,6 +1775,8 @@ class TestOvsRequiredObjects(base.TestCase):
}
"""
self.stub_out('os_net_config.utils.is_ovs_installed',
self.stub_is_ovs_installed)
err = self.assertRaises(objects.InvalidConfigException,
objects.OvsBridge.from_json,
json.loads(data))
@ -1785,6 +1792,8 @@ class TestOvsRequiredObjects(base.TestCase):
}
"""
self.stub_out('os_net_config.utils.is_ovs_installed',
self.stub_is_ovs_installed)
err = self.assertRaises(objects.InvalidConfigException,
objects.OvsDpdkPort.from_json,
json.loads(data))