aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/outcome/sppipewire_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-12-08 05:03:16 +0900
committerOphestra <cat@gensokyo.uk>2025-12-08 05:03:16 +0900
commitc8eeb4a4d122189dadb093839c5b98188db9be31 (patch)
tree52ab58a1cd8faf306c3a13e3c0b54823487391f8 /internal/outcome/sppipewire_test.go
parent5785714b64149c2377cd9697c77162b3e7b37e7d (diff)
internal/outcome: integrate pipewire server
This is very simple and takes almost no inputs. This is not yet hooked up to anything to prevent breaking any existing behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/outcome/sppipewire_test.go')
-rw-r--r--internal/outcome/sppipewire_test.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/internal/outcome/sppipewire_test.go b/internal/outcome/sppipewire_test.go
new file mode 100644
index 00000000..d53f6d6d
--- /dev/null
+++ b/internal/outcome/sppipewire_test.go
@@ -0,0 +1,43 @@
+package outcome
+
+import (
+ "testing"
+
+ "hakurei.app/container"
+ "hakurei.app/container/stub"
+ "hakurei.app/hst"
+ "hakurei.app/internal/pipewire"
+ "hakurei.app/internal/system"
+)
+
+func TestSpPipeWireOp(t *testing.T) {
+ t.Parallel()
+ config := hst.Template()
+
+ checkOpBehaviour(t, []opBehaviourTestCase{
+ {"not enabled", func(bool, bool) outcomeOp {
+ return spPipeWireOp{}
+ }, func() *hst.Config {
+ c := hst.Template()
+ *c.Enablements = 0
+ return c
+ }, nil, nil, nil, nil, errNotEnabled, nil, nil, nil, nil, nil},
+
+ {"success", func(bool, bool) outcomeOp {
+ return spPipeWireOp{}
+ }, hst.Template, nil, []stub.Call{}, newI().
+ // state.instance
+ Ephemeral(system.Process, m(wantInstancePrefix), 0711).
+ // toSystem
+ PipeWire(
+ m(wantInstancePrefix + "/pipewire"),
+ ), sysUsesInstance(nil), nil, insertsOps(afterSpRuntimeOp(nil)), []stub.Call{
+ // this op configures the container state and does not make calls during toContainer
+ }, &container.Params{
+ Ops: new(container.Ops).
+ Bind(m(wantInstancePrefix+"/pipewire"), m("/run/user/1000/pipewire-0"), 0),
+ }, paramsWantEnv(config, map[string]string{
+ pipewire.Remote: "/run/user/1000/pipewire-0",
+ }, nil), nil},
+ })
+}