From df266527f17987af4bf275cc04990bfb89a82f4a Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 12 Mar 2025 15:02:24 +0900 Subject: [PATCH] test/sandbox/mount: work around nondeterminism Signed-off-by: Ophestra --- test/sandbox/assert.go | 5 +++++ test/sandbox/mount.nix | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/sandbox/assert.go b/test/sandbox/assert.go index 12323a0..8e44626 100644 --- a/test/sandbox/assert.go +++ b/test/sandbox/assert.go @@ -41,6 +41,11 @@ func MustAssertMounts(name, hostMountsFile, wantFile string) { if want[i].Opts == "host_passthrough" { for _, ent := range hostMounts { if want[i].FSName == ent.FSName { + // special case for tmpfs bind mounts + if want[i].FSName == "tmpfs" && want[i].Dir != ent.Dir { + continue + } + want[i].Opts = ent.Opts goto out } diff --git a/test/sandbox/mount.nix b/test/sandbox/mount.nix index 3040791..b3a310b 100644 --- a/test/sandbox/mount.nix +++ b/test/sandbox/mount.nix @@ -51,7 +51,7 @@ let (ent "tmpfs" "/etc/passwd" "tmpfs" "ro,nosuid,nodev,relatime,uid=1000001,gid=1000001" 0 0) (ent "tmpfs" "/etc/group" "tmpfs" "ro,nosuid,nodev,relatime,uid=1000001,gid=1000001" 0 0) (ent "/dev/disk/by-label/nixos" "/run/user/65534/wayland-0" "ext4" "ro,nosuid,nodev,relatime" 0 0) - (ent "tmpfs" "/run/user/65534/pulse/native" "tmpfs" "ro,nosuid,nodev,relatime,size=98784k,nr_inodes=24696,mode=700,uid=1000,gid=100" 0 0) + (ent "tmpfs" "/run/user/65534/pulse/native" "tmpfs" "host_passthrough" 0 0) (ent "/dev/disk/by-label/nixos" "/run/user/65534/bus" "ext4" "ro,nosuid,nodev,relatime" 0 0) (ent "tmpfs" "/var/run/nscd" "tmpfs" "rw,nosuid,nodev,relatime,size=8k,mode=755,uid=1000001,gid=1000001" 0 0) (ent "overlay" "/.fortify/sbin/fortify" "overlay" "ro,nosuid,nodev,relatime,lowerdir=/mnt-root/nix/.ro-store,upperdir=/mnt-root/nix/.rw-store/upper,workdir=/mnt-root/nix/.rw-store/work,uuid=on" 0 0)