diff options
author | Dan Sneddon <dsneddon@redhat.com> | 2016-03-08 16:35:33 -0800 |
---|---|---|
committer | Dan Sneddon <dsneddon@redhat.com> | 2016-03-11 10:22:36 -0800 |
commit | b0b09a65b68fa0297538bfbcc40c15655617721e (patch) | |
tree | 527f51d477c1cb08f2ae972e589ae7927c5409fe /os_net_config/tests | |
parent | 63659fe4a60dfb18bbc8cc835d6d1c4fe7317a60 (diff) |
Fix hierarchy for Linux Bonds and Linux Bridges
This change cleans up some of the Linux Bond and Linux Bridge logic
that processes member interfaces and VLANs.
One bug is fixed, where a VLAN might be assigned as a slave
interface on a bond.
Changes were made so that if VLANs are placed under a Linux Bond,
the PHYSDEV is set to the bond, so the device: does not need to
be specified in the config.
This change ensures that if a bridge has a bond and VLANs as members,
that the VLAN will be a member of the bridge and not the bond.
Change-Id: Id329737f0032e781b111741086ded83f378297a7
Diffstat (limited to 'os_net_config/tests')
-rw-r--r-- | os_net_config/tests/test_impl_ifcfg.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py index bf3ce7c..0390768 100644 --- a/os_net_config/tests/test_impl_ifcfg.py +++ b/os_net_config/tests/test_impl_ifcfg.py @@ -165,6 +165,11 @@ OVS_OPTIONS="tag=5" BOOTPROTO=none """ +_VLAN_LINUX_BRIDGE = _BASE_VLAN_OVS + """VLAN=yes +BRIDGE=br-ctlplane +BOOTPROTO=none +""" + _OVS_BOND_DHCP = """# This file is autogenerated by os-net-config DEVICE=bond0 @@ -417,6 +422,15 @@ class TestIfcfgNetConfig(base.TestCase): self.provider.add_bridge(bridge) self.assertEqual(_VLAN_OVS_BRIDGE, self.get_interface_config('vlan5')) + def test_add_linux_bridge_with_vlan(self): + vlan = objects.Vlan(None, 5) + bridge = objects.LinuxBridge('br-ctlplane', use_dhcp=True, + members=[vlan]) + self.provider.add_vlan(vlan) + self.provider.add_bridge(bridge) + self.assertEqual(_VLAN_LINUX_BRIDGE, + self.get_interface_config('vlan5')) + def test_ovs_bond(self): interface1 = objects.Interface('em1') interface2 = objects.Interface('em2') |