mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add integration test for the running dictionary structure
This will fail if we remove/rename any fields from the running dictionary by accident.
This commit is contained in:
parent
0af51fd086
commit
e4cf3931b3
1 changed files with 25 additions and 0 deletions
|
@ -74,6 +74,31 @@ class StateModuleTest(integration.ModuleCase,
|
|||
sls = self.run_function('state.show_sls', mods='recurse_ok_two')
|
||||
self.assertIn('/etc/nagios/nrpe.cfg', sls)
|
||||
|
||||
def test_running_dictionary_consistency(self):
|
||||
'''
|
||||
Test the structure of the running dictionary so we don't change it
|
||||
without deprecating/documenting the change
|
||||
'''
|
||||
running_dict_fields = [
|
||||
'__id__',
|
||||
'__run_num__',
|
||||
'__sls__',
|
||||
'changes',
|
||||
'comment',
|
||||
'duration',
|
||||
'name',
|
||||
'result',
|
||||
'start_time',
|
||||
]
|
||||
|
||||
sls = self.run_function('state.single',
|
||||
fun='test.succeed_with_changes',
|
||||
name='gndn')
|
||||
|
||||
for state, ret in sls.items():
|
||||
for field in running_dict_fields:
|
||||
self.assertIn(field, ret)
|
||||
|
||||
def _remove_request_cache_file(self):
|
||||
'''
|
||||
remove minion state request file
|
||||
|
|
Loading…
Add table
Reference in a new issue