mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Skip tests which require the SSHD server running in case it's not
This commit is contained in:
parent
1a766af93c
commit
71df7ac58a
1 changed files with 4 additions and 0 deletions
|
@ -45,6 +45,7 @@ from salttesting import TestCase
|
|||
from salttesting.case import ShellTestCase
|
||||
from salttesting.mixins import CheckShellBinaryNameAndVersionMixIn
|
||||
from salttesting.parser import PNUM, print_header, SaltTestcaseParser
|
||||
from salttesting.helpers import requires_sshd_server
|
||||
from salttesting.helpers import ensure_in_syspath, RedirectStdStreams
|
||||
|
||||
# Update sys.path
|
||||
|
@ -424,6 +425,8 @@ class TestDaemon(object):
|
|||
_, sshd_err = self.sshd_process.communicate()
|
||||
if sshd_err:
|
||||
print('sshd had errors on startup: {0}'.format(sshd_err))
|
||||
else:
|
||||
os.environ['SSH_DAEMON_RUNNING'] = 'True'
|
||||
roster_path = os.path.join(FILES, 'conf/_ssh/roster')
|
||||
shutil.copy(roster_path, TMP_CONF_DIR)
|
||||
with salt.utils.fopen(os.path.join(TMP_CONF_DIR, 'roster'), 'a') as roster:
|
||||
|
@ -1285,6 +1288,7 @@ class ShellCaseCommonTestsMixIn(CheckShellBinaryNameAndVersionMixIn):
|
|||
self.assertIn(parsed_version.string, out)
|
||||
|
||||
|
||||
@requires_sshd_server
|
||||
class SSHCase(ShellCase):
|
||||
'''
|
||||
Execute a command via salt-ssh
|
||||
|
|
Loading…
Add table
Reference in a new issue