Skip to content

Commit

Permalink
nixos/tests/filesystems-overlayfs: add test for initrd -> userspace o…
Browse files Browse the repository at this point in the history
…verlays
  • Loading branch information
msanft committed Nov 5, 2024
1 parent 137d0ef commit d2c5cc3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nixos/tests/filesystems-overlayfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit d2c5cc3

Please sign in to comment.