Add test for recuse error

This commit is contained in:
Thomas S Hatch 2012-06-19 10:29:14 -06:00
parent 04d6a02913
commit 7477583c97
2 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,15 @@
nagios-nrpe-server:
pkg:
- installed
service:
- running
- watch:
- file: /etc/nagios/nrpe.cfg
/etc/nagios/nrpe.cfg:
file:
- managed
- source: salt://baseserver/nrpe.cfg
- require:
- pkg: nagios-nrpe-server

View File

@ -37,11 +37,18 @@ class StateModuleTest(integration.ModuleCase):
def test_no_recurse(self):
'''
state.show_sls used to catch a recursive ref
verify that a sls structure is NOT a recursive ref
'''
sls = self.run_function('state.show_sls', mods='recurse_ok')
self.assertIn('snmpd', sls)
def test_no_recurse_two(self):
'''
verify that a sls structure is NOT a recursive ref
'''
sls = self.run_function('state.show_sls', mods='recurse_ok_two')
self.assertIn('/etc/nagios/nrpe.cfg', sls)
if __name__ == "__main__":
loader = TestLoader()
tests = loader.loadTestsFromTestCase(StateModuleTest)