summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-09-17 18:01:14 +0000
committerGitHub <noreply@github.com>2021-09-17 18:01:14 +0000
commita21275cdae89ae5ac180f71baf1c908cb427b609 (patch)
tree496c38ea546e331aa0c7b658f33cd633580110a8 /nixos/tests
parent183cd6b09fdb5b9e9517b960e31ce2e4f42af0f7 (diff)
parent3f6e7482ee37808794c71625de8bed9317691e30 (diff)
downloadnixpkgs-a21275cdae89ae5ac180f71baf1c908cb427b609.tar
nixpkgs-a21275cdae89ae5ac180f71baf1c908cb427b609.tar.gz
nixpkgs-a21275cdae89ae5ac180f71baf1c908cb427b609.tar.bz2
nixpkgs-a21275cdae89ae5ac180f71baf1c908cb427b609.tar.lz
nixpkgs-a21275cdae89ae5ac180f71baf1c908cb427b609.tar.xz
nixpkgs-a21275cdae89ae5ac180f71baf1c908cb427b609.tar.zst
nixpkgs-a21275cdae89ae5ac180f71baf1c908cb427b609.zip
Merge master into staging-next
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/disable-installer-tools.nix29
2 files changed, 30 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 6103774ddd0..4836bce9752 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -98,6 +98,7 @@ in
   deluge = handleTest ./deluge.nix {};
   dendrite = handleTest ./dendrite.nix {};
   dhparams = handleTest ./dhparams.nix {};
+  disable-installer-tools = handleTest ./disable-installer-tools.nix {};
   discourse = handleTest ./discourse.nix {};
   dnscrypt-proxy2 = handleTestOn ["x86_64-linux"] ./dnscrypt-proxy2.nix {};
   dnscrypt-wrapper = handleTestOn ["x86_64-linux"] ./dnscrypt-wrapper {};
diff --git a/nixos/tests/disable-installer-tools.nix b/nixos/tests/disable-installer-tools.nix
new file mode 100644
index 00000000000..23c15faa8d3
--- /dev/null
+++ b/nixos/tests/disable-installer-tools.nix
@@ -0,0 +1,29 @@
+import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... }:
+
+{
+  name = "disable-installer-tools";
+
+  machine =
+    { pkgs, lib, ... }:
+    {
+        system.disableInstallerTools = true;
+        boot.enableContainers = false;
+        environment.defaultPackages = [];
+    };
+
+  testScript = ''
+      machine.wait_for_unit("multi-user.target")
+      machine.wait_until_succeeds("pgrep -f 'agetty.*tty1'")
+
+      with subtest("nixos installer tools should not be included"):
+          machine.fail("which nixos-rebuild")
+          machine.fail("which nixos-install")
+          machine.fail("which nixos-generate-config")
+          machine.fail("which nixos-enter")
+          machine.fail("which nixos-version")
+          machine.fail("which nixos-build-vms")
+
+      with subtest("perl should not be included"):
+          machine.fail("which perl")
+  '';
+})