summaryrefslogtreecommitdiff
path: root/tests/unittests/test_net.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-05-24 21:10:50 -0400
committerScott Moser <smoser@brickies.net>2017-06-08 18:34:06 -0400
commitd00da2d5b0d45db5670622a66d833d2abb907388 (patch)
treead084f88eb4de4c448959e4f3f8543550259a441 /tests/unittests/test_net.py
parent76d58265e34851b78e952a7f275340863c90a9f5 (diff)
downloadvyos-cloud-init-d00da2d5b0d45db5670622a66d833d2abb907388.tar.gz
vyos-cloud-init-d00da2d5b0d45db5670622a66d833d2abb907388.zip
net: normalize data in network_state object
The network_state object's network and route keys would have different information depending upon how the network_state object was populated. This change cleans that up. Now: * address will always contain an IP address. * prefix will always include an integer value that is the network_prefix for the address. * netmask will be present only if the address is ipv4, and its value will always correlate to the 'prefix'.
Diffstat (limited to 'tests/unittests/test_net.py')
-rw-r--r--tests/unittests/test_net.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index 0a88caf1..91e5fb59 100644
--- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py
@@ -334,17 +334,15 @@ iface lo inet loopback
auto eth0
iface eth0 inet static
- address 1.2.3.12
+ address 1.2.3.12/29
broadcast 1.2.3.15
dns-nameservers 69.9.160.191 69.9.191.4
gateway 1.2.3.9
- netmask 255.255.255.248
auto eth1
iface eth1 inet static
- address 10.248.2.4
+ address 10.248.2.4/29
broadcast 10.248.2.7
- netmask 255.255.255.248
""".lstrip()
NETWORK_CONFIGS = {