diff options
Diffstat (limited to 'os_net_config/tests/test_impl_ifcfg.py')
-rw-r--r-- | os_net_config/tests/test_impl_ifcfg.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py index e32aff2..ec2a36c 100644 --- a/os_net_config/tests/test_impl_ifcfg.py +++ b/os_net_config/tests/test_impl_ifcfg.py @@ -331,6 +331,34 @@ DHCLIENTARGS=--foobar """ self.assertEqual(em1_config, self.get_interface_config('em1')) + def test_interface_single_dns_server(self): + interface1 = objects.Interface('em1', dns_servers=['1.2.3.4']) + self.provider.add_interface(interface1) + em1_config = """# This file is autogenerated by os-net-config +DEVICE=em1 +ONBOOT=yes +HOTPLUG=no +NM_CONTROLLED=no +BOOTPROTO=none +DNS1=1.2.3.4 +""" + self.assertEqual(em1_config, self.get_interface_config('em1')) + + def test_interface_dns_servers(self): + interface1 = objects.Interface('em1', dns_servers=['1.2.3.4', + '5.6.7.8']) + self.provider.add_interface(interface1) + em1_config = """# This file is autogenerated by os-net-config +DEVICE=em1 +ONBOOT=yes +HOTPLUG=no +NM_CONTROLLED=no +BOOTPROTO=none +DNS1=1.2.3.4 +DNS2=5.6.7.8 +""" + self.assertEqual(em1_config, self.get_interface_config('em1')) + class TestIfcfgNetConfigApply(base.TestCase): |