mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add state.running ssh integration test
This commit is contained in:
parent
d6c37ea19c
commit
aeb5f4e248
2 changed files with 21 additions and 0 deletions
4
tests/integration/files/file/base/running.sls
Normal file
4
tests/integration/files/file/base/running.sls
Normal file
|
@ -0,0 +1,4 @@
|
|||
sleep_running:
|
||||
module.run:
|
||||
- name: test.sleep
|
||||
- length: 10
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue