(import (fetchTarball { # Pin to a specific nixpkgs commit, to make sure we have Linux 4.19. url = "https://github.com/NixOS/nixpkgs/archive/" + "776f084cf1bc7d174184e2d51b224e168fcd6fa4.tar.gz"; sha256 = "08rzhhlxb03fvq7pn4pr0f13spmg1k888mrmz5aa1fqcnf5pw9xf"; }) { config = {}; }).nixosTest ({ pkgs, ... }: { name = "overlayfs-linux-4.19-regression"; machine = { lib, pkgs, ... }: { virtualisation.writableStore = false; boot = { consoleLogLevel = lib.mkForce 8; kernelPackages = pkgs.linuxPackages_4_19; kernelParams = lib.singleton "dyndbg=\"file fs/overlayfs/* +p\""; kernelPatches = lib.singleton { name = "enable-dynamic-debug"; patch = null; extraConfig = '' DYNAMIC_DEBUG y OVERLAY_FS y ''; }; }; }; testScript = '' $machine->waitForUnit('multi-user.target'); $machine->succeed('${pkgs.writeScript "reproduce-overlay-regression.sh" '' #!/bin/sh -e tmp="$(mktemp -d)" trap ' umount "$tmp/result" find "$tmp" -depth -type d -exec rmdir {} + ' EXIT mkdir "$tmp/upper" "$tmp/work" "$tmp/result" bindir="$(dirname "$(readlink -e "$(command -v find)")")" mount -t overlay overlay "$tmp/result" \ -o "lowerdir=$bindir,upperdir=$tmp/upper,workdir=$tmp/work" sync sleep 10 strace -f "$tmp/result/find" / -maxdepth 1 ''} 2>&1'); ''; })