aboutsummaryrefslogtreecommitdiffhomepage
path: root/system
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-09-06 12:59:33 +0900
committerOphestra <cat@gensokyo.uk>2025-09-06 12:59:33 +0900
commite603b688ca6d023b783e58f3876430ea73dd21a6 (patch)
tree1bcc1b9865353163b246fe6ae0d09d31af3dfed2 /system
parenta9def085338d2ce3627850ca3b6844b32fccfdc9 (diff)
system/dispatcher: expose test reporting to builder
This is currently unused but useful for builders with errors. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system')
-rw-r--r--system/acl_test.go12
-rw-r--r--system/dispatcher_test.go4
2 files changed, 8 insertions, 8 deletions
diff --git a/system/acl_test.go b/system/acl_test.go
index 897ea33c..a92e38ba 100644
--- a/system/acl_test.go
+++ b/system/acl_test.go
@@ -57,7 +57,7 @@ func TestACLUpdateOp(t *testing.T) {
checkOpsBuilder(t, "UpdatePerm", []opsBuilderTestCase{
{"simple",
0xdeadbeef,
- func(sys *I) {
+ func(_ *testing.T, sys *I) {
sys.
UpdatePerm("/run/user/1971/hakurei", acl.Execute).
UpdatePerm("/tmp/hakurei.0/tmpdir/150", acl.Read, acl.Write, acl.Execute)
@@ -67,25 +67,25 @@ func TestACLUpdateOp(t *testing.T) {
}, stub.Expect{}},
})
checkOpsBuilder(t, "UpdatePermType", []opsBuilderTestCase{
- {"tmpdirp", 0xdeadbeef, func(sys *I) {
+ {"tmpdirp", 0xdeadbeef, func(_ *testing.T, sys *I) {
sys.UpdatePermType(User, "/tmp/hakurei.0/tmpdir", acl.Execute)
}, []Op{
&ACLUpdateOp{User, "/tmp/hakurei.0/tmpdir", []acl.Perm{acl.Execute}},
}, stub.Expect{}},
- {"tmpdir", 0xdeadbeef, func(sys *I) {
+ {"tmpdir", 0xdeadbeef, func(_ *testing.T, sys *I) {
sys.UpdatePermType(User, "/tmp/hakurei.0/tmpdir/150", acl.Read, acl.Write, acl.Execute)
}, []Op{
&ACLUpdateOp{User, "/tmp/hakurei.0/tmpdir/150", []acl.Perm{acl.Read, acl.Write, acl.Execute}},
}, stub.Expect{}},
- {"share", 0xdeadbeef, func(sys *I) {
+ {"share", 0xdeadbeef, func(_ *testing.T, sys *I) {
sys.UpdatePermType(Process, "/run/user/1971/hakurei/fcb8a12f7c482d183ade8288c3de78b5", acl.Execute)
}, []Op{
&ACLUpdateOp{Process, "/run/user/1971/hakurei/fcb8a12f7c482d183ade8288c3de78b5", []acl.Perm{acl.Execute}},
}, stub.Expect{}},
- {"passwd", 0xdeadbeef, func(sys *I) {
+ {"passwd", 0xdeadbeef, func(_ *testing.T, sys *I) {
sys.
UpdatePermType(Process, "/tmp/hakurei.0/fcb8a12f7c482d183ade8288c3de78b5/passwd", acl.Read).
UpdatePermType(Process, "/tmp/hakurei.0/fcb8a12f7c482d183ade8288c3de78b5/group", acl.Read)
@@ -94,7 +94,7 @@ func TestACLUpdateOp(t *testing.T) {
&ACLUpdateOp{Process, "/tmp/hakurei.0/fcb8a12f7c482d183ade8288c3de78b5/group", []acl.Perm{acl.Read}},
}, stub.Expect{}},
- {"wayland", 0xdeadbeef, func(sys *I) {
+ {"wayland", 0xdeadbeef, func(_ *testing.T, sys *I) {
sys.UpdatePermType(EWayland, "/run/user/1971/wayland-0", acl.Read, acl.Write, acl.Execute)
}, []Op{
&ACLUpdateOp{EWayland, "/run/user/1971/wayland-0", []acl.Perm{acl.Read, acl.Write, acl.Execute}},
diff --git a/system/dispatcher_test.go b/system/dispatcher_test.go
index 53d2b664..7c7c10c9 100644
--- a/system/dispatcher_test.go
+++ b/system/dispatcher_test.go
@@ -75,7 +75,7 @@ func checkOpBehaviour(t *testing.T, testCases []opBehaviourTestCase) {
type opsBuilderTestCase struct {
name string
uid int
- f func(sys *I)
+ f func(t *testing.T, sys *I)
want []Op
exp stub.Expect
}
@@ -92,7 +92,7 @@ func checkOpsBuilder(t *testing.T, fname string, testCases []opsBuilderTestCase)
sys, s := InternalNew(t, tc.exp, tc.uid)
defer stub.HandleExit(t)
- tc.f(sys)
+ tc.f(t, sys)
s.VisitIncomplete(func(s *stub.Stub[syscallDispatcher]) {
t.Helper()