mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add timeout to ssh tests
This commit is contained in:
parent
a83cdf9339
commit
443e5cdde2
1 changed files with 3 additions and 3 deletions
|
@ -1218,12 +1218,12 @@ class ShellCase(AdaptedConfigurationTestCaseMixIn, ShellTestCase):
|
|||
arg_str = '-c {0} {1}'.format(self.get_config_dir(), arg_str)
|
||||
return self.run_script('salt', arg_str, with_retcode=with_retcode, catch_stderr=catch_stderr)
|
||||
|
||||
def run_ssh(self, arg_str, with_retcode=False, catch_stderr=False):
|
||||
def run_ssh(self, arg_str, with_retcode=False, catch_stderr=False, timeout=25):
|
||||
'''
|
||||
Execute salt-ssh
|
||||
'''
|
||||
arg_str = '-c {0} -i --priv {1} --roster-file {2} --out=json localhost {3}'.format(self.get_config_dir(), os.path.join(TMP_CONF_DIR, 'key_test'), os.path.join(TMP_CONF_DIR, 'roster'), arg_str)
|
||||
return self.run_script('salt-ssh', arg_str, with_retcode=with_retcode, catch_stderr=catch_stderr, raw=True)
|
||||
return self.run_script('salt-ssh', arg_str, with_retcode=with_retcode, catch_stderr=catch_stderr, timeout=timeout, raw=True)
|
||||
|
||||
def run_run(self, arg_str, with_retcode=False, catch_stderr=False, async=False, timeout=60, config_dir=None):
|
||||
'''
|
||||
|
@ -1356,7 +1356,7 @@ class SSHCase(ShellCase):
|
|||
return '{0} {1}'.format(function, ' '.join(arg))
|
||||
|
||||
def run_function(self, function, arg=(), timeout=25, **kwargs):
|
||||
ret = self.run_ssh(self._arg_str(function, arg))
|
||||
ret = self.run_ssh(self._arg_str(function, arg), timeout=timeout)
|
||||
try:
|
||||
return json.loads(ret)['localhost']
|
||||
except Exception:
|
||||
|
|
Loading…
Add table
Reference in a new issue