From 341179bfa2da981051fb9bffe6f4ed90f878eff7 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:27:19 +0100 Subject: [PATCH] nixos/tests/filesystems-overlayfs: add test for initrd -> userspace overlays --- nixos/tests/filesystems-overlayfs.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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")