salt/tests/integration/runners/state.py

49 lines
1.3 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2013-06-11 00:42:20 +00:00
'''
Tests for the salt-run command
'''
# Import python libs
import os
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
2013-06-11 00:42:20 +00:00
class ManageTest(integration.ShellCase):
'''
Test the manage runner
'''
2013-06-11 05:00:48 +00:00
def test_over_req_fail(self):
2013-06-11 00:42:20 +00:00
'''
state.over
'''
2013-09-03 06:53:10 +00:00
os_fn = os.path.join(integration.FILES, 'over', 'req_fail.sls')
2013-06-11 00:42:20 +00:00
ret = '\n'.join(self.run_run('state.over os_fn={0}'.format(os_fn)))
2013-09-03 17:37:46 +00:00
items = (
'Requisite fail_stage failed for stage',
'Executing the following Over State:',
)
self.assertTrue(any(item in ret for item in items))
2013-06-11 00:42:20 +00:00
2013-06-11 05:00:48 +00:00
def test_over_parse_req_fail(self):
'''
state.over
'''
2013-09-03 06:53:10 +00:00
os_fn = os.path.join(integration.FILES, 'over', 'parse_req_fail.sls')
2013-06-11 05:00:48 +00:00
ret = '\n'.join(self.run_run('state.over os_fn={0}'.format(os_fn)))
2013-09-03 17:37:46 +00:00
items = (
'Requisite fail_stage failed for stage',
'Executing the following Over State:',
)
self.assertTrue(any(item in ret for item in items))
2013-06-11 05:00:48 +00:00
2013-06-11 00:42:20 +00:00
if __name__ == '__main__':
from integration import run_tests
run_tests(ManageTest)