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 /nixos/tests/rasdaemon.nix | |
parent | e14378789c9d8fe571980af14cbdcd31cdca06b6 (diff) |
nixosTests.rasdaemon: init module test
and passthru test in the package
Diffstat (limited to 'nixos/tests/rasdaemon.nix')
-rw-r--r-- | nixos/tests/rasdaemon.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/nixos/tests/rasdaemon.nix b/nixos/tests/rasdaemon.nix new file mode 100644 index 0000000000000..e4bd8d96a8d53 --- /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() + ''; +}) |