test_raw.py 759 B

1234567891011121314151617181920212223242526272829
  1. # -*- coding: utf-8 -*-
  2. # Import Python libs
  3. from __future__ import absolute_import, print_function, unicode_literals
  4. import pytest
  5. # Import Salt Libs
  6. import salt.utils.platform
  7. # Import Salt Testing Libs
  8. from tests.support.case import SSHCase
  9. from tests.support.unit import skipIf
  10. @skipIf(salt.utils.platform.is_windows(), "salt-ssh not available on Windows")
  11. class SSHRawTest(SSHCase):
  12. """
  13. testing salt-ssh with raw calls
  14. """
  15. @pytest.mark.slow_test(seconds=5) # Test takes >1 and <=5 seconds
  16. def test_ssh_raw(self):
  17. """
  18. test salt-ssh with -r argument
  19. """
  20. msg = "running raw msg"
  21. ret = self.run_function("echo {0}".format(msg), raw=True)
  22. self.assertEqual(ret["stdout"], msg + "\n")