nixosTests.rasdaemon: init module test

and passthru test in the package

authored by Evils and committed by tomberek 788920fc e1437878

+38
+1
nixos/tests/all-tests.nix
··· 387 387 rabbitmq = handleTest ./rabbitmq.nix {}; 388 388 radarr = handleTest ./radarr.nix {}; 389 389 radicale = handleTest ./radicale.nix {}; 390 + rasdaemon = handleTest ./rasdaemon.nix {}; 390 391 redis = handleTest ./redis.nix {}; 391 392 redmine = handleTest ./redmine.nix {}; 392 393 restartByActivationScript = handleTest ./restart-by-activation-script.nix {};
+34
nixos/tests/rasdaemon.nix
··· 1 + import ./make-test-python.nix ({ pkgs, ... } : { 2 + name = "rasdaemon"; 3 + meta = with pkgs.lib.maintainers; { 4 + maintainers = [ evils ]; 5 + }; 6 + 7 + machine = { pkgs, ... }: { 8 + imports = [ ../modules/profiles/minimal.nix ]; 9 + hardware.rasdaemon = { 10 + enable = true; 11 + # should be enabled by default, just making sure 12 + record = true; 13 + # nonsense label 14 + labels = '' 15 + vendor: none 16 + product: none 17 + model: none 18 + DIMM_0: 0.0.0; 19 + ''; 20 + }; 21 + }; 22 + 23 + testScript = 24 + '' 25 + start_all() 26 + machine.wait_for_unit("multi-user.target") 27 + # confirm rasdaemon is running and has a valid database 28 + # some disk errors detected in qemu for some reason ¯\_(ツ)_/¯ 29 + machine.succeed("ras-mc-ctl --errors | tee /dev/stderr | grep -q 'No .* errors.'") 30 + # confirm the supplied labels text made it into the system 31 + machine.succeed("grep -q 'vendor: none' /etc/ras/dimm_labels.d/labels >&2") 32 + machine.shutdown() 33 + ''; 34 + })
+3
pkgs/os-specific/linux/rasdaemon/default.nix
··· 2 2 , autoreconfHook 3 3 , glibcLocales, kmod, coreutils, perl 4 4 , dmidecode, hwdata, sqlite 5 + , nixosTests 5 6 }: 6 7 7 8 stdenv.mkDerivation rec { ··· 87 88 substituteInPlace $out/bin/ras-mc-ctl \ 88 89 --replace 'find_prog ("dmidecode")' '"${dmidecode}/bin/dmidecode"' 89 90 ''; 91 + 92 + passthru.tests = nixosTests.rasdaemon; 90 93 91 94 meta = with lib; { 92 95 description = ''