summaryrefslogtreecommitdiff
path: root/cloudinit/net/tests
diff options
context:
space:
mode:
authoreb3095 <45504889+eb3095@users.noreply.github.com>2021-06-01 18:30:00 -0400
committerGitHub <noreply@github.com>2021-06-01 16:30:00 -0600
commit503e2d398660e8af5d49bdf6944a50ad793a3a31 (patch)
treef6c339cb1902702b175e56a490323d04d9fe0904 /cloudinit/net/tests
parent63f72380a70d9f846cac3b2cbbc6ed13c735c277 (diff)
downloadvyos-cloud-init-503e2d398660e8af5d49bdf6944a50ad793a3a31.tar.gz
vyos-cloud-init-503e2d398660e8af5d49bdf6944a50ad793a3a31.zip
Allow braces to appear in dhclient output (#911)
dhclient output that contains brackets for pxe variables will break the dhclient parsing regex line. This fix retains the current functionality while fixing this particular issue.
Diffstat (limited to 'cloudinit/net/tests')
-rw-r--r--cloudinit/net/tests/test_dhcp.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cloudinit/net/tests/test_dhcp.py b/cloudinit/net/tests/test_dhcp.py
index 6f9a02de..5ae048e2 100644
--- a/cloudinit/net/tests/test_dhcp.py
+++ b/cloudinit/net/tests/test_dhcp.py
@@ -42,6 +42,7 @@ class TestParseDHCPLeasesFile(CiTestCase):
lease {
interface "wlp3s0";
fixed-address 192.168.2.74;
+ filename "http://192.168.2.50/boot.php?mac=${netX}";
option subnet-mask 255.255.255.0;
option routers 192.168.2.1;
renew 4 2017/07/27 18:02:30;
@@ -50,6 +51,7 @@ class TestParseDHCPLeasesFile(CiTestCase):
lease {
interface "wlp3s0";
fixed-address 192.168.2.74;
+ filename "http://192.168.2.50/boot.php?mac=${netX}";
option subnet-mask 255.255.255.0;
option routers 192.168.2.1;
}
@@ -58,8 +60,10 @@ class TestParseDHCPLeasesFile(CiTestCase):
{'interface': 'wlp3s0', 'fixed-address': '192.168.2.74',
'subnet-mask': '255.255.255.0', 'routers': '192.168.2.1',
'renew': '4 2017/07/27 18:02:30',
- 'expire': '5 2017/07/28 07:08:15'},
+ 'expire': '5 2017/07/28 07:08:15',
+ 'filename': 'http://192.168.2.50/boot.php?mac=${netX}'},
{'interface': 'wlp3s0', 'fixed-address': '192.168.2.74',
+ 'filename': 'http://192.168.2.50/boot.php?mac=${netX}',
'subnet-mask': '255.255.255.0', 'routers': '192.168.2.1'}]
write_file(lease_file, content)
self.assertCountEqual(expected, parse_dhcp_lease_file(lease_file))