diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-21 20:54:03 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-21 20:54:03 +0900 |
| commit | e94acc424c5746eb6cf903ed97b4e71223fda50f (patch) | |
| tree | c55f4b467ed11149006a799421936845bf64de99 /container/initbind_test.go | |
| parent | b1a4d801be033b41c559e9642ee05e2f0ec43d5b (diff) | |
container/comp: rename from bits
This package will also hold syscall lookup tables for seccomp.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/initbind_test.go')
| -rw-r--r-- | container/initbind_test.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/container/initbind_test.go b/container/initbind_test.go index 323a0328..86ab1f9c 100644 --- a/container/initbind_test.go +++ b/container/initbind_test.go @@ -6,8 +6,8 @@ import ( "syscall" "testing" - "hakurei.app/container/bits" "hakurei.app/container/check" + "hakurei.app/container/comp" "hakurei.app/container/stub" ) @@ -25,7 +25,7 @@ func TestBindMountOp(t *testing.T) { {"skip optional", new(Params), &BindMountOp{ Source: check.MustAbs("/bin/"), Target: check.MustAbs("/bin/"), - Flags: bits.BindOptional, + Flags: comp.BindOptional, }, []stub.Call{ call("evalSymlinks", stub.ExpectArgs{"/bin/"}, "", syscall.ENOENT), }, nil, nil, nil}, @@ -33,7 +33,7 @@ func TestBindMountOp(t *testing.T) { {"success optional", new(Params), &BindMountOp{ Source: check.MustAbs("/bin/"), Target: check.MustAbs("/bin/"), - Flags: bits.BindOptional, + Flags: comp.BindOptional, }, []stub.Call{ call("evalSymlinks", stub.ExpectArgs{"/bin/"}, "/usr/bin", nil), }, nil, []stub.Call{ @@ -46,7 +46,7 @@ func TestBindMountOp(t *testing.T) { {"ensureFile device", new(Params), &BindMountOp{ Source: check.MustAbs("/dev/null"), Target: check.MustAbs("/dev/null"), - Flags: bits.BindWritable | bits.BindDevice, + Flags: comp.BindWritable | comp.BindDevice, }, []stub.Call{ call("evalSymlinks", stub.ExpectArgs{"/dev/null"}, "/dev/null", nil), }, nil, []stub.Call{ @@ -57,7 +57,7 @@ func TestBindMountOp(t *testing.T) { {"mkdirAll ensure", new(Params), &BindMountOp{ Source: check.MustAbs("/bin/"), Target: check.MustAbs("/bin/"), - Flags: bits.BindEnsure, + Flags: comp.BindEnsure, }, []stub.Call{ call("mkdirAll", stub.ExpectArgs{"/bin/", os.FileMode(0700)}, nil, stub.UniqueError(4)), }, stub.UniqueError(4), nil, nil}, @@ -65,7 +65,7 @@ func TestBindMountOp(t *testing.T) { {"success ensure", new(Params), &BindMountOp{ Source: check.MustAbs("/bin/"), Target: check.MustAbs("/usr/bin/"), - Flags: bits.BindEnsure, + Flags: comp.BindEnsure, }, []stub.Call{ call("mkdirAll", stub.ExpectArgs{"/bin/", os.FileMode(0700)}, nil, nil), call("evalSymlinks", stub.ExpectArgs{"/bin/"}, "/usr/bin", nil), @@ -79,7 +79,7 @@ func TestBindMountOp(t *testing.T) { {"success device ro", new(Params), &BindMountOp{ Source: check.MustAbs("/dev/null"), Target: check.MustAbs("/dev/null"), - Flags: bits.BindDevice, + Flags: comp.BindDevice, }, []stub.Call{ call("evalSymlinks", stub.ExpectArgs{"/dev/null"}, "/dev/null", nil), }, nil, []stub.Call{ @@ -92,7 +92,7 @@ func TestBindMountOp(t *testing.T) { {"success device", new(Params), &BindMountOp{ Source: check.MustAbs("/dev/null"), Target: check.MustAbs("/dev/null"), - Flags: bits.BindWritable | bits.BindDevice, + Flags: comp.BindWritable | comp.BindDevice, }, []stub.Call{ call("evalSymlinks", stub.ExpectArgs{"/dev/null"}, "/dev/null", nil), }, nil, []stub.Call{ @@ -182,7 +182,7 @@ func TestBindMountOp(t *testing.T) { {"zero", new(BindMountOp), false}, {"nil source", &BindMountOp{Target: check.MustAbs("/")}, false}, {"nil target", &BindMountOp{Source: check.MustAbs("/")}, false}, - {"flag optional ensure", &BindMountOp{Source: check.MustAbs("/"), Target: check.MustAbs("/"), Flags: bits.BindOptional | bits.BindEnsure}, false}, + {"flag optional ensure", &BindMountOp{Source: check.MustAbs("/"), Target: check.MustAbs("/"), Flags: comp.BindOptional | comp.BindEnsure}, false}, {"valid", &BindMountOp{Source: check.MustAbs("/"), Target: check.MustAbs("/")}, true}, }) @@ -217,7 +217,7 @@ func TestBindMountOp(t *testing.T) { }, &BindMountOp{ Source: check.MustAbs("/etc/"), Target: check.MustAbs("/etc/.host/048090b6ed8f9ebb10e275ff5d8c0659"), - Flags: bits.BindOptional, + Flags: comp.BindOptional, }, false}, {"source differs", &BindMountOp{ @@ -256,7 +256,7 @@ func TestBindMountOp(t *testing.T) { {"hostdev", &BindMountOp{ Source: check.MustAbs("/dev/"), Target: check.MustAbs("/dev/"), - Flags: bits.BindWritable | bits.BindDevice, + Flags: comp.BindWritable | comp.BindDevice, }, "mounting", `"/dev/" flags 0x6`}, }) } |
