Run save inside config mode. (#23977)

* Run `save` before exiting config mode.

* Fix unit tests for `save`

* Allow `save` to be on its own again and introspect success

* Introspecting `compare running` makes this a lot harder.

Move `save` tests to integration tests
This commit is contained in:
Nathaniel Case 2017-04-27 11:08:37 -04:00 committed by GitHub
parent 9c4daded94
commit fc0bf87c20
3 changed files with 65 additions and 12 deletions

View file

@ -73,15 +73,6 @@ class TestVyosConfigModule(TestVyosModule):
result = self.execute_module()
self.assertIn('__backup__', result)
def test_vyos_config_save(self):
set_module_args(dict(save=True))
self.execute_module(changed=True)
self.assertEqual(self.run_commands.call_count, 1)
self.assertEqual(self.get_config.call_count, 0)
self.assertEqual(self.load_config.call_count, 0)
args = self.run_commands.call_args[0][1]
self.assertIn('save', args)
def test_vyos_config_lines(self):
commands = ['set system host-name foo']
set_module_args(dict(lines=commands))