Skip to content

Instantly share code, notes, and snippets.

@aszlig
Created January 29, 2019 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aszlig/feab4905b9922b29b9313cdcff42f6b5 to your computer and use it in GitHub Desktop.
Save aszlig/feab4905b9922b29b9313cdcff42f6b5 to your computer and use it in GitHub Desktop.
(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');
'';
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment