aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/spfinal_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-19 02:58:46 +0900
committerOphestra <cat@gensokyo.uk>2025-10-19 02:58:46 +0900
commitc0e860000a53f0fd44f4fa233cafa8a317623aa0 (patch)
tree40f523a33f55c4181190eaad47f79e88f8df5159 /internal/app/spfinal_test.go
parentd87020f0ca6897fbc1ba815fc1d9d048795e8749 (diff)
internal/app: remove spfinal
This no longer needs to be an independent outcomeOp since spFilesystemOp is moved late. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/spfinal_test.go')
-rw-r--r--internal/app/spfinal_test.go65
1 files changed, 0 insertions, 65 deletions
diff --git a/internal/app/spfinal_test.go b/internal/app/spfinal_test.go
deleted file mode 100644
index 1683d92a..00000000
--- a/internal/app/spfinal_test.go
+++ /dev/null
@@ -1,65 +0,0 @@
-package app
-
-import (
- "syscall"
- "testing"
-
- "hakurei.app/container"
- "hakurei.app/container/fhs"
- "hakurei.app/container/stub"
- "hakurei.app/hst"
- "hakurei.app/system"
- "hakurei.app/system/acl"
-)
-
-func TestSpFinalOp(t *testing.T) {
- checkOpBehaviour(t, []opBehaviourTestCase{
- {"nil extra invalid env", func(bool, bool) outcomeOp {
- return spFinalOp{}
- }, func() *hst.Config {
- c := hst.Template()
- // verify nil check behaviour
- c.ExtraPerms = append(c.ExtraPerms, hst.ExtraPermConfig{})
- // verify toContainer behaviour
- c.Container.Env["="] = "\x00"
- return c
- }, nil, []stub.Call{
- // this op configures the system state and does not make calls during toSystem
- }, newI().
- Ensure(m("/var/lib/hakurei/u0"), 0700).
- UpdatePermType(system.User, m("/var/lib/hakurei/u0"),
- acl.Execute).
- UpdatePermType(system.User, m("/var/lib/hakurei/u0/org.chromium.Chromium"),
- acl.Read, acl.Write, acl.Execute), nil, nil, func(state *outcomeStateParams) {
- state.params.Ops = new(container.Ops)
- }, []stub.Call{
- // this op configures the container state and does not make calls during toContainer
- }, nil, nil, &hst.AppError{
- Step: "flatten environment",
- Err: syscall.EINVAL,
- Msg: "invalid environment variable =",
- }},
-
- {"success", func(bool, bool) outcomeOp {
- return spFinalOp{}
- }, hst.Template, nil, []stub.Call{
- // this op configures the system state and does not make calls during toSystem
- }, newI().
- Ensure(m("/var/lib/hakurei/u0"), 0700).
- UpdatePermType(system.User, m("/var/lib/hakurei/u0"),
- acl.Execute).
- UpdatePermType(system.User, m("/var/lib/hakurei/u0/org.chromium.Chromium"),
- acl.Read, acl.Write, acl.Execute), nil, nil, func(state *outcomeStateParams) {
- state.params.Ops = new(container.Ops)
- }, []stub.Call{
- // this op configures the container state and does not make calls during toContainer
- }, &container.Params{
- Env: []string{
- "GOOGLE_API_KEY=AIzaSyBHDrl33hwRp4rMQY0ziRbj8K9LPA6vUCY",
- "GOOGLE_DEFAULT_CLIENT_ID=77185425430.apps.googleusercontent.com",
- "GOOGLE_DEFAULT_CLIENT_SECRET=OTJgUOQcT7lO7GsGZq2G4IlT",
- },
- Ops: new(container.Ops).Remount(fhs.AbsRoot, syscall.MS_RDONLY),
- }, nil, nil},
- })
-}