Add teardown to remove ssh dir

This commit is contained in:
Ch3LL 2017-11-27 16:51:02 -05:00
parent f90b4f7653
commit 9e67babf85
No known key found for this signature in database
GPG Key ID: 132B55A7C13EFA73

View File

@ -2,6 +2,8 @@
# Import Python libs
from __future__ import absolute_import
import os
import shutil
# Import Salt Testing Libs
from tests.support.case import SSHCase
@ -22,3 +24,11 @@ class SSHMineTest(SSHCase):
'''
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)