diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-13 04:38:48 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-13 04:38:48 +0900 |
| commit | 7638a44fa613f23434318bdf136723aa010e8638 (patch) | |
| tree | 7b5270ed4e9b6d7f1ee0f28c58d8077aa1d18005 /container/mount_test.go | |
| parent | a14b6535a66cb7ac0fc4827f767ffaee0ce04b57 (diff) | |
treewide: parallel tests
Most tests already had no global state, however parallel was never enabled. This change enables it for all applicable tests.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/mount_test.go')
| -rw-r--r-- | container/mount_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/container/mount_test.go b/container/mount_test.go index daa2287a..c6a5710f 100644 --- a/container/mount_test.go +++ b/container/mount_test.go @@ -10,6 +10,8 @@ import ( ) func TestBindMount(t *testing.T) { + t.Parallel() + checkSimple(t, "bindMount", []simpleTestCase{ {"mount", func(k *kstub) error { return newProcPaths(k, hostPath).bindMount(nil, "/host/nix", "/sysroot/nix", syscall.MS_RDONLY) @@ -34,6 +36,8 @@ func TestBindMount(t *testing.T) { } func TestRemount(t *testing.T) { + t.Parallel() + const sampleMountinfoNix = `254 407 253:0 / /host rw,relatime master:1 - ext4 /dev/disk/by-label/nixos rw 255 254 0:28 / /host/mnt/.ro-cwd ro,noatime master:2 - 9p cwd ro,access=client,msize=16384,trans=virtio 256 254 0:29 / /host/nix/.ro-store rw,relatime master:3 - 9p nix-store rw,cache=f,access=client,msize=16384,trans=virtio @@ -216,6 +220,8 @@ func TestRemount(t *testing.T) { } func TestRemountWithFlags(t *testing.T) { + t.Parallel() + checkSimple(t, "remountWithFlags", []simpleTestCase{ {"noop unmatched", func(k *kstub) error { return remountWithFlags(k, k, &vfs.MountInfoNode{MountInfoEntry: &vfs.MountInfoEntry{VfsOptstr: "rw,relatime,cat"}}, 0) @@ -236,6 +242,8 @@ func TestRemountWithFlags(t *testing.T) { } func TestMountTmpfs(t *testing.T) { + t.Parallel() + checkSimple(t, "mountTmpfs", []simpleTestCase{ {"mkdirAll", func(k *kstub) error { return mountTmpfs(k, "ephemeral", "/sysroot/run/user/1000", 0, 1<<10, 0700) @@ -260,6 +268,8 @@ func TestMountTmpfs(t *testing.T) { } func TestParentPerm(t *testing.T) { + t.Parallel() + testCases := []struct { perm os.FileMode want os.FileMode @@ -275,6 +285,7 @@ func TestParentPerm(t *testing.T) { for _, tc := range testCases { t.Run(tc.perm.String(), func(t *testing.T) { + t.Parallel() if got := parentPerm(tc.perm); got != tc.want { t.Errorf("parentPerm: %#o, want %#o", got, tc.want) } |
