diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-12-08 07:34:54 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-12-08 07:38:47 +0900 |
| commit | 0c38fb7b6a17bed9392a4cf46fc752bc2de8eb18 (patch) | |
| tree | 44a762beb44193693ada3c97c368e4f12a4ec054 /hst/fs_test.go | |
| parent | 357cfcddeea14d6babacf7ae8f77e0bad7b24ee5 (diff) | |
hst: expose daemon as fs entry
This is slightly counterintuitive, but it turned out well under this framework since the daemon backs its target file.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/fs_test.go')
| -rw-r--r-- | hst/fs_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/hst/fs_test.go b/hst/fs_test.go index 4b079096..fdef9bc6 100644 --- a/hst/fs_test.go +++ b/hst/fs_test.go @@ -84,6 +84,16 @@ func TestFilesystemConfigJSON(t *testing.T) { }, nil, `{"type":"link","dst":"/run/current-system","linkname":"/run/current-system","dereference":true}`, `{"fs":{"type":"link","dst":"/run/current-system","linkname":"/run/current-system","dereference":true},"magic":3236757504}`}, + + {"daemon", hst.FilesystemConfigJSON{ + FilesystemConfig: &hst.FSDaemon{ + Target: m("/run/user/1971/pulse/native"), + Exec: m("/run/current-system/sw/bin/pipewire-pulse"), + Args: []string{"-v"}, + }, + }, nil, + `{"type":"daemon","dst":"/run/user/1971/pulse/native","path":"/run/current-system/sw/bin/pipewire-pulse","args":["-v"]}`, + `{"fs":{"type":"daemon","dst":"/run/user/1971/pulse/native","path":"/run/current-system/sw/bin/pipewire-pulse","args":["-v"]},"magic":3236757504}`}, } for _, tc := range testCases { @@ -345,6 +355,10 @@ func (p opsAdapter) Etc(host *check.Absolute, prefix string) hst.Ops { return opsAdapter{p.Ops.Etc(host, prefix)} } +func (p opsAdapter) Daemon(target, path *check.Absolute, args ...string) hst.Ops { + return opsAdapter{p.Ops.Daemon(target, path, args...)} +} + func m(pathname string) *check.Absolute { return check.MustAbs(pathname) } func ms(pathnames ...string) []*check.Absolute { as := make([]*check.Absolute, len(pathnames)) |
