summary refs log tree commit diff
path: root/nixos/tests/zigbee2mqtt.nix
blob: 98aadbb699bdf6b9ba8c762e91e2640245ed40a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import ./make-test-python.nix ({ pkgs, lib, ... }:

  {
    machine = { pkgs, ... }:
      {
        services.zigbee2mqtt = {
          enable = true;
        };

        systemd.services.zigbee2mqtt.serviceConfig.DevicePolicy = lib.mkForce "auto";
      };

    testScript = ''
      machine.wait_for_unit("zigbee2mqtt.service")
      machine.wait_until_fails("systemctl status zigbee2mqtt.service")
      machine.succeed(
          "journalctl -eu zigbee2mqtt | grep \"Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyACM0'\""
      )

      machine.log(machine.succeed("systemd-analyze security zigbee2mqtt.service"))
    '';
  }
)