mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #44698 from Ch3LL/mine_ssh
Add salt-ssh mine.get integration test
This commit is contained in:
commit
642eed11e1
2 changed files with 36 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
localhost:
|
||||
host: 127.0.0.1
|
||||
port: 2827
|
||||
mine_functions:
|
||||
test.arg: ['itworked']
|
||||
|
|
34
tests/integration/ssh/test_mine.py
Normal file
34
tests/integration/ssh/test_mine.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
import shutil
|
||||
|
||||
# Import Salt Testing Libs
|
||||
from tests.support.case import SSHCase
|
||||
from tests.support.unit import skipIf
|
||||
|
||||
# Import Salt Libs
|
||||
import salt.utils
|
||||
|
||||
|
||||
@skipIf(salt.utils.is_windows(), 'salt-ssh not available on Windows')
|
||||
class SSHMineTest(SSHCase):
|
||||
'''
|
||||
testing salt-ssh with mine
|
||||
'''
|
||||
def test_ssh_mine_get(self):
|
||||
'''
|
||||
test salt-ssh with mine
|
||||
'''
|
||||
ret = self.run_function('mine.get', ['localhost test.arg'], wipe=False)
|
||||
self.assertEqual(ret['localhost']['args'], ['itworked'])
|
||||
|
||||
def tearDown(self):
|
||||
'''
|
||||
make sure to clean up any old ssh directories
|
||||
'''
|
||||
salt_dir = self.run_function('config.get', ['thin_dir'], wipe=False)
|
||||
if os.path.exists(salt_dir):
|
||||
shutil.rmtree(salt_dir)
|
Loading…
Add table
Reference in a new issue