summaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/test_objects.py
diff options
context:
space:
mode:
authorSaravanan KR <skramaja@redhat.com>2016-07-30 15:22:57 +0530
committerSaravanan KR <skramaja@redhat.com>2016-08-26 15:26:28 +0530
commit9108fcb7bb1fa10ffce2fd787278802ee3f3354c (patch)
treedd7dc512b234d48e3bde4bde45a347fc12688cc6 /os_net_config/tests/test_objects.py
parent6d046bca3c7c63993782ba6646ecdf530a643297 (diff)
Add support for OVS DPDK Bond
Add functionality to os-net-config to allow DPDK bonding of interfaces, and implement support for parameters to be passed by TripleO Heat Templates. Implements: blueprint tripleo-ovs-dpdk Depends-On: Id4a23ced28b92a642c180a35c55080e5f4e2e05d Change-Id: If1c91402d2d393140dc1b4a678e68a1bcdbe81e4
Diffstat (limited to 'os_net_config/tests/test_objects.py')
-rw-r--r--os_net_config/tests/test_objects.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/os_net_config/tests/test_objects.py b/os_net_config/tests/test_objects.py
index 7e8441c..92d43b9 100644
--- a/os_net_config/tests/test_objects.py
+++ b/os_net_config/tests/test_objects.py
@@ -830,3 +830,49 @@ class TestNicMapping(base.TestCase):
expected = {}
# This only emits a warning, so it should still work
self.assertEqual(expected, objects._mapped_nics())
+
+
+class TestOvsDpdkBond(base.TestCase):
+
+ def test_from_json_dhcp(self):
+ data = """{
+"type": "ovs_dpdk_bond",
+"name": "dpdkbond0",
+"use_dhcp": true,
+"members": [
+ {
+ "type": "ovs_dpdk_port",
+ "name": "dpdk0",
+ "members": [
+ {
+ "type": "interface",
+ "name": "eth1"
+ }
+ ]
+ },
+ {
+ "type": "ovs_dpdk_port",
+ "name": "dpdk1",
+ "members": [
+ {
+ "type": "interface",
+ "name": "eth2"
+ }
+ ]
+ }
+]
+}
+"""
+ bond = objects.object_from_json(json.loads(data))
+ self.assertEqual("dpdkbond0", bond.name)
+ self.assertTrue(bond.use_dhcp)
+ dpdk_port0 = bond.members[0]
+ self.assertEqual("dpdk0", dpdk_port0.name)
+ self.assertEqual("vfio-pci", dpdk_port0.driver)
+ iface1 = dpdk_port0.members[0]
+ self.assertEqual("eth1", iface1.name)
+ dpdk_port1 = bond.members[1]
+ self.assertEqual("dpdk1", dpdk_port1.name)
+ self.assertEqual("vfio-pci", dpdk_port1.driver)
+ iface2 = dpdk_port1.members[0]
+ self.assertEqual("eth2", iface2.name)