summaryrefslogtreecommitdiffstats
path: root/nixos/tests/scx/default.nix
blob: 41c7b84c90b70a5aa7ef394bef3f07d4d9c5790b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ pkgs, ... }:

{
  name = "scx_full";
  meta = {
    inherit (pkgs.scx.full.meta) maintainers;
  };

  nodes.machine = {
    boot.kernelPackages = pkgs.linuxPackages_latest;
    services.scx.enable = true;

    specialisation = {
      beerland.configuration.services.scx.scheduler = "scx_beerland";
      bpfland.configuration.services.scx.scheduler = "scx_bpfland";
      cake.configuration.services.scx.scheduler = "scx_cake";
      chaos.configuration.services.scx.scheduler = "scx_chaos";
      cosmos.configuration.services.scx.scheduler = "scx_cosmos";
      flash.configuration.services.scx.scheduler = "scx_flash";
      flow.configuration.services.scx.scheduler = "scx_flow";
      forge.configuration.services.scx.scheduler = "scx_forge";
      lavd.configuration.services.scx.scheduler = "scx_lavd";
      p2dq.configuration.services.scx.scheduler = "scx_p2dq";
      pandemonium.configuration.services.scx.scheduler = "scx_pandemonium";
      rlfifo.configuration.services.scx.scheduler = "scx_rlfifo";
      rustland.configuration.services.scx.scheduler = "scx_rustland";
      rusty.configuration.services.scx.scheduler = "scx_rusty";
      tickless.configuration.services.scx.scheduler = "scx_tickless";
    };
  };

  testScript = ''
    specialisation = [
      "beerland",
      "bpfland",
      "cake",
      "chaos",
      "cosmos",
      "flash",
      "flow",
      "forge",
      "lavd",
      "p2dq",
      "pandemonium",
      "rlfifo",
      "rustland",
      "rusty",
      "tickless",
    ]

    def activate_specialisation(name: str):
      machine.succeed(f"/run/booted-system/specialisation/{name}/bin/switch-to-configuration test >&2")

    for sched in specialisation:
      with subtest(f"{sched}"):
        activate_specialisation(sched)
        machine.succeed("systemctl restart scx.service")
        machine.succeed(f"ps -U root -u root u | grep scx_{sched}")
  '';
}