test_mine.py 938 B

12345678910111213141516171819202122232425262728293031323334
  1. # -*- coding: utf-8 -*-
  2. # Import Python libs
  3. from __future__ import absolute_import, print_function, unicode_literals
  4. import os
  5. import shutil
  6. # Import Salt Testing Libs
  7. from tests.support.case import SSHCase
  8. from tests.support.unit import skipIf
  9. # Import Salt Libs
  10. import salt.utils.platform
  11. @skipIf(salt.utils.platform.is_windows(), 'salt-ssh not available on Windows')
  12. class SSHMineTest(SSHCase):
  13. '''
  14. testing salt-ssh with mine
  15. '''
  16. def test_ssh_mine_get(self):
  17. '''
  18. test salt-ssh with mine
  19. '''
  20. ret = self.run_function('mine.get', ['localhost test.arg'], wipe=False)
  21. self.assertEqual(ret['localhost']['args'], ['itworked'])
  22. def tearDown(self):
  23. '''
  24. make sure to clean up any old ssh directories
  25. '''
  26. salt_dir = self.run_function('config.get', ['thin_dir'], wipe=False)
  27. if os.path.exists(salt_dir):
  28. shutil.rmtree(salt_dir)