nixosTests.rasdaemon: init module test

and passthru test in the package
main
Evils 3 years ago committed by tomberek
parent e14378789c
commit 788920fcdf
  1. 1
      nixos/tests/all-tests.nix
  2. 34
      nixos/tests/rasdaemon.nix
  3. 3
      pkgs/os-specific/linux/rasdaemon/default.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 {};

@ -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()
'';
})

@ -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

Loading…
Cancel
Save