Revert test changes and fix original tests

This commit is contained in:
Daniel A. Wozniak 2023-12-28 11:51:48 -07:00 committed by Daniel Wozniak
parent 6e1351679b
commit 6f5c0ac2e7
3 changed files with 18 additions and 8 deletions

View file

@ -85,9 +85,6 @@ class SSHCommandExecutionError(SSHException, CommandExecutionError):
if self.parsed and "local" in self.parsed:
# Wrapped commands that indicate a non-zero retcode
return self.parsed["local"]
elif self.stderr:
# Remote executions that indicate a non-zero retcode
return self.stderr
return super().to_ret()
def __str__(self):

View file

@ -204,6 +204,19 @@ salt/(client/ssh/.+|cli/ssh\.py):
- pytests.integration.ssh.test_raw
- integration.ssh.test_state
- pytests.integration.ssh.test_py_versions
- pytests.integration.netapi.test_ssh_client
salt/client/ssh/wrapper/*:
- pytests.integration.ssh.test_deploy
- pytests.integration.ssh.test_grains
- pytests.integration.ssh.test_mine
- pytests.integration.ssh.test_master
- pytests.integration.ssh.test_jinja_filters
- pytests.integration.ssh.test_pillar
- pytests.integration.ssh.test_raw
- integration.ssh.test_state
- pytests.integration.ssh.test_py_versions
- pytests.integration.netapi.test_ssh_client
salt/config/*:
- unit.test_config
@ -309,6 +322,7 @@ salt/utils/vt.py:
- pytests.integration.ssh.test_pillar
- pytests.integration.ssh.test_raw
- integration.ssh.test_state
- pytests.integration.netapi.test_ssh_client
salt/wheel/*:
- pytests.integration.wheel.test_client

View file

@ -161,7 +161,8 @@ def test_shell_inject_ssh_priv(
if ret:
break
assert path.exists() is False
assert "Network is unreachable" in ret[tgt]
assert not ret[tgt]["stdout"]
assert ret[tgt]["stderr"]
def test_shell_inject_tgt(client, salt_ssh_roster_file, tmp_path, salt_auto_account):
@ -211,10 +212,8 @@ def test_shell_inject_ssh_options(
}
ret = client.run(low)
assert path.exists() is False
assert (
"Bad configuration option" in ret["127.0.0.1"]
or "no argument after keyword" in ret["127.0.0.1"]
)
assert not ret["127.0.0.1"]["stdout"]
assert ret["127.0.0.1"]["stderr"]
def test_shell_inject_ssh_port(