Migrate tests/integration/ssh/test_raw.py to pytest

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2022-08-24 16:36:35 +01:00 committed by Gareth J. Greenaway
parent 8f4381f203
commit e5b8bac199
3 changed files with 22 additions and 22 deletions

View file

@ -200,7 +200,7 @@ salt/(client/ssh/.+|cli/ssh\.py):
- integration.ssh.test_master
- integration.ssh.test_mine
- pytests.integration.ssh.test_pillar
- integration.ssh.test_raw
- pytests.integration.ssh.test_raw
- integration.ssh.test_state
- pytests.integration.ssh.test_py_versions
@ -306,7 +306,7 @@ salt/utils/vt.py:
- integration.ssh.test_jinja_filters
- integration.ssh.test_mine
- pytests.integration.ssh.test_pillar
- integration.ssh.test_raw
- pytests.integration.ssh.test_raw
- integration.ssh.test_state
salt/wheel/*:

View file

@ -1,20 +0,0 @@
import pytest
from tests.support.case import SSHCase
@pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows")
class SSHRawTest(SSHCase):
"""
testing salt-ssh with raw calls
"""
@pytest.mark.slow_test
@pytest.mark.timeout(timeout=60, method="thread")
def test_ssh_raw(self):
"""
test salt-ssh with -r argument
"""
msg = "password: foo"
ret = self.run_function("echo {}".format(msg), raw=True)
self.assertEqual(ret["stdout"], msg + "\n")

View file

@ -0,0 +1,20 @@
import pytest
pytestmark = [
pytest.mark.slow_test,
pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows"),
]
def test_ssh_raw(salt_ssh_cli):
"""
test salt-ssh with -r argument
"""
msg = "password: foo"
ret = salt_ssh_cli.run("--raw", "echo", msg, _timeout=60)
assert ret.returncode == 0
assert ret.data
assert "retcode" in ret.data
assert ret.data["retcode"] == 0
assert "stdout" in ret.data
assert ret.data["stdout"] == msg + "\n"