1 { system ? builtins.currentSystem
3 , pkgs ? import ../.. { inherit system config; }
9 stapScript = pkgs.writeText "test.stp" ''
10 probe kernel.function("do_sys_poll") {
11 println("kernel function probe & println work")
16 ## TODO shared infra with ../kernel-generic.nix
17 testsForLinuxPackages = linuxPackages: (import ./make-test-python.nix ({ pkgs, ... }: {
18 name = "kernel-${linuxPackages.kernel.version}";
19 meta = with pkgs.lib.maintainers; {
20 maintainers = [ bendlas ];
23 nodes.machine = { ... }:
25 boot.kernelPackages = linuxPackages;
26 programs.systemtap.enable = true;
31 with subtest("Capture stap ouput"):
32 output = machine.succeed("stap ${stapScript} 2>&1")
34 with subtest("Ensure that expected output from stap script is there"):
35 assert "kernel function probe & println work\n" == output, "kernel function probe & println work\n != " + output
39 ## TODO shared infra with ../kernel-generic.nix
41 inherit (pkgs.linuxKernel.packageAliases) linux_default linux_latest;
44 in mapAttrs (_: lP: testsForLinuxPackages lP) kernels // {
46 inherit testsForLinuxPackages;
48 testsForKernel = kernel: testsForLinuxPackages (pkgs.linuxPackagesFor kernel);