Skip to content

Commit 5b27f82

Browse files
committed
tests: make tests work with --ssh-host @Local
1 parent 7deba59 commit 5b27f82

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

cmdeploy/src/cmdeploy/cmdeploy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def test_cmd_options(parser):
203203
action="store_true",
204204
help="also run slow tests",
205205
)
206+
add_ssh_host_option(parser)
206207

207208

208209
def test_cmd(args, out):
@@ -214,6 +215,9 @@ def test_cmd(args, out):
214215
x = importlib.util.find_spec("deltachat")
215216
if x is None:
216217
out.check_call(f"{sys.executable} -m pip install deltachat")
218+
env = os.environ.copy()
219+
if args.ssh_host:
220+
env["CHATMAIL_SSH"] = args.ssh_host
217221

218222
pytest_path = shutil.which("pytest")
219223
pytest_args = [

cmdeploy/src/cmdeploy/tests/plugin.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,12 @@ def __init__(self, sshdomain):
337337

338338
def iter_output(self, logcmd=""):
339339
getjournal = "journalctl -f" if not logcmd else logcmd
340+
match self.sshdomain:
341+
case "@local": command = [getjournal]
342+
case "localhost": command = [getjournal]
343+
case _: command = ["ssh", f"root@{self.sshdomain}", getjournal]
340344
self.popen = subprocess.Popen(
341-
["ssh", f"root@{self.sshdomain}", getjournal],
345+
command,
342346
stdout=subprocess.PIPE,
343347
)
344348
while 1:

0 commit comments

Comments
 (0)