Skip to content

Commit 0f3cf9d

Browse files
committed
validation: LinuxUIDMapping: fix tests
Don't validate uid mappings and gid mappings separately: containers with only user mappings or with only group mappings are not usable. The tests about uid/gid mappings now pass with runc: ``` $ sudo validation/linux_uid_mappings.t TAP version 13 ok 1 - root filesystem ok 2 - hostname ok 3 - process ok 4 - mounts ok 5 - user ok 6 - rlimits ok 7 - capabilities ok 8 - default symlinks ok 9 - default file system ok 10 - default devices ok 11 - linux devices ok 12 - linux process ok 13 - masked paths ok 14 - oom score adj ok 1 # SKIP syscall action SCMP_ACT_ALLOW ok 2 # SKIP syscall action SCMP_ACT_ALLOW ok 3 # SKIP syscall action SCMP_ACT_ALLOW ok 4 # SKIP syscall action SCMP_ACT_ALLOW ok 5 # SKIP syscall action SCMP_ACT_ALLOW ok 6 # SKIP syscall action SCMP_ACT_ALLOW ok 15 - seccomp ok 16 - read only paths ok 17 - rootfs propagation ok 18 - sysctls ok 19 - uid mappings ok 20 - gid mappings 1..20 ``` Signed-off-by: Alban Crequy <[email protected]>
1 parent 3f64e51 commit 0f3cf9d

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

validation/linux_gid_mappings.go

Lines changed: 0 additions & 15 deletions
This file was deleted.

validation/linux_uid_mappings.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import (
77
func main() {
88
g := util.GetDefaultGenerator()
99
g.AddOrReplaceLinuxNamespace("user", "")
10-
g.AddLinuxUIDMapping(uint32(1000), uint32(0), uint32(3200))
10+
g.AddLinuxUIDMapping(uint32(1000), uint32(0), uint32(2000))
11+
g.AddLinuxGIDMapping(uint32(1000), uint32(0), uint32(3000))
1112
err := util.RuntimeInsideValidate(g, nil)
1213
if err != nil {
1314
util.Fatal(err)

0 commit comments

Comments
 (0)