2021-04-30 00:45:57 +01:00
|
|
|
import ./make-test-python.nix ({ pkgs, lib, ... }:
|
2020-06-07 23:09:50 +01:00
|
|
|
{
|
2022-09-01 12:32:47 +01:00
|
|
|
name = "zigbee2mqtt";
|
2022-03-20 23:15:30 +00:00
|
|
|
nodes.machine = { pkgs, ... }:
|
2020-06-07 23:09:50 +01:00
|
|
|
{
|
2024-02-03 01:22:44 +00:00
|
|
|
systemd.services.dummy-serial = {
|
|
|
|
wantedBy = [
|
|
|
|
"multi-user.target"
|
|
|
|
];
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${pkgs.socat}/bin/socat pty,link=/dev/ttyACM0,mode=666 pty,link=/dev/ttyACM1";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-06-07 23:09:50 +01:00
|
|
|
services.zigbee2mqtt = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2021-04-30 00:45:57 +01:00
|
|
|
|
|
|
|
systemd.services.zigbee2mqtt.serviceConfig.DevicePolicy = lib.mkForce "auto";
|
2020-06-07 23:09:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2024-02-03 01:22:44 +00:00
|
|
|
machine.wait_for_unit("multi-user.target")
|
2020-06-07 23:09:50 +01:00
|
|
|
machine.wait_until_fails("systemctl status zigbee2mqtt.service")
|
|
|
|
machine.succeed(
|
2024-02-03 01:22:44 +00:00
|
|
|
"journalctl -eu zigbee2mqtt | grep 'Failed to connect to the adapter'"
|
2020-06-07 23:09:50 +01:00
|
|
|
)
|
2021-04-30 00:45:57 +01:00
|
|
|
|
|
|
|
machine.log(machine.succeed("systemd-analyze security zigbee2mqtt.service"))
|
2020-06-07 23:09:50 +01:00
|
|
|
'';
|
|
|
|
}
|
|
|
|
)
|