mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-03 20:02:45 +00:00
fixes error when trying to run show start over eapi (#26800)
This commit is contained in:
committed by
Ricardo Carrillo Cruz
parent
156b29b26b
commit
3bbb32cac5
@@ -0,0 +1,26 @@
|
||||
!
|
||||
hostname changed
|
||||
ip domain-name eng.ansible.com
|
||||
!
|
||||
vrf definition mgmt
|
||||
!
|
||||
vrf definition test
|
||||
!
|
||||
interface Management1
|
||||
ip address 192.168.1.1/24
|
||||
!
|
||||
interface Ethernet1
|
||||
shutdown
|
||||
!
|
||||
interface Ethernet2
|
||||
shutdown
|
||||
!
|
||||
interface Ethernet3
|
||||
shutdown
|
||||
!
|
||||
interface Ethernet4
|
||||
shutdown
|
||||
!
|
||||
interface Ethernet5
|
||||
shutdown
|
||||
!
|
||||
@@ -132,3 +132,23 @@ class TestEosConfigModule(TestEosModule):
|
||||
set_module_args(args)
|
||||
result = self.execute_module()
|
||||
self.assertIn('__backup__', result)
|
||||
|
||||
def test_eos_config_save_when(self):
|
||||
mock_run_commands = patch('ansible.modules.network.eos.eos_config.run_commands')
|
||||
run_commands = mock_run_commands.start()
|
||||
|
||||
run_commands.return_value = [load_fixture('eos_config_config.cfg'),
|
||||
load_fixture('eos_config_config.cfg')]
|
||||
|
||||
args = dict(save_when='modified')
|
||||
set_module_args(args)
|
||||
result = self.execute_module()
|
||||
|
||||
run_commands.return_value = [load_fixture('eos_config_config.cfg'),
|
||||
load_fixture('eos_config_config_updated.cfg')]
|
||||
|
||||
args = dict(save_when='modified')
|
||||
set_module_args(args)
|
||||
result = self.execute_module(changed=True)
|
||||
|
||||
mock_run_commands.stop()
|
||||
|
||||
Reference in New Issue
Block a user