diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-04-07 15:03:48 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-04-07 15:03:48 +0900 |
| commit | 289fdebead872b1b011b8fe892d43a2f234703d1 (patch) | |
| tree | 91052c9feeac3cc6e18a425409e6a3f6bef9a33d /container | |
| parent | 9c9e190db942c2314a32497118523dc2a296f571 (diff) | |
container: transparently degrade landlock in tests
Explicitly requiring landlock in tests will be supported in a future change.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container')
| -rw-r--r-- | container/container_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/container/container_test.go b/container/container_test.go index bcbcdded..693021bf 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -453,6 +453,15 @@ func TestContainer(t *testing.T) { c.SeccompDisable = !tc.filter c.RetainSession = tc.session c.HostNet = tc.net + if !c.HostNet { + if _, err := container.LandlockGetABI(); err != nil { + if !errors.Is(err, syscall.ENOSYS) { + t.Fatalf("LandlockGetABI: error = %v", err) + } + c.HostAbstract = true + t.Log("Landlock LSM is unavailable, enabling HostAbstract") + } + } c. Readonly(check.MustAbs(pathReadonly), 0755). |
