Merge pull request #137484 from i-do-cpp/add-disableInstallerTools-test

installers/tools: add test for system.disableInstallerTools option

authored by

Robert Hensing and committed by
GitHub
f023c471 3f1df4d5

+30
+1
nixos/tests/all-tests.nix
··· 98 98 deluge = handleTest ./deluge.nix {}; 99 99 dendrite = handleTest ./dendrite.nix {}; 100 100 dhparams = handleTest ./dhparams.nix {}; 101 + disable-installer-tools = handleTest ./disable-installer-tools.nix {}; 101 102 discourse = handleTest ./discourse.nix {}; 102 103 dnscrypt-proxy2 = handleTestOn ["x86_64-linux"] ./dnscrypt-proxy2.nix {}; 103 104 dnscrypt-wrapper = handleTestOn ["x86_64-linux"] ./dnscrypt-wrapper {};
+29
nixos/tests/disable-installer-tools.nix
··· 1 + import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... }: 2 + 3 + { 4 + name = "disable-installer-tools"; 5 + 6 + machine = 7 + { pkgs, lib, ... }: 8 + { 9 + system.disableInstallerTools = true; 10 + boot.enableContainers = false; 11 + environment.defaultPackages = []; 12 + }; 13 + 14 + testScript = '' 15 + machine.wait_for_unit("multi-user.target") 16 + machine.wait_until_succeeds("pgrep -f 'agetty.*tty1'") 17 + 18 + with subtest("nixos installer tools should not be included"): 19 + machine.fail("which nixos-rebuild") 20 + machine.fail("which nixos-install") 21 + machine.fail("which nixos-generate-config") 22 + machine.fail("which nixos-enter") 23 + machine.fail("which nixos-version") 24 + machine.fail("which nixos-build-vms") 25 + 26 + with subtest("perl should not be included"): 27 + machine.fail("which perl") 28 + ''; 29 + })