nixosTests.scx: init (#401972)

For now, test only the useful schedulers, there's no need to test all of them.

Co-authored-by: Gliczy <129636582+Gliczy@users.noreply.github.com>
Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>

authored by

Masum Reza
Gliczy
and committed by
GitHub
800908cd 16b19798

+46
+1
nixos/tests/all-tests.nix
··· 1192 1192 schleuder = handleTest ./schleuder.nix { }; 1193 1193 scion-freestanding-deployment = handleTest ./scion/freestanding-deployment { }; 1194 1194 scrutiny = runTest ./scrutiny.nix; 1195 + scx = runTest ./scx/default.nix; 1195 1196 sddm = handleTest ./sddm.nix { }; 1196 1197 sdl3 = handleTest ./sdl3.nix { }; 1197 1198 seafile = handleTest ./seafile.nix { };
+42
nixos/tests/scx/default.nix
··· 1 + { pkgs, ... }: 2 + 3 + { 4 + name = "scx_full"; 5 + meta = { 6 + inherit (pkgs.scx.full.meta) maintainers; 7 + }; 8 + 9 + nodes.machine = { 10 + boot.kernelPackages = pkgs.linuxPackages_latest; 11 + services.scx.enable = true; 12 + 13 + specialisation = { 14 + bpfland.configuration.services.scx.scheduler = "scx_bpfland"; 15 + central.configuration.services.scx.scheduler = "scx_central"; 16 + lavd.configuration.services.scx.scheduler = "scx_lavd"; 17 + rlfifo.configuration.services.scx.scheduler = "scx_rlfifo"; 18 + rustland.configuration.services.scx.scheduler = "scx_rustland"; 19 + rusty.configuration.services.scx.scheduler = "scx_rusty"; 20 + }; 21 + }; 22 + 23 + testScript = '' 24 + specialisation = [ 25 + "bpfland", 26 + "central", 27 + "lavd", 28 + "rlfifo", 29 + "rustland", 30 + "rusty" 31 + ] 32 + 33 + def activate_specialisation(name: str): 34 + machine.succeed(f"/run/booted-system/specialisation/{name}/bin/switch-to-configuration test >&2") 35 + 36 + for sched in specialisation: 37 + with subtest(f"{sched}"): 38 + activate_specialisation(sched) 39 + machine.succeed("systemctl restart scx.service") 40 + machine.succeed(f"ps -U root -u root u | grep scx_{sched}") 41 + ''; 42 + }
+3
pkgs/os-specific/linux/scx/scx_full.nix
··· 3 3 stdenv, 4 4 scx-common, 5 5 scx, 6 + nixosTests, 6 7 }: 7 8 scx.cscheds.overrideAttrs (oldAttrs: { 8 9 pname = "scx_full"; ··· 11 12 + '' 12 13 cp ${scx.rustscheds}/bin/* ${placeholder "bin"}/bin/ 13 14 ''; 15 + 16 + passthru.tests.basic = nixosTests.scx; 14 17 15 18 passthru.updateScript.command = ./update.sh; 16 19