2019-11-09 19:04:10 +01:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... } : {
|
2019-10-29 15:06:32 +01:00
|
|
|
name = "fancontrol";
|
2021-05-07 20:00:47 +02:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
|
|
|
maintainers = [ evils ];
|
|
|
|
};
|
2019-10-29 15:06:32 +01:00
|
|
|
|
2022-03-21 00:15:30 +01:00
|
|
|
nodes.machine = { ... }: {
|
2021-05-07 20:00:47 +02:00
|
|
|
imports = [ ../modules/profiles/minimal.nix ];
|
|
|
|
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
|
|
|
|
'';
|
2019-10-29 15:06:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# This configuration cannot be valid for the test VM, so it's expected to get an 'outdated' error.
|
|
|
|
testScript = ''
|
2019-11-09 19:04:10 +01:00
|
|
|
start_all()
|
2021-05-07 20:00:47 +02:00
|
|
|
# can't wait for unit fancontrol.service because it doesn't become active due to invalid config
|
|
|
|
# fancontrol.service is WantedBy multi-user.target
|
|
|
|
machine.wait_for_unit("multi-user.target")
|
|
|
|
machine.succeed(
|
|
|
|
"journalctl -eu fancontrol | tee /dev/stderr | grep 'Configuration appears to be outdated'"
|
2019-11-09 19:04:10 +01:00
|
|
|
)
|
2021-05-07 20:00:47 +02:00
|
|
|
machine.shutdown()
|
2019-10-29 15:06:32 +01:00
|
|
|
'';
|
|
|
|
})
|