about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@fastmail.fm>2019-01-06 13:17:38 +0100
committerJoachim Fasting <joachifm@fastmail.fm>2019-01-06 13:19:28 +0100
commit39c30a33c182764a26dba00f56fa4e3982a1c979 (patch)
tree96fa5465b2b5777ad45ca81d280ac38402257c13 /nixos
parentb3d8aa2677e8adf0fa6a779695e87d4ad091fd2f (diff)
downloadnixlib-39c30a33c182764a26dba00f56fa4e3982a1c979.tar
nixlib-39c30a33c182764a26dba00f56fa4e3982a1c979.tar.gz
nixlib-39c30a33c182764a26dba00f56fa4e3982a1c979.tar.bz2
nixlib-39c30a33c182764a26dba00f56fa4e3982a1c979.tar.lz
nixlib-39c30a33c182764a26dba00f56fa4e3982a1c979.tar.xz
nixlib-39c30a33c182764a26dba00f56fa4e3982a1c979.tar.zst
nixlib-39c30a33c182764a26dba00f56fa4e3982a1c979.zip
nixos/tests/hardened: test loading out-of-tree-modules
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/hardened.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/nixos/tests/hardened.nix b/nixos/tests/hardened.nix
index 683f56c45af4..07bd10963bab 100644
--- a/nixos/tests/hardened.nix
+++ b/nixos/tests/hardened.nix
@@ -5,7 +5,7 @@ import ./make-test.nix ({ pkgs, ...} : {
   };
 
   machine =
-    { lib, pkgs, ... }:
+    { lib, pkgs, config, ... }:
     with lib;
     { users.users.alice = { isNormalUser = true; extraGroups = [ "proc" ]; };
       users.users.sybil = { isNormalUser = true; group = "wheel"; };
@@ -22,12 +22,19 @@ import ./make-test.nix ({ pkgs, ...} : {
           options = [ "noauto" ];
         };
       };
+      boot.extraModulePackages = [ config.boot.kernelPackages.wireguard ];
+      boot.kernelModules = [ "wireguard" ];
     };
 
   testScript =
     ''
       $machine->waitForUnit("multi-user.target");
 
+      # Test loading out-of-tree modules
+      subtest "extra-module-packages", sub {
+          $machine->succeed("grep -Fq wireguard /proc/modules");
+      };
+
       # Test hidepid
       subtest "hidepid", sub {
           $machine->succeed("grep -Fq hidepid=2 /proc/mounts");