nixosTests.fancontrol: fix test

and set myself (module author) as maintainer
This commit is contained in:
Evils 2021-05-07 20:00:47 +02:00 committed by Jonathan Ringer
parent 50530ec8b8
commit 3d043c6939

View file

@ -1,9 +1,12 @@
import ./make-test-python.nix ({ pkgs, ... } : { import ./make-test-python.nix ({ pkgs, ... } : {
name = "fancontrol"; name = "fancontrol";
meta = with pkgs.lib.maintainers; {
maintainers = [ evils ];
};
machine = machine = { ... }: {
{ ... }: imports = [ ../modules/profiles/minimal.nix ];
{ hardware.fancontrol.enable = true; hardware.fancontrol.enable = true;
hardware.fancontrol.config = '' hardware.fancontrol.config = ''
INTERVAL=42 INTERVAL=42
DEVPATH=hwmon1=devices/platform/dummy DEVPATH=hwmon1=devices/platform/dummy
@ -20,9 +23,12 @@ import ./make-test-python.nix ({ pkgs, ... } : {
# This configuration cannot be valid for the test VM, so it's expected to get an 'outdated' error. # This configuration cannot be valid for the test VM, so it's expected to get an 'outdated' error.
testScript = '' testScript = ''
start_all() start_all()
machine.wait_for_unit("fancontrol.service") # can't wait for unit fancontrol.service because it doesn't become active due to invalid config
machine.wait_until_succeeds( # fancontrol.service is WantedBy multi-user.target
"journalctl -eu fancontrol | grep 'Configuration appears to be outdated'" machine.wait_for_unit("multi-user.target")
machine.succeed(
"journalctl -eu fancontrol | tee /dev/stderr | grep 'Configuration appears to be outdated'"
) )
machine.shutdown()
''; '';
}) })