mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
nixos/tests/zigbee2mqtt: test against dummy serial device
This commit is contained in:
parent
165326d2ca
commit
dec6392bc2
1 changed files with 11 additions and 2 deletions
|
@ -3,6 +3,15 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
|
||||||
name = "zigbee2mqtt";
|
name = "zigbee2mqtt";
|
||||||
nodes.machine = { pkgs, ... }:
|
nodes.machine = { pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
systemd.services.dummy-serial = {
|
||||||
|
wantedBy = [
|
||||||
|
"multi-user.target"
|
||||||
|
];
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${pkgs.socat}/bin/socat pty,link=/dev/ttyACM0,mode=666 pty,link=/dev/ttyACM1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.zigbee2mqtt = {
|
services.zigbee2mqtt = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
@ -11,10 +20,10 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
machine.wait_for_unit("zigbee2mqtt.service")
|
machine.wait_for_unit("multi-user.target")
|
||||||
machine.wait_until_fails("systemctl status zigbee2mqtt.service")
|
machine.wait_until_fails("systemctl status zigbee2mqtt.service")
|
||||||
machine.succeed(
|
machine.succeed(
|
||||||
"journalctl -eu zigbee2mqtt | grep \"Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyACM0'\""
|
"journalctl -eu zigbee2mqtt | grep 'Failed to connect to the adapter'"
|
||||||
)
|
)
|
||||||
|
|
||||||
machine.log(machine.succeed("systemd-analyze security zigbee2mqtt.service"))
|
machine.log(machine.succeed("systemd-analyze security zigbee2mqtt.service"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue