diff --git a/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py b/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py index 2b55f6bf..e0350fb9 100644 --- a/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py +++ b/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py @@ -1,5 +1,4 @@ import datetime -import os import smtplib import socket import subprocess @@ -8,7 +7,6 @@ import time import pytest from cmdeploy import remote -from cmdeploy.cmdeploy import main from cmdeploy.sshexec import SSHExec @@ -70,46 +68,6 @@ class TestSSHExecutor: assert (now - since_date).total_seconds() < 60 * 60 * 51 -def test_status_cmd(chatmail_config, capsys, request): - os.chdir(request.config.invocation_params.dir) - assert main(["status"]) == 0 - status_out = capsys.readouterr() - print(status_out.out) - - services = [ - "acmetool-redirector", - "chatmail-metadata", - "doveauth", - "dovecot", - "fcgiwrap", - "filtermail-incoming", - "filtermail", - "lastlogin", - "nginx", - "opendkim", - "postfix@-", - "systemd-journald", - "turnserver", - "unbound", - ] - not_running = [] - for service in services: - active = False - for line in status_out: - if service in line: - active = True - if not "loaded" in line: - active = False - if not "active" in line: - active = False - if not "running" in line: - active = False - break - if not active: - not_running.append(service) - assert not_running == [] - - def test_timezone_env(remote): for line in remote.iter_output("env"): print(line) diff --git a/cmdeploy/src/cmdeploy/tests/online/test_3_status.py b/cmdeploy/src/cmdeploy/tests/online/test_3_status.py new file mode 100644 index 00000000..981df231 --- /dev/null +++ b/cmdeploy/src/cmdeploy/tests/online/test_3_status.py @@ -0,0 +1,43 @@ +import os + +from cmdeploy.cmdeploy import main + + +def test_status_cmd(chatmail_config, capsys, request): + os.chdir(request.config.invocation_params.dir) + assert main(["status"]) == 0 + status_out = capsys.readouterr() + print(status_out.out) + + services = [ + "acmetool-redirector", + "chatmail-metadata", + "doveauth", + "dovecot", + "fcgiwrap", + "filtermail-incoming", + "filtermail", + "lastlogin", + "nginx", + "opendkim", + "postfix@-", + "systemd-journald", + "turnserver", + "unbound", + ] + not_running = [] + for service in services: + active = False + for line in status_out: + if service in line: + active = True + if not "loaded" in line: + active = False + if not "active" in line: + active = False + if not "running" in line: + active = False + break + if not active: + not_running.append(service) + assert not_running == []