mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
8cdb9ea54f
This makes the 2.x usage invalid syntax and forces the use of print as a function. This adds the import to the files which I've updated in the last couple of days but forgot to add it.
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
'''
|
|
salt-ssh testing
|
|
'''
|
|
# Import Python libs
|
|
from __future__ import absolute_import, print_function, unicode_literals
|
|
import os
|
|
import shutil
|
|
|
|
# Import salt testing libs
|
|
from tests.support.case import SSHCase
|
|
|
|
|
|
class SSHTest(SSHCase):
|
|
'''
|
|
Test general salt-ssh functionality
|
|
'''
|
|
def test_ping(self):
|
|
'''
|
|
Test a simple ping
|
|
'''
|
|
ret = self.run_function('test.ping')
|
|
self.assertTrue(ret, 'Ping did not return true')
|
|
|
|
def test_thin_dir(self):
|
|
'''
|
|
test to make sure thin_dir is created
|
|
and salt-call file is included
|
|
'''
|
|
thin_dir = self.run_function('config.get', ['thin_dir'], wipe=False)
|
|
os.path.isdir(thin_dir)
|
|
os.path.exists(os.path.join(thin_dir, 'salt-call'))
|
|
os.path.exists(os.path.join(thin_dir, 'running_data'))
|
|
|
|
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)
|