Browse Source

Add basic kernel tests

nsd-state-dir
Tim Steinbach 5 years ago
parent
commit
656ec9de0e
No known key found for this signature in database GPG Key ID: 472BFCCA96BD0EDA
  1. 3
      nixos/release-combined.nix
  2. 3
      nixos/release.nix
  3. 19
      nixos/tests/kernel-copperhead.nix
  4. 17
      nixos/tests/kernel-latest.nix
  5. 17
      nixos/tests/kernel-lts.nix

3
nixos/release-combined.nix

@ -91,6 +91,9 @@ in rec {
(all nixos.tests.keymap.neo)
(all nixos.tests.keymap.qwertz)
(all nixos.tests.plasma5)
(all nixos.tests.kernel-copperhead)
(all nixos.tests.kernel-latest)
(all nixos.tests.kernel-lts)
#(all nixos.tests.lightdm)
(all nixos.tests.login)
(all nixos.tests.misc)

3
nixos/release.nix

@ -261,6 +261,9 @@ in rec {
tests.plasma5 = callTest tests/plasma5.nix {};
tests.keymap = callSubTests tests/keymap.nix {};
tests.initrdNetwork = callTest tests/initrd-network.nix {};
tests.kernel-copperhead = tests/kernel-copperhead.nix {};
tests.kernel-latest = tests/kernel-latest.nix {};
tests.kernel-lts = tests/kernel-lts.nix {};
tests.keystone = callTest tests/keystone.nix {};
tests.kubernetes = hydraJob (import tests/kubernetes.nix { system = "x86_64-linux"; });
tests.latestKernel.login = callTest tests/login.nix { latestKernel = true; };

19
nixos/tests/kernel-copperhead.nix

@ -0,0 +1,19 @@
import ./make-test.nix ({ pkgs, ...} : {
name = "kernel-copperhead";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ nequissimus ];
};
machine = { config, lib, pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_hardened_copperhead;
};
testScript =
''
$machine->succeed("uname -a");
$machine->succeed("uname -s | grep 'Linux'");
$machine->succeed("uname -a | grep '${pkgs.linuxPackages_hardened_copperhead.kernel.modDirVersion}'");
$machine->succeed("uname -a | grep 'hardened'");
'';
})

17
nixos/tests/kernel-latest.nix

@ -0,0 +1,17 @@
import ./make-test.nix ({ pkgs, ...} : {
name = "kernel-latest";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ nequissimus ];
};
machine = { config, lib, pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
};
testScript =
''
$machine->succeed("uname -s | grep 'Linux'");
$machine->succeed("uname -a | grep '${pkgs.linuxPackages_latest.kernel.version}'");
'';
})

17
nixos/tests/kernel-lts.nix

@ -0,0 +1,17 @@
import ./make-test.nix ({ pkgs, ...} : {
name = "kernel-lts";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ nequissimus ];
};
machine = { config, lib, pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages;
};
testScript =
''
$machine->succeed("uname -s | grep 'Linux'");
$machine->succeed("uname -a | grep '${pkgs.linuxPackages.kernel.version}'");
'';
})
Loading…
Cancel
Save