diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-12 15:02:24 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-12 15:16:51 +0900 |
| commit | df266527f17987af4bf275cc04990bfb89a82f4a (patch) | |
| tree | c0e9e8957cc6f691ebe96a43b24281f5a6c42c2b /test | |
| parent | c8ed7aae6eb7fbf7481fb3f1672a5a75b55a4b97 (diff) | |
test/sandbox/mount: work around nondeterminism
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test')
| -rw-r--r-- | test/sandbox/assert.go | 5 | ||||
| -rw-r--r-- | test/sandbox/mount.nix | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/test/sandbox/assert.go b/test/sandbox/assert.go index 12323a0d..8e446268 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 30407913..b3a310ba 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) |
