aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/test_objects.py
diff options
context:
space:
mode:
authorSaravanan KR <skramaja@redhat.com>2016-08-24 11:41:18 +0530
committerSaravanan KR <skramaja@redhat.com>2016-08-26 15:30:58 +0530
commitf79d534c3e130bb539cf7ccb1d3f9586e922b9a7 (patch)
tree301a1a53d6213d7bfa0dfc331d5c2c6f797f7904 /os_net_config/tests/test_objects.py
parent9108fcb7bb1fa10ffce2fd787278802ee3f3354c (diff)
Supporting numbered nics for DPDK Port and DPDK Bond
Modified the sample code to use numbered nics instead of physical device name and added test code for testing the numbered nic usecases. Implements: blueprint tripleo-ovs-dpdk Depends-On: If1c91402d2d393140dc1b4a678e68a1bcdbe81e4 Change-Id: Ifadb495be57fcef56a97250de0c52fd03f2dd817
Diffstat (limited to 'os_net_config/tests/test_objects.py')
-rw-r--r--os_net_config/tests/test_objects.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/os_net_config/tests/test_objects.py b/os_net_config/tests/test_objects.py
index 92d43b9..2e5fbe4 100644
--- a/os_net_config/tests/test_objects.py
+++ b/os_net_config/tests/test_objects.py
@@ -834,7 +834,16 @@ class TestNicMapping(base.TestCase):
class TestOvsDpdkBond(base.TestCase):
+ # We want to test the function, not the dummy..
+ stub_mapped_nics = False
+
+ def _stub_active_nics(self, nics):
+ def dummy_ordered_active_nics():
+ return nics
+ self.stubs.Set(utils, 'ordered_active_nics', dummy_ordered_active_nics)
+
def test_from_json_dhcp(self):
+ self._stub_active_nics(['eth0', 'eth1', 'eth2'])
data = """{
"type": "ovs_dpdk_bond",
"name": "dpdkbond0",
@@ -846,7 +855,7 @@ class TestOvsDpdkBond(base.TestCase):
"members": [
{
"type": "interface",
- "name": "eth1"
+ "name": "nic2"
}
]
},
@@ -856,7 +865,7 @@ class TestOvsDpdkBond(base.TestCase):
"members": [
{
"type": "interface",
- "name": "eth2"
+ "name": "nic3"
}
]
}