Add basic kernel tests

This commit is contained in:
Tim Steinbach 2017-09-04 13:56:30 -04:00
parent da3640ec56
commit 656ec9de0e
No known key found for this signature in database
GPG Key ID: 472BFCCA96BD0EDA
5 changed files with 59 additions and 0 deletions

View File

@ -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)

View File

@ -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; };

View File

@ -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'");
'';
})

View File

@ -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}'");
'';
})

View File

@ -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}'");
'';
})