nixpkgs/nixos/tests/fancontrol.nix

29 lines
876 B
Nix
Raw Normal View History

2019-11-09 21:04:10 +03:00
import ./make-test-python.nix ({ pkgs, ... } : {
name = "fancontrol";
machine =
{ ... }:
{ hardware.fancontrol.enable = true;
hardware.fancontrol.config = ''
INTERVAL=42
DEVPATH=hwmon1=devices/platform/dummy
DEVNAME=hwmon1=dummy
FCTEMPS=hwmon1/device/pwm1=hwmon1/device/temp1_input
FCFANS=hwmon1/device/pwm1=hwmon1/device/fan1_input
MINTEMP=hwmon1/device/pwm1=25
MAXTEMP=hwmon1/device/pwm1=65
MINSTART=hwmon1/device/pwm1=150
MINSTOP=hwmon1/device/pwm1=0
'';
};
# This configuration cannot be valid for the test VM, so it's expected to get an 'outdated' error.
testScript = ''
2019-11-09 21:04:10 +03:00
start_all()
machine.wait_for_unit("fancontrol.service")
machine.wait_until_succeeds(
"journalctl -eu fancontrol | grep 'Configuration appears to be outdated'"
)
'';
})