Merge pull request #44698 from Ch3LL/mine_ssh

Add salt-ssh mine.get integration test
This commit is contained in:
Gareth J. Greenaway 2017-11-28 14:15:28 -08:00 committed by GitHub
commit 642eed11e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View file

@ -1,3 +1,5 @@
localhost:
host: 127.0.0.1
port: 2827
mine_functions:
test.arg: ['itworked']

View 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)