2014-01-28 12:40:03 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
'''
|
|
|
|
tests for host state
|
|
|
|
'''
|
|
|
|
|
2014-11-21 19:05:13 +00:00
|
|
|
# Import Python libs
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2014-01-28 12:40:03 +00:00
|
|
|
# Import Salt Testing libs
|
2017-04-03 16:04:09 +00:00
|
|
|
from tests.support.case import ModuleCase
|
2014-01-28 12:40:03 +00:00
|
|
|
|
|
|
|
|
2017-04-03 16:04:09 +00:00
|
|
|
class HandleErrorTest(ModuleCase):
|
2014-01-28 12:40:03 +00:00
|
|
|
'''
|
|
|
|
Validate that ordering works correctly
|
|
|
|
'''
|
|
|
|
def test_handle_error(self):
|
|
|
|
'''
|
|
|
|
Test how an error can be recovered
|
|
|
|
'''
|
|
|
|
# without sync_states, the custom state may not be installed
|
|
|
|
# (resulting in :
|
|
|
|
# State salttest.hello found in sls issue-... is unavailable
|
|
|
|
ret = self.run_function('state.sls', ['issue-9983-handleerror'])
|
|
|
|
self.assertTrue(
|
|
|
|
'An exception occurred in this state: Traceback'
|
|
|
|
in ret[[a for a in ret][0]]['comment'])
|