From 9ce34d529d7faa65cfa6f88aaecf735f92c4c89b Mon Sep 17 00:00:00 2001 From: Cédric Jeanneret Date: Fri, 15 Sep 2017 00:13:39 +0200 Subject: Allow to pass more than two DNS while putting 2 DNS Until now, when we pass more than 2 DNS, only the first one is added in the ifcg-* config files. This patch-set proves the issue, and proves the correction actually works. Change-Id: I70a779782ab87cd4f74f3c50b0e649f503b386e3 Closes-Bug: #1716171 (cherry picked from commit 8ddab87c6ee2e80025e9340d806f93921779198b) --- os_net_config/tests/test_impl_ifcfg.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'os_net_config/tests') diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py index 337eeb3..4b91448 100644 --- a/os_net_config/tests/test_impl_ifcfg.py +++ b/os_net_config/tests/test_impl_ifcfg.py @@ -873,6 +873,22 @@ NM_CONTROLLED=no BOOTPROTO=none DNS1=1.2.3.4 DNS2=5.6.7.8 +""" + self.assertEqual(em1_config, self.get_interface_config('em1')) + + def test_interface_more_dns_servers(self): + interface1 = objects.Interface('em1', dns_servers=['1.2.3.4', + '5.6.7.8', + '9.10.11.12']) + 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')) -- cgit 1.2.3-korg