Add state.running ssh integration test

This commit is contained in:
Ch3LL 2017-12-06 13:23:55 -05:00
parent d6c37ea19c
commit aeb5f4e248
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,4 @@
sleep_running:
module.run:
- name: test.sleep
- length: 10

View file

@ -4,6 +4,7 @@
from __future__ import absolute_import
import os
import shutil
import time
# Import Salt Testing Libs
from tests.support.case import SSHCase
@ -159,6 +160,22 @@ class SSHStateTest(SSHCase):
check_file = self.run_function('file.file_exists', [SSH_SLS_FILE], wipe=False)
self.assertTrue(check_file)
def test_state_running(self):
'''
test state.running with salt-ssh
'''
start_sls = self.run_function('state.sls', ['running', '&'],
wipe=False)
time.sleep(8)
get_sls = self.run_function('state.running', wipe=False)
ret = 'The function "state.pkg" is running as'
self.assertIn(ret, ' '.join(get_sls))
# make sure we wait until the earlier state is complete
while True:
if ret not in ' '.join(self.run_function('state.running', wipe=False)):
break
def tearDown(self):
'''
make sure to clean up any old ssh directories