mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00: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:
@@ -0,0 +1,2 @@
|
||||
%No Rollback Confirmed Change pending
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user