|
7 | 7 | import pytest |
8 | 8 |
|
9 | 9 | from cmdeploy import remote |
10 | | -from cmdeploy.sshexec import SSHExec |
| 10 | +from cmdeploy.cmdeploy import get_sshexec |
11 | 11 |
|
12 | 12 |
|
13 | 13 | class TestSSHExecutor: |
14 | 14 | @pytest.fixture(scope="class") |
15 | 15 | def sshexec(self, sshdomain): |
16 | | - return SSHExec(sshdomain) |
| 16 | + return get_sshexec(sshdomain) |
17 | 17 |
|
18 | 18 | def test_ls(self, sshexec): |
19 | | - out = sshexec(call=remote.rdns.shell, kwargs=dict(command="ls")) |
20 | | - out2 = sshexec(call=remote.rdns.shell, kwargs=dict(command="ls")) |
| 19 | + out = sshexec.logged(call=remote.rdns.shell, kwargs=dict(command="ls")) |
| 20 | + out2 = sshexec.logged(call=remote.rdns.shell, kwargs=dict(command="ls")) |
21 | 21 | assert out == out2 |
22 | 22 |
|
23 | 23 | def test_perform_initial(self, sshexec, maildomain): |
24 | | - res = sshexec( |
| 24 | + res = sshexec.logged( |
25 | 25 | remote.rdns.perform_initial_checks, kwargs=dict(mail_domain=maildomain) |
26 | 26 | ) |
27 | 27 | assert res["A"] or res["AAAA"] |
@@ -61,7 +61,7 @@ def test_exception(self, sshexec, capsys): |
61 | 61 | def test_opendkim_restarted(self, sshexec): |
62 | 62 | """check that opendkim is not running for longer than a day.""" |
63 | 63 | cmd = "systemctl show opendkim --timestamp=utc --property=ActiveEnterTimestamp" |
64 | | - out = sshexec(call=remote.rshell.shell, kwargs=dict(command=cmd)) |
| 64 | + out = sshexec.logged(call=remote.rshell.shell, kwargs=dict(command=cmd)) |
65 | 65 | datestring = out.split("=")[1] |
66 | 66 | since_date = datetime.datetime.strptime(datestring, "%a %Y-%m-%d %H:%M:%S %Z") |
67 | 67 | now = datetime.datetime.now(since_date.tzinfo) |
|
0 commit comments