mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Adds parents to mutually_exclusive with src for *_config modules (#33957)
* mutually_exclusive add - ios_config parents works with lines by not src * mutually_execlusive parents,src added to all other net modules * tests for mutually_exclusive parents,src and whitespce removal
This commit is contained in:
@@ -174,3 +174,33 @@ class TestIosConfigModule(TestIosModule):
|
||||
set_module_args(dict(lines=lines, parents=parents, match='exact'))
|
||||
commands = parents + lines
|
||||
self.execute_module(changed=True, commands=commands, sort=False)
|
||||
|
||||
def test_ios_config_src_and_lines_fails(self):
|
||||
args = dict(src='foo', lines='foo')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_ios_config_src_and_parents_fails(self):
|
||||
args = dict(src='foo', parents='foo')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_ios_config_match_exact_requires_lines(self):
|
||||
args = dict(match='exact')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_ios_config_match_strict_requires_lines(self):
|
||||
args = dict(match='strict')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_ios_config_replace_block_requires_lines(self):
|
||||
args = dict(replace='block')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_ios_config_replace_config_requires_src(self):
|
||||
args = dict(replace='config')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
@@ -137,3 +137,33 @@ class TestIosxrConfigModule(TestIosxrModule):
|
||||
set_module_args(dict(lines=lines, parents=parents, match='exact'))
|
||||
commands = parents + lines
|
||||
self.execute_module(changed=True, commands=commands, sort=False)
|
||||
|
||||
def test_iosxr_config_src_and_lines_fails(self):
|
||||
args = dict(src='foo', lines='foo')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_iosxr_config_src_and_parents_fails(self):
|
||||
args = dict(src='foo', parents='foo')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_iosxr_config_match_exact_requires_lines(self):
|
||||
args = dict(match='exact')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_iosxr_config_match_strict_requires_lines(self):
|
||||
args = dict(match='strict')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_iosxr_config_replace_block_requires_lines(self):
|
||||
args = dict(replace='block')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_iosxr_config_replace_config_requires_src(self):
|
||||
args = dict(replace='config')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
@@ -110,6 +110,11 @@ class TestNxosConfigModule(TestNxosModule):
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_nxos_config_src_and_parents_fails(self):
|
||||
args = dict(src='foo', parents='foo')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(failed=True)
|
||||
|
||||
def test_nxos_config_match_exact_requires_lines(self):
|
||||
args = dict(match='exact')
|
||||
set_module_args(args)
|
||||
|
||||
Reference in New Issue
Block a user