git.iko.soy/typeable/nixpkgs
on master help sign in
nixosTests.fancontrol: fix test

and set myself (module author) as maintainer

commit3d043c6939574cf335f4407967273b4cb9ca795f authorEvils <evils.devils@protonmail.com> dateFri 7 May 2021, 20:00 (6 years ago) parent50530ec
1 file changed+23−17
nixos/tests/fancontrol.nix+23−17
nixos/tests/fancontrol.nix+23−17
@@ -1,28 +1,34 @@
11import ./make-test-python.nix ({ pkgs, ... } : {
22 name = "fancontrol";
3+ meta = with pkgs.lib.maintainers; {
4+ maintainers = [ evils ];
5+ };
36
4− machine =
5− { ... }:
6− { hardware.fancontrol.enable = true;
7− hardware.fancontrol.config = ''
8− INTERVAL=42
9− DEVPATH=hwmon1=devices/platform/dummy
10− DEVNAME=hwmon1=dummy
11− FCTEMPS=hwmon1/device/pwm1=hwmon1/device/temp1_input
12− FCFANS=hwmon1/device/pwm1=hwmon1/device/fan1_input
13− MINTEMP=hwmon1/device/pwm1=25
14− MAXTEMP=hwmon1/device/pwm1=65
15− MINSTART=hwmon1/device/pwm1=150
16− MINSTOP=hwmon1/device/pwm1=0
17− '';
7+ machine = { ... }: {
8+ imports = [ ../modules/profiles/minimal.nix ];
9+ hardware.fancontrol.enable = true;
10+ hardware.fancontrol.config = ''
11+ INTERVAL=42
12+ DEVPATH=hwmon1=devices/platform/dummy
13+ DEVNAME=hwmon1=dummy
14+ FCTEMPS=hwmon1/device/pwm1=hwmon1/device/temp1_input
15+ FCFANS=hwmon1/device/pwm1=hwmon1/device/fan1_input
16+ MINTEMP=hwmon1/device/pwm1=25
17+ MAXTEMP=hwmon1/device/pwm1=65
18+ MINSTART=hwmon1/device/pwm1=150
19+ MINSTOP=hwmon1/device/pwm1=0
20+ '';
1821 };
1922
2023 # This configuration cannot be valid for the test VM, so it's expected to get an 'outdated' error.
2124 testScript = ''
2225 start_all()
23− machine.wait_for_unit("fancontrol.service")
24− machine.wait_until_succeeds(
25− "journalctl -eu fancontrol | grep 'Configuration appears to be outdated'"
26+ # can't wait for unit fancontrol.service because it doesn't become active due to invalid config
27+ # fancontrol.service is WantedBy multi-user.target
28+ machine.wait_for_unit("multi-user.target")
29+ machine.succeed(
30+ "journalctl -eu fancontrol | tee /dev/stderr | grep 'Configuration appears to be outdated'"
2631 )
32+ machine.shutdown()
2733 '';
2834})