2021-02-02 00:39:50 +00:00
|
|
|
import ./make-test-python.nix (
|
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
|
|
|
name = "rasdaemon";
|
2022-03-20 23:15:30 +00:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2021-02-02 00:39:50 +00:00
|
|
|
maintainers = [ evils ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes.machine =
|
2022-03-20 23:15:30 +00:00
|
|
|
{ pkgs, ... }:
|
2024-12-10 19:26:33 +00:00
|
|
|
{
|
2021-02-02 00:39:50 +00:00
|
|
|
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;
|
2024-12-10 19:26:33 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-02-02 00:39:50 +00:00
|
|
|
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()
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
)
|