summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource/test_configdrive.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2016-05-19 15:33:15 -0700
committerJoshua Harlow <harlowja@gmail.com>2016-05-19 15:33:15 -0700
commit2fb5af62229b8975910bf0ef63731047bd8d7e63 (patch)
treedc1d367224916780a319f2d15757b7cf221884e3 /tests/unittests/test_datasource/test_configdrive.py
parent6b97c4e462b19374d6af807b1f5b9c087aa97996 (diff)
downloadvyos-cloud-init-2fb5af62229b8975910bf0ef63731047bd8d7e63.tar.gz
vyos-cloud-init-2fb5af62229b8975910bf0ef63731047bd8d7e63.zip
Fix up tests and flake8 warnings
Diffstat (limited to 'tests/unittests/test_datasource/test_configdrive.py')
-rw-r--r--tests/unittests/test_datasource/test_configdrive.py41
1 files changed, 22 insertions, 19 deletions
diff --git a/tests/unittests/test_datasource/test_configdrive.py b/tests/unittests/test_datasource/test_configdrive.py
index 1db50798..5395e544 100644
--- a/tests/unittests/test_datasource/test_configdrive.py
+++ b/tests/unittests/test_datasource/test_configdrive.py
@@ -368,30 +368,32 @@ class TestNetJson(TestCase):
self.assertEqual(myds.network_config, network_config)
def test_network_config_conversions(self):
- """Tests a bunch of input network json and checks the expected conversions."""
+ """Tests a bunch of input network json and checks the
+ expected conversions."""
in_datas = [
NETWORK_DATA,
{
'services': [{'type': 'dns', 'address': '172.19.0.12'}],
- 'networks': [
- {'network_id': 'dacd568d-5be6-4786-91fe-750c374b78b4',
- 'type': 'ipv4', 'netmask': '255.255.252.0',
- 'link': 'tap1a81968a-79',
- 'routes': [
- {
- 'netmask': '0.0.0.0',
- 'network': '0.0.0.0',
- 'gateway': '172.19.3.254'
- },
- ],
- 'ip_address': '172.19.1.34',
- 'id': 'network0',
+ 'networks': [{
+ 'network_id': 'dacd568d-5be6-4786-91fe-750c374b78b4',
+ 'type': 'ipv4',
+ 'netmask': '255.255.252.0',
+ 'link': 'tap1a81968a-79',
+ 'routes': [{
+ 'netmask': '0.0.0.0',
+ 'network': '0.0.0.0',
+ 'gateway': '172.19.3.254',
+ }],
+ 'ip_address': '172.19.1.34',
+ 'id': 'network0',
+ }],
+ 'links': [{
+ 'type': 'bridge',
+ 'vif_id': '1a81968a-797a-400f-8a80-567f997eb93f',
+ 'ethernet_mac_address': 'fa:16:3e:ed:9a:59',
+ 'id': 'tap1a81968a-79',
+ 'mtu': None,
}],
- 'links': [
- {'type': 'bridge',
- 'vif_id': '1a81968a-797a-400f-8a80-567f997eb93f',
- 'ethernet_mac_address': 'fa:16:3e:ed:9a:59',
- 'id': 'tap1a81968a-79', 'mtu': None}]
},
]
out_datas = [
@@ -440,6 +442,7 @@ class TestNetJson(TestCase):
'address': '172.19.1.34',
'netmask': '255.255.252.0',
'type': 'static',
+ 'ipv4': True,
'routes': [{
'gateway': '172.19.3.254',
'netmask': '0.0.0.0',