mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Migrate tests/integration/ssh/test_raw.py
to pytest
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
8f4381f203
commit
e5b8bac199
3 changed files with 22 additions and 22 deletions
|
@ -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/*:
|
||||
|
|
|
@ -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")
|
20
tests/pytests/integration/ssh/test_raw.py
Normal file
20
tests/pytests/integration/ssh/test_raw.py
Normal 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"
|
Loading…
Add table
Reference in a new issue