nixpkgs/nixos/tests/fancontrol.nix
Evils-Devils 5a78ce30d4 Fancontrol: add test etc from #70933 (#72065)
* lm_sensors: add fancontrol module + nixos test

fancontrol is a small script that checks temperature sensors and adapts
fan speeds accordingly. It reads a text config file that can be
auto-generated by running the pwmconfig wizard on the live system.
2019-10-29 15:06:32 +01:00

26 lines
841 B
Nix

import ./make-test.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 = ''
$machine->waitForUnit("fancontrol.service");
$machine->waitUntilSucceeds("journalctl -eu fancontrol | grep 'Configuration appears to be outdated'");
'';
})