container/stub: export stub helpers

These are very useful in many packages containing relatively large amount of code making calls to difficult or impossible to stub functions.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-08-31 23:11:25 +09:00
parent b489a3bba1
commit 49600a6f46
23 changed files with 3808 additions and 3247 deletions

View File

@@ -4,6 +4,8 @@ import (
"os"
"syscall"
"testing"
"hakurei.app/container/stub"
)
func TestMountTmpfsOp(t *testing.T) {
@@ -25,8 +27,8 @@ func TestMountTmpfsOp(t *testing.T) {
Path: MustAbs("/run/user/1000/"),
Size: 1 << 10,
Perm: 0700,
}, nil, nil, []kexpect{
{"mountTmpfs", expectArgs{
}, nil, nil, []stub.Call{
{"mountTmpfs", stub.ExpectArgs{
"ephemeral", // fsname
"/sysroot/run/user/1000", // target
uintptr(0), // flags