test_mine.py 928 B

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