fixes error when trying to run show start over eapi (#26800)

This commit is contained in:
Peter Sprygada
2017-07-14 09:07:44 -04:00
committed by Ricardo Carrillo Cruz
parent 156b29b26b
commit 3bbb32cac5
3 changed files with 54 additions and 7 deletions

View File

@@ -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
!

View File

@@ -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()