Commit c3978cc
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.
Additionally, don't rely on the runtime to create the directories to be
mounted. runc mounts them in the easy cases but it does not work with
user namespaces.
The tests about uid/gid mappings now pass with runc:
```
$ sudo validation/linux_uid_mappings.t
TAP version 13
not ok 1 - root filesystem
---
{
"error": "rootfs must not be readonly\nRefer to: https://github.com/opencontainers/runtime-spec/blob/v1.0.0/config.md#root"
}
...
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 <alban@kinvolk.io>1 parent 3f64e51 commit c3978cc
2 files changed
+2
-16
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
0 commit comments