diff options
Diffstat (limited to 'internal/app/app_test.go')
| -rw-r--r-- | internal/app/app_test.go | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/internal/app/app_test.go b/internal/app/app_test.go index 65010917..3f3d2983 100644 --- a/internal/app/app_test.go +++ b/internal/app/app_test.go @@ -17,8 +17,8 @@ import ( "time" "hakurei.app/container" - "hakurei.app/container/bits" "hakurei.app/container/check" + "hakurei.app/container/comp" "hakurei.app/container/fhs" "hakurei.app/hst" "hakurei.app/internal/app/state" @@ -98,24 +98,24 @@ func TestApp(t *testing.T) { "XDG_SESSION_TYPE=tty", }, Ops: new(container.Ops). - Root(m("/"), bits.BindWritable). + Root(m("/"), comp.BindWritable). Proc(m("/proc/")). Tmpfs(hst.AbsPrivateTmp, 4096, 0755). DevWritable(m("/dev/"), true). Tmpfs(m("/dev/shm"), 0, 01777). Tmpfs(m("/run/user/"), 4096, 0755). - Bind(m("/tmp/hakurei.0/runtime/0"), m("/run/user/65534"), bits.BindWritable). - Bind(m("/tmp/hakurei.0/tmpdir/0"), m("/tmp/"), bits.BindWritable). + Bind(m("/tmp/hakurei.0/runtime/0"), m("/run/user/65534"), comp.BindWritable). + Bind(m("/tmp/hakurei.0/tmpdir/0"), m("/tmp/"), comp.BindWritable). Place(m("/etc/passwd"), []byte("chronos:x:65534:65534:Hakurei:/home/chronos:/run/current-system/sw/bin/zsh\n")). Place(m("/etc/group"), []byte("hakurei:x:65534:\n")). - Bind(m("/dev/kvm"), m("/dev/kvm"), bits.BindWritable|bits.BindDevice|bits.BindOptional). + Bind(m("/dev/kvm"), m("/dev/kvm"), comp.BindWritable|comp.BindDevice|comp.BindOptional). Etc(m("/etc/"), "4a450b6596d7bc15bd01780eb9a607ac"). Tmpfs(m("/run/user/1971"), 8192, 0755). Tmpfs(m("/run/nscd"), 8192, 0755). Tmpfs(m("/run/dbus"), 8192, 0755). Remount(m("/dev/"), syscall.MS_RDONLY). Remount(m("/"), syscall.MS_RDONLY), - SeccompPresets: bits.PresetExt | bits.PresetDenyDevel, + SeccompPresets: comp.PresetExt | comp.PresetDenyDevel, HostNet: true, HostAbstract: true, RetainSession: true, @@ -271,14 +271,14 @@ func TestApp(t *testing.T) { "XDG_SESSION_TYPE=wayland", }, Ops: new(container.Ops). - Root(m("/"), bits.BindWritable). + Root(m("/"), comp.BindWritable). Proc(m("/proc/")). Tmpfs(hst.AbsPrivateTmp, 4096, 0755). DevWritable(m("/dev/"), true). Tmpfs(m("/dev/shm"), 0, 01777). Tmpfs(m("/run/user/"), 4096, 0755). - Bind(m("/tmp/hakurei.0/runtime/9"), m("/run/user/65534"), bits.BindWritable). - Bind(m("/tmp/hakurei.0/tmpdir/9"), m("/tmp/"), bits.BindWritable). + Bind(m("/tmp/hakurei.0/runtime/9"), m("/run/user/65534"), comp.BindWritable). + Bind(m("/tmp/hakurei.0/tmpdir/9"), m("/tmp/"), comp.BindWritable). Place(m("/etc/passwd"), []byte("chronos:x:65534:65534:Hakurei:/home/chronos:/run/current-system/sw/bin/zsh\n")). Place(m("/etc/group"), []byte("hakurei:x:65534:\n")). Bind(m("/tmp/hakurei.0/ebf083d1b175911782d413369b64ce7c/wayland"), m("/run/user/65534/wayland-0"), 0). @@ -286,15 +286,15 @@ func TestApp(t *testing.T) { Place(m(hst.PrivateTmp+"/pulse-cookie"), bytes.Repeat([]byte{0}, pulseCookieSizeMax)). Bind(m("/tmp/hakurei.0/ebf083d1b175911782d413369b64ce7c/bus"), m("/run/user/65534/bus"), 0). Bind(m("/tmp/hakurei.0/ebf083d1b175911782d413369b64ce7c/system_bus_socket"), m("/var/run/dbus/system_bus_socket"), 0). - Bind(m("/dev/dri"), m("/dev/dri"), bits.BindWritable|bits.BindDevice|bits.BindOptional). - Bind(m("/dev/kvm"), m("/dev/kvm"), bits.BindWritable|bits.BindDevice|bits.BindOptional). + Bind(m("/dev/dri"), m("/dev/dri"), comp.BindWritable|comp.BindDevice|comp.BindOptional). + Bind(m("/dev/kvm"), m("/dev/kvm"), comp.BindWritable|comp.BindDevice|comp.BindOptional). Etc(m("/etc/"), "ebf083d1b175911782d413369b64ce7c"). Tmpfs(m("/run/user/1971"), 8192, 0755). Tmpfs(m("/run/nscd"), 8192, 0755). Tmpfs(m("/run/dbus"), 8192, 0755). Remount(m("/dev/"), syscall.MS_RDONLY). Remount(m("/"), syscall.MS_RDONLY), - SeccompPresets: bits.PresetExt | bits.PresetDenyDevel, + SeccompPresets: comp.PresetExt | comp.PresetDenyDevel, HostNet: true, HostAbstract: true, RetainSession: true, @@ -428,8 +428,8 @@ func TestApp(t *testing.T) { DevWritable(m("/dev/"), true). Tmpfs(m("/dev/shm"), 0, 01777). Tmpfs(m("/run/user/"), 4096, 0755). - Bind(m("/tmp/hakurei.0/runtime/1"), m("/run/user/1971"), bits.BindWritable). - Bind(m("/tmp/hakurei.0/tmpdir/1"), m("/tmp/"), bits.BindWritable). + Bind(m("/tmp/hakurei.0/runtime/1"), m("/run/user/1971"), comp.BindWritable). + Bind(m("/tmp/hakurei.0/tmpdir/1"), m("/tmp/"), comp.BindWritable). Place(m("/etc/passwd"), []byte("u0_a1:x:1971:100:Hakurei:/var/lib/persist/module/hakurei/0/1:/run/current-system/sw/bin/zsh\n")). Place(m("/etc/group"), []byte("hakurei:x:100:\n")). Bind(m("/run/user/1971/wayland-0"), m("/run/user/1971/wayland-0"), 0). @@ -441,18 +441,18 @@ func TestApp(t *testing.T) { Bind(m("/usr/bin/"), m("/usr/bin/"), 0). Bind(m("/nix/store"), m("/nix/store"), 0). Bind(m("/run/current-system"), m("/run/current-system"), 0). - Bind(m("/sys/block"), m("/sys/block"), bits.BindOptional). - Bind(m("/sys/bus"), m("/sys/bus"), bits.BindOptional). - Bind(m("/sys/class"), m("/sys/class"), bits.BindOptional). - Bind(m("/sys/dev"), m("/sys/dev"), bits.BindOptional). - Bind(m("/sys/devices"), m("/sys/devices"), bits.BindOptional). + Bind(m("/sys/block"), m("/sys/block"), comp.BindOptional). + Bind(m("/sys/bus"), m("/sys/bus"), comp.BindOptional). + Bind(m("/sys/class"), m("/sys/class"), comp.BindOptional). + Bind(m("/sys/dev"), m("/sys/dev"), comp.BindOptional). + Bind(m("/sys/devices"), m("/sys/devices"), comp.BindOptional). Bind(m("/run/opengl-driver"), m("/run/opengl-driver"), 0). - Bind(m("/dev/dri"), m("/dev/dri"), bits.BindDevice|bits.BindWritable|bits.BindOptional). + Bind(m("/dev/dri"), m("/dev/dri"), comp.BindDevice|comp.BindWritable|comp.BindOptional). Etc(m("/etc/"), "8e2c76b066dabe574cf073bdb46eb5c1"). - Bind(m("/var/lib/persist/module/hakurei/0/1"), m("/var/lib/persist/module/hakurei/0/1"), bits.BindWritable|bits.BindEnsure). + Bind(m("/var/lib/persist/module/hakurei/0/1"), m("/var/lib/persist/module/hakurei/0/1"), comp.BindWritable|comp.BindEnsure). Remount(m("/dev/"), syscall.MS_RDONLY). Remount(m("/"), syscall.MS_RDONLY), - SeccompPresets: bits.PresetExt | bits.PresetDenyTTY | bits.PresetDenyDevel, + SeccompPresets: comp.PresetExt | comp.PresetDenyTTY | comp.PresetDenyDevel, HostNet: true, ForwardCancel: true, }, |
