1 import ./make-test-python.nix ({ pkgs, ... }: {
3 meta.maintainers = with pkgs.lib.maintainers; [ bachp ];
5 nodes.machine = { pkgs, ... }: {
6 virtualisation.emptyDiskImages = [ 512 ];
7 networking.hostId = "deadbeef";
8 environment.systemPackages = with pkgs; [ parted ];
12 machine.succeed("ls /dev")
14 machine.succeed("mkdir -p /tmp/mnt")
16 # Test ext4 + overlayfs
18 'mkfs.ext4 -F -L overlay-ext4 /dev/vdb',
19 'mount -t ext4 /dev/vdb /tmp/mnt',
20 'mkdir -p /tmp/mnt/upper /tmp/mnt/lower /tmp/mnt/work /tmp/mnt/merged',
21 # Setup some existing files
22 'echo Replace > /tmp/mnt/lower/replace.txt',
23 'echo Append > /tmp/mnt/lower/append.txt',
24 'echo Overwrite > /tmp/mnt/lower/overwrite.txt',
25 'mount -t overlay overlay -o lowerdir=/tmp/mnt/lower,upperdir=/tmp/mnt/upper,workdir=/tmp/mnt/work /tmp/mnt/merged',
27 'echo New > /tmp/mnt/merged/new.txt',
28 '[[ "$(cat /tmp/mnt/merged/new.txt)" == New ]]',
30 '[[ "$(cat /tmp/mnt/merged/replace.txt)" == Replace ]]',
31 'echo Replaced > /tmp/mnt/merged/replace-tmp.txt',
32 'mv /tmp/mnt/merged/replace-tmp.txt /tmp/mnt/merged/replace.txt',
33 '[[ "$(cat /tmp/mnt/merged/replace.txt)" == Replaced ]]',
35 '[[ "$(cat /tmp/mnt/merged/overwrite.txt)" == Overwrite ]]',
36 'echo Overwritten > /tmp/mnt/merged/overwrite.txt',
37 '[[ "$(cat /tmp/mnt/merged/overwrite.txt)" == Overwritten ]]',
39 '[[ "$(cat /tmp/mnt/merged/append.txt)" == Append ]]',
40 'echo ed >> /tmp/mnt/merged/append.txt',
41 '[[ "$(cat /tmp/mnt/merged/append.txt)" == "Append\ned" ]]',
42 'umount /tmp/mnt/merged',