mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
ios_command: Whitelist some commands starting with configure
(#35363)
* Whitelist some commands starting with `configure` * Add tests for conditional `configure` rejection
This commit is contained in:
parent
4fa02d581d
commit
1f1e5c11a9
3 changed files with 19 additions and 1 deletions
|
@ -106,3 +106,17 @@ class TestIosCommandModule(TestIosModule):
|
|||
commands = ['show version', 'show version']
|
||||
set_module_args(dict(commands=commands, wait_for=wait_for, match='all'))
|
||||
self.execute_module(failed=True)
|
||||
|
||||
def test_ios_command_configure_error(self):
|
||||
commands = ['configure terminal']
|
||||
set_module_args(dict(commands=commands))
|
||||
result = self.execute_module(failed=True)
|
||||
self.assertEqual(
|
||||
result['msg'],
|
||||
'ios_command does not support running config mode commands. Please use ios_config instead'
|
||||
)
|
||||
|
||||
def test_ios_command_configure_not_error(self):
|
||||
commands = ['configure revert now']
|
||||
set_module_args(dict(commands=commands))
|
||||
self.execute_module()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue