aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/test_impl_ifcfg.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-10-12 07:57:35 +0000
committerGerrit Code Review <review@openstack.org>2015-10-12 07:57:35 +0000
commitcf68668803886fb68b0f0a4a33edf65cf17c6b7c (patch)
tree3415170b00d922626b110b57bde0f597076dc11b /os_net_config/tests/test_impl_ifcfg.py
parent95a8412bd9a80ce1e15363ae6c1a51db9432f9d7 (diff)
parent62bc734ad540cde0cf47b863db686b328d575d33 (diff)
Merge "Add support for Linux Bonding to os-net-config ifcfg"
Diffstat (limited to 'os_net_config/tests/test_impl_ifcfg.py')
-rw-r--r--os_net_config/tests/test_impl_ifcfg.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py
index f8864c4..cb2e881 100644
--- a/os_net_config/tests/test_impl_ifcfg.py
+++ b/os_net_config/tests/test_impl_ifcfg.py
@@ -146,6 +146,15 @@ BOND_IFACES="em1 em2"
"""
+_LINUX_BOND_DHCP = """# This file is autogenerated by os-net-config
+DEVICE=bond0
+ONBOOT=yes
+HOTPLUG=no
+NM_CONTROLLED=no
+BOOTPROTO=dhcp
+"""
+
+
class TestIfcfgNetConfig(base.TestCase):
def setUp(self):
@@ -321,6 +330,15 @@ BOOTPROTO=none
self.assertEqual(_OVS_BOND_DHCP,
self.get_interface_config('bond0'))
+ def test_linux_bond(self):
+ interface1 = objects.Interface('em1')
+ interface2 = objects.Interface('em2')
+ bond = objects.LinuxBond('bond0', use_dhcp=True,
+ members=[interface1, interface2])
+ self.provider.add_linux_bond(bond)
+ self.assertEqual(_LINUX_BOND_DHCP,
+ self.get_interface_config('bond0'))
+
def test_interface_defroute(self):
interface1 = objects.Interface('em1')
interface2 = objects.Interface('em2', defroute=False)