1import ./make-test-python.nix (
2 { pkgs, ... }:
3 {
4 name = "rasdaemon";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ evils ];
7 };
8
9 nodes.machine =
10 { pkgs, ... }:
11 {
12 imports = [ ../modules/profiles/minimal.nix ];
13 hardware.rasdaemon = {
14 enable = true;
15 # should be enabled by default, just making sure
16 record = true;
17 # nonsense label
18 labels = ''
19 vendor: none
20 product: none
21 model: none
22 DIMM_0: 0.0.0;
23 '';
24 };
25 };
26
27 testScript = ''
28 start_all()
29 machine.wait_for_unit("multi-user.target")
30 # confirm rasdaemon is running and has a valid database
31 # some disk errors detected in qemu for some reason ¯\_(ツ)_/¯
32 machine.wait_until_succeeds("ras-mc-ctl --errors | tee /dev/stderr | grep -q 'No .* errors.'")
33 # confirm the supplied labels text made it into the system
34 machine.succeed("grep -q 'vendor: none' /etc/ras/dimm_labels.d/labels >&2")
35 machine.shutdown()
36 '';
37 }
38)