test_mine.py 975 B

12345678910111213141516171819202122232425262728293031323334353637
  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 Libs
  7. import salt.utils.platform
  8. # Import Salt Testing Libs
  9. from tests.support.case import SSHCase
  10. from tests.support.unit import skipIf
  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. @skipIf(True, "SLOWTEST skip")
  17. def test_ssh_mine_get(self):
  18. """
  19. test salt-ssh with mine
  20. """
  21. ret = self.run_function("mine.get", ["localhost test.arg"], wipe=False)
  22. self.assertEqual(ret["localhost"]["args"], ["itworked"])
  23. def tearDown(self):
  24. """
  25. make sure to clean up any old ssh directories
  26. """
  27. salt_dir = self.run_function("config.get", ["thin_dir"], wipe=False)
  28. if os.path.exists(salt_dir):
  29. shutil.rmtree(salt_dir)