1 import ./make-test-python.nix ({ pkgs, lib, ...} :
5 meta.maintainers = with lib.maintainers; [ hexa ];
8 machine = { config, ... }: {
33 cmd = "/bin/sh -c 'echo -4500'";
40 cmd = "/bin/sh -c 'echo 7500'";
45 name = "dummy-charger";
49 cmd = "/bin/sh -c 'echo charger status A'";
53 cmd = "/bin/sh -c 'echo charger enabled state false'";
57 cmd = "/bin/sh -c 'echo set charger enabled state true'";
61 cmd = "/bin/sh -c 'echo set charger max current 7200'";
67 charger = "dummy-charger";
77 machine.wait_for_unit("evcc.service")
78 machine.wait_for_open_port(7070)
80 with subtest("Check package version propagates into frontend"):
82 "curl --fail http://localhost:7070 | grep '0.0.1-alpha'"
85 "curl --fail http://localhost:7070 | grep '${pkgs.evcc.version}'"
88 with subtest("Check journal for errors"):
89 _, output = machine.execute("journalctl -o cat -u evcc.service")
90 assert "FATAL" not in output
92 with subtest("Check systemd hardening"):
93 _, output = machine.execute("systemd-analyze security evcc.service | grep -v '✓'")