-
-
Save aszlig/10d4a8541826d7cc922bcc86476f5376 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import <nixpkgs/nixos/tests/make-test.nix> { | |
name = "linux-hashbang-regression"; | |
machine = { pkgs, lib, ... }: { | |
virtualisation.writableStore = false; | |
boot.kernelPackages = let | |
linuxBisect = pkgs.buildLinux { | |
version = "4.20"; | |
modDirVersion = "4.20.0"; | |
extraMeta.branch = "4.20"; | |
src = pkgs.fetchFromGitHub { | |
owner = "torvalds"; | |
repo = "linux"; | |
rev = "e0c38a4d1f196a4b17d2eba36afff8f656a4f1de"; | |
sha256 = "18afcacgrzngid67p13xkhgfjjzyqvy778qi721k8fvl7acycn35"; | |
}; | |
kernelPatches = [ | |
pkgs.kernelPatches.modinst_arg_list_too_long | |
]; | |
}; | |
in pkgs.linuxPackagesFor linuxBisect; | |
environment.systemPackages = let | |
hashbangArgs = lib.concatMapStringsSep " " toString (lib.range 1 128); | |
in lib.singleton (pkgs.writeScriptBin "testme" '' | |
#!${pkgs.stdenv.shell} | |
output="$(${pkgs.writeScript "long-hashbang" '' | |
#!${pkgs.coreutils}/bin/echo ${hashbangArgs} | |
''})" | |
if [ -z "$output" ]; then | |
echo 'Hashbang was truncated:' "$output" >&2 | |
exit 1 | |
fi | |
''); | |
}; | |
testScript = '' | |
$machine->waitForUnit('multi-user.target'); | |
$machine->succeed('testme'); | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment