diff options
author | Evils <evils.devils@protonmail.com> | 2021-02-02 01:39:50 +0100 |
---|---|---|
committer | tomberek <tomberek@users.noreply.github.com> | 2021-10-30 22:22:12 -0400 |
commit | 788920fcdf8fff2fb3eb0a70d00822a45ecd454f (patch) | |
tree | e9e56ee515f5c52929074058b2dca56a7fe34f85 | |
parent | e14378789c9d8fe571980af14cbdcd31cdca06b6 (diff) | |
download | nixpkgs-788920fcdf8fff2fb3eb0a70d00822a45ecd454f.tar nixpkgs-788920fcdf8fff2fb3eb0a70d00822a45ecd454f.tar.gz nixpkgs-788920fcdf8fff2fb3eb0a70d00822a45ecd454f.tar.bz2 nixpkgs-788920fcdf8fff2fb3eb0a70d00822a45ecd454f.tar.lz nixpkgs-788920fcdf8fff2fb3eb0a70d00822a45ecd454f.tar.xz nixpkgs-788920fcdf8fff2fb3eb0a70d00822a45ecd454f.tar.zst nixpkgs-788920fcdf8fff2fb3eb0a70d00822a45ecd454f.zip |
nixosTests.rasdaemon: init module test
and passthru test in the package
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/rasdaemon.nix | 34 | ||||
-rw-r--r-- | pkgs/os-specific/linux/rasdaemon/default.nix | 3 |
3 files changed, 38 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index b3f6425763c..1f91d5b4f38 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -387,6 +387,7 @@ in rabbitmq = handleTest ./rabbitmq.nix {}; radarr = handleTest ./radarr.nix {}; radicale = handleTest ./radicale.nix {}; + rasdaemon = handleTest ./rasdaemon.nix {}; redis = handleTest ./redis.nix {}; redmine = handleTest ./redmine.nix {}; restartByActivationScript = handleTest ./restart-by-activation-script.nix {}; diff --git a/nixos/tests/rasdaemon.nix b/nixos/tests/rasdaemon.nix new file mode 100644 index 00000000000..e4bd8d96a8d --- /dev/null +++ b/nixos/tests/rasdaemon.nix @@ -0,0 +1,34 @@ +import ./make-test-python.nix ({ pkgs, ... } : { + name = "rasdaemon"; + meta = with pkgs.lib.maintainers; { + maintainers = [ evils ]; + }; + + machine = { pkgs, ... }: { + imports = [ ../modules/profiles/minimal.nix ]; + hardware.rasdaemon = { + enable = true; + # should be enabled by default, just making sure + record = true; + # nonsense label + labels = '' + vendor: none + product: none + model: none + DIMM_0: 0.0.0; + ''; + }; + }; + + testScript = + '' + start_all() + machine.wait_for_unit("multi-user.target") + # confirm rasdaemon is running and has a valid database + # some disk errors detected in qemu for some reason ¯\_(ツ)_/¯ + machine.succeed("ras-mc-ctl --errors | tee /dev/stderr | grep -q 'No .* errors.'") + # confirm the supplied labels text made it into the system + machine.succeed("grep -q 'vendor: none' /etc/ras/dimm_labels.d/labels >&2") + machine.shutdown() + ''; +}) diff --git a/pkgs/os-specific/linux/rasdaemon/default.nix b/pkgs/os-specific/linux/rasdaemon/default.nix index cb6522d10a3..22ca59bff53 100644 --- a/pkgs/os-specific/linux/rasdaemon/default.nix +++ b/pkgs/os-specific/linux/rasdaemon/default.nix @@ -2,6 +2,7 @@ , autoreconfHook , glibcLocales, kmod, coreutils, perl , dmidecode, hwdata, sqlite +, nixosTests }: stdenv.mkDerivation rec { @@ -88,6 +89,8 @@ stdenv.mkDerivation rec { --replace 'find_prog ("dmidecode")' '"${dmidecode}/bin/dmidecode"' ''; + passthru.tests = nixosTests.rasdaemon; + meta = with lib; { description = '' A Reliability, Availability and Serviceability (RAS) logging tool using EDAC kernel tracing events |