2016-06-20 23:07:55 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
'''
|
|
|
|
Tests for various minion timeouts
|
|
|
|
'''
|
|
|
|
|
|
|
|
# Import Python libs
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
# Import Salt Testing libs
|
2017-04-03 16:04:09 +00:00
|
|
|
from tests.support.case import ShellCase
|
2016-06-20 23:07:55 +00:00
|
|
|
|
|
|
|
|
2017-04-03 16:04:09 +00:00
|
|
|
class MinionTimeoutTestCase(ShellCase):
|
2016-06-20 23:07:55 +00:00
|
|
|
'''
|
|
|
|
Test minion timing functions
|
|
|
|
'''
|
|
|
|
def test_long_running_job(self):
|
|
|
|
'''
|
|
|
|
Test that we will wait longer than the job timeout for a minion to
|
|
|
|
return.
|
|
|
|
'''
|
|
|
|
# Launch the command
|
|
|
|
sleep_length = 30
|
2016-07-22 22:14:25 +00:00
|
|
|
ret = self.run_salt('minion test.sleep {0}'.format(sleep_length), timeout=45)
|
2016-06-20 23:07:55 +00:00
|
|
|
self.assertTrue(isinstance(ret, list), 'Return is not a list. Minion'
|
|
|
|
' may have returned error: {0}'.format(ret))
|
|
|
|
self.assertTrue('True' in ret[1], 'Minion did not return True after '
|
2016-06-20 23:11:01 +00:00
|
|
|
'{0} seconds.'.format(sleep_length))
|