about summary refs log tree commit diff
path: root/nixos/tests/fancontrol.nix
diff options
context:
space:
mode:
authorEvils-Devils <30512529+Evils-Devils@users.noreply.github.com>2019-10-29 15:06:32 +0100
committermarkuskowa <markus.kowalewski@gmail.com>2019-10-29 15:06:32 +0100
commit5a78ce30d416b5dc488f8d4de5165214b6283bc0 (patch)
tree433684f9d86f06eaa13468905a9e10a279a80bf4 /nixos/tests/fancontrol.nix
parent14f812aeef754760e7b1f87f7b7c9a887cbf7765 (diff)
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.
Diffstat (limited to 'nixos/tests/fancontrol.nix')
-rw-r--r--nixos/tests/fancontrol.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/nixos/tests/fancontrol.nix b/nixos/tests/fancontrol.nix
new file mode 100644
index 0000000000000..83ddbb54c5bb7
--- /dev/null
+++ b/nixos/tests/fancontrol.nix
@@ -0,0 +1,25 @@
+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'");
+  '';
+})