summaryrefslogtreecommitdiffstats
path: root/nixos/tests/watt.nix
blob: b06661b4b79fcb19642508f7d9776e2cd3c18eb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ pkgs, lib, ... }:
{
  name = "watt";
  meta.maintainers = with lib.maintainers; [ Soliprem ];

  nodes.machine = _: {
    services.watt.enable = true;
  };

  testScript = ''
    machine.wait_for_unit("watt.service")
    machine.succeed("watt --version | grep ${pkgs.watt.version}")
    machine.wait_until_succeeds("busctl --system status net.hadess.PowerProfiles")
    machine.wait_until_succeeds("busctl --system status dev.notashelf.Watt")
    machine.succeed("busctl --system introspect net.hadess.PowerProfiles /net/hadess/PowerProfiles net.hadess.PowerProfiles")
    machine.succeed("busctl --system introspect dev.notashelf.Watt /dev/notashelf/Watt dev.notashelf.Watt")
    machine.succeed("busctl --system get-property dev.notashelf.Watt /dev/notashelf/Watt dev.notashelf.Watt Version | grep ${pkgs.watt.version}")
  '';
}