mirror of
https://github.com/linux-system-roles/network.git
synced 2026-07-20 17:59:00 +00:00
library: fix tests for macvlan with initscripts
This commit is contained in:
parent
15a1ca8b7c
commit
2dbc68b7d9
2 changed files with 13 additions and 10 deletions
|
|
@ -2648,7 +2648,6 @@ class Cmd_initscripts(Cmd):
|
|||
|
||||
def run_prepare(self):
|
||||
Cmd.run_prepare(self)
|
||||
names = {}
|
||||
for idx, connection in enumerate(self.connections):
|
||||
if connection['type'] in [ 'macvlan' ]:
|
||||
self.log_fatal(idx, 'unsupported type %s for initscripts provider' % (connection['type']))
|
||||
|
|
|
|||
|
|
@ -112,15 +112,19 @@ class TestValidator(unittest.TestCase):
|
|||
ARGS_CONNECTIONS.validate_connection_one(mode, connections, idx)
|
||||
except n.ValidationError as e:
|
||||
continue
|
||||
if 'type' in connection:
|
||||
content_current = kwargs.get('initscripts_content_current', None)
|
||||
if content_current:
|
||||
content_current = content_current[idx]
|
||||
c = n.IfcfgUtil.ifcfg_create(connections, idx, content_current = content_current)
|
||||
#pprint("con[%s] = \"%s\"" % (idx, connections[idx]['name']), c)
|
||||
exp = kwargs.get('initscripts_dict_expected', None)
|
||||
if exp is not None:
|
||||
self.assertEqual(exp[idx], c)
|
||||
if 'type' not in connection:
|
||||
continue
|
||||
if connection['type'] in ['macvlan']:
|
||||
# initscripts do not support this type. Skip the test.
|
||||
continue
|
||||
content_current = kwargs.get('initscripts_content_current', None)
|
||||
if content_current:
|
||||
content_current = content_current[idx]
|
||||
c = n.IfcfgUtil.ifcfg_create(connections, idx, content_current = content_current)
|
||||
#pprint("con[%s] = \"%s\"" % (idx, connections[idx]['name']), c)
|
||||
exp = kwargs.get('initscripts_dict_expected', None)
|
||||
if exp is not None:
|
||||
self.assertEqual(exp[idx], c)
|
||||
|
||||
|
||||
def do_connections_validate(self, expected_connections, input_connections, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue