diff --git a/nixos/tests/filesystems-overlayfs.nix b/nixos/tests/filesystems-overlayfs.nix index 79c75af81f1b2..f79f45187be94 100644 --- a/nixos/tests/filesystems-overlayfs.nix +++ b/nixos/tests/filesystems-overlayfs.nix @@ -38,6 +38,14 @@ in }; neededForBoot = true; }; + "/initrd-real-root-overlay" = { + overlay = { + lowerdir = [ userspaceLowerdir ]; + upperdir = "/run/upper"; # from initrd + workdir = "/run/work"; # from initrd + useStage1BaseDirectories = false; + }; + }; "/userspace-overlay" = { overlay = { lowerdir = [ userspaceLowerdir ]; @@ -69,6 +77,11 @@ in machine.succeed("touch /initrd-overlay/writable.txt") machine.succeed("findmnt --kernel --types overlay /initrd-overlay") + with subtest("Userspace overlay with upper/workdir in initrd"): + machine.wait_for_file("/initrd-real-root-overlay/userspace.txt", 5) + machine.succeed("touch /initrd-real-root-overlay/writable.txt") + machine.succeed("findmnt --kernel --types overlay /initrd-real-root-overlay") + with subtest("Userspace overlay"): machine.wait_for_file("/userspace-overlay/userspace.txt", 5) machine.succeed("touch /userspace-overlay/writable.txt")