diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-12 04:38:45 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-14 04:52:49 +0900 |
| commit | 99ac96511bed17f48d908db3d00a1f48579ba011 (patch) | |
| tree | 30d404efb7256c9f053f64192068637d6b846db4 /internal/app/app_nixos_linux_test.go | |
| parent | e99d7affb0c128fa82722f9b3d79c99b5e5918cd (diff) | |
hst/fs: interface filesystem config
This allows mount points to be represented by different underlying structs.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/app_nixos_linux_test.go')
| -rw-r--r-- | internal/app/app_nixos_linux_test.go | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/internal/app/app_nixos_linux_test.go b/internal/app/app_nixos_linux_test.go index 901e825a..ef587222 100644 --- a/internal/app/app_nixos_linux_test.go +++ b/internal/app/app_nixos_linux_test.go @@ -13,6 +13,9 @@ import ( ) func m(pathname string) *container.Absolute { return container.MustAbs(pathname) } +func f(c hst.FilesystemConfig) hst.FilesystemConfigJSON { + return hst.FilesystemConfigJSON{FilesystemConfig: c} +} var testCasesNixos = []sealTestCase{ { @@ -25,11 +28,18 @@ var testCasesNixos = []sealTestCase{ Container: &hst.ContainerConfig{ Userns: true, Net: true, MapRealUID: true, Env: nil, AutoEtc: true, - Filesystem: []hst.FilesystemConfig{ - {Src: m("/bin"), Must: true}, {Src: m("/usr/bin/"), Must: true}, - {Src: m("/nix/store"), Must: true}, {Src: m("/run/current-system"), Must: true}, - {Src: m("/sys/block")}, {Src: m("/sys/bus")}, {Src: m("/sys/class")}, {Src: m("/sys/dev")}, {Src: m("/sys/devices")}, - {Src: m("/run/opengl-driver"), Must: true}, {Src: m("/dev/dri"), Device: true}, + Filesystem: []hst.FilesystemConfigJSON{ + f(&hst.FSBind{Src: m("/bin")}), + f(&hst.FSBind{Src: m("/usr/bin/")}), + f(&hst.FSBind{Src: m("/nix/store")}), + f(&hst.FSBind{Src: m("/run/current-system")}), + f(&hst.FSBind{Src: m("/sys/block"), Optional: true}), + f(&hst.FSBind{Src: m("/sys/bus"), Optional: true}), + f(&hst.FSBind{Src: m("/sys/class"), Optional: true}), + f(&hst.FSBind{Src: m("/sys/dev"), Optional: true}), + f(&hst.FSBind{Src: m("/sys/devices"), Optional: true}), + f(&hst.FSBind{Src: m("/run/opengl-driver")}), + f(&hst.FSBind{Src: m("/dev/dri"), Device: true, Optional: true}), }, }, SystemBus: &dbus.Config{ |
