mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
module: add test for presence of "ip" section
This commit is contained in:
parent
d88e79ac8c
commit
24c6c0755b
1 changed files with 80 additions and 0 deletions
|
|
@ -253,6 +253,86 @@ class TestValidator(unittest.TestCase):
|
|||
]),
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
[
|
||||
{
|
||||
'name': '5',
|
||||
'state': 'up',
|
||||
'type': 'ethernet',
|
||||
'autoconnect': True,
|
||||
'parent': None,
|
||||
'ip': {
|
||||
'gateway6': None,
|
||||
'gateway4': None,
|
||||
'route_metric4': None,
|
||||
'auto6': True,
|
||||
'dhcp4': True,
|
||||
'address': [],
|
||||
'dns': [],
|
||||
'dns_search': [ ],
|
||||
'route_metric6': None,
|
||||
'ip_is_present': False,
|
||||
'dhcp4_send_hostname': None,
|
||||
},
|
||||
'mac': None,
|
||||
'master': None,
|
||||
'vlan_id': None,
|
||||
'ignore_errors': None,
|
||||
'interface_name': None,
|
||||
'check_iface_exists': True,
|
||||
'slave_type': None,
|
||||
'wait': 90,
|
||||
},
|
||||
],
|
||||
n.AnsibleUtil.ARGS_CONNECTIONS.validate([
|
||||
{ 'name': '5',
|
||||
'state': 'up',
|
||||
'type': 'ethernet',
|
||||
},
|
||||
]),
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
[
|
||||
{
|
||||
'name': '5',
|
||||
'state': 'up',
|
||||
'type': 'ethernet',
|
||||
'autoconnect': True,
|
||||
'parent': None,
|
||||
'ip': {
|
||||
'gateway6': None,
|
||||
'gateway4': None,
|
||||
'route_metric4': None,
|
||||
'auto6': False,
|
||||
'dhcp4': True,
|
||||
'address': [],
|
||||
'dns': [],
|
||||
'dns_search': [ ],
|
||||
'route_metric6': None,
|
||||
'ip_is_present': True,
|
||||
'dhcp4_send_hostname': None,
|
||||
},
|
||||
'mac': None,
|
||||
'master': None,
|
||||
'vlan_id': None,
|
||||
'ignore_errors': None,
|
||||
'interface_name': None,
|
||||
'check_iface_exists': True,
|
||||
'slave_type': None,
|
||||
'wait': 90,
|
||||
},
|
||||
],
|
||||
n.AnsibleUtil.ARGS_CONNECTIONS.validate([
|
||||
{ 'name': '5',
|
||||
'state': 'up',
|
||||
'type': 'ethernet',
|
||||
'ip': {
|
||||
},
|
||||
},
|
||||
]),
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
[
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue