1{ pkgs, ... }:
2
3{
4 name = "tuned";
5 meta = { inherit (pkgs.tuned.meta) maintainers; };
6
7 nodes.machine = {
8 imports = [ ./common/x11.nix ];
9
10 services.tuned = {
11 enable = true;
12
13 profiles = {
14 test-profile = {
15 sysctls = {
16 type = "sysctl";
17 replace = true;
18
19 "net.core.rmem_default" = 262144;
20 "net.core.wmem_default" = 262144;
21 };
22 };
23 };
24 };
25 };
26
27 enableOCR = true;
28
29 testScript = ''
30 with subtest("Wait for service startup"):
31 machine.wait_for_x()
32 machine.wait_for_unit("tuned.service")
33 machine.wait_for_unit("tuned-ppd.service")
34
35 with subtest("Get service status"):
36 machine.succeed("systemctl status tuned.service")
37
38 # NOTE(@getchoo): `pkgs.tuned` provides its own `tuned.conf` for tmpfiles.d
39 # A naming conflict with it and a `systemd.tmpfiles.settings` entry appeared in the initial PR for this module
40 # This breaks the GUI in some cases, and it was annoying to figure out. Make sure it doesn't happen again!
41 with subtest("Ensure systemd-tmpfiles paths are configured"):
42 machine.succeed("systemd-tmpfiles --cat-config | grep '/etc/tuned/profiles'")
43 machine.succeed("systemd-tmpfiles --cat-config | grep '/run/tuned'")
44
45 with subtest("Test GUI"):
46 machine.execute("tuned-gui >&2 &")
47 machine.wait_for_window("tuned")
48 machine.wait_for_text("Start TuneD Daemon")
49 machine.screenshot("gui")
50 '';
51}