aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/test_impl_ifcfg.py
diff options
context:
space:
mode:
Diffstat (limited to 'os_net_config/tests/test_impl_ifcfg.py')
-rw-r--r--os_net_config/tests/test_impl_ifcfg.py14
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 db61795..c914ea2 100644
--- a/os_net_config/tests/test_impl_ifcfg.py
+++ b/os_net_config/tests/test_impl_ifcfg.py
@@ -39,6 +39,15 @@ IPADDR=192.168.1.2
NETMASK=255.255.255.0
"""
+_IFCFG_VLAN = """# This file is autogenerated by os-net-config
+DEVICE=em1.120
+ONBOOT=yes
+HOTPLUG=no
+NM_CONTROLLED=no
+VLAN=yes
+BOOTPROTO=none
+"""
+
_V4_IFCFG_MAPPED = _V4_IFCFG.replace('em1', 'nic1') + "HWADDR=a1:b2:c3:d4:e5\n"
_V4_IFCFG_MULTIPLE = _V4_IFCFG + """IPADDR1=192.168.1.3
@@ -199,6 +208,11 @@ class TestIfcfgNetConfig(base.TestCase):
self.provider.add_interface(interface)
self.assertEqual(_NO_IP, self.get_interface_config())
+ def test_add_base_interface_vlan(self):
+ interface = objects.Interface('em1.120')
+ self.provider.add_interface(interface)
+ self.assertEqual(_IFCFG_VLAN, self.get_interface_config('em1.120'))
+
def test_add_ovs_interface(self):
interface = objects.Interface('em1')
interface.ovs_port = True