Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtimetest: count correctly TAP tests #594

Merged

Conversation

alban
Copy link
Contributor

@alban alban commented Mar 8, 2018

Don't create a new tap.T in the middle of a test but reuse the existing
one instead.

Symptoms:

$ sudo validation/linux_readonly_paths.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

After this patch is applied:

$ sudo validation/linux_readonly_paths.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 15 # SKIP syscall action SCMP_ACT_ALLOW
ok 16 # SKIP syscall action SCMP_ACT_ALLOW
ok 17 # SKIP syscall action SCMP_ACT_ALLOW
ok 18 # SKIP syscall action SCMP_ACT_ALLOW
ok 19 # SKIP syscall action SCMP_ACT_ALLOW
ok 20 # SKIP syscall action SCMP_ACT_ALLOW
ok 21 - seccomp
ok 22 - read only paths
ok 23 - rootfs propagation
ok 24 - sysctls
ok 25 - uid mappings
ok 26 - gid mappings
1..26

Fixes #593

Signed-off-by: Alban Crequy alban@kinvolk.io

@wking
Copy link
Contributor

wking commented Mar 8, 2018

This is moving in the direction of #308, which I haven't had time to finish rebasing. I'm fine landing it as an intermediate step, but we'll probably want to (eventually, possibly in follow-up work) follow #308 and convert all of the local validation tests into TAP-harness calls to keep the skips and non-skips in order.

Don't create a new tap.T in the middle of a test but reuse the existing
one instead.

Symptoms:
```
$ sudo validation/linux_readonly_paths.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
```

After this patch is applied:
```
$ sudo validation/linux_readonly_paths.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 15 # SKIP syscall action SCMP_ACT_ALLOW
ok 16 # SKIP syscall action SCMP_ACT_ALLOW
ok 17 # SKIP syscall action SCMP_ACT_ALLOW
ok 18 # SKIP syscall action SCMP_ACT_ALLOW
ok 19 # SKIP syscall action SCMP_ACT_ALLOW
ok 20 # SKIP syscall action SCMP_ACT_ALLOW
ok 21 - seccomp
ok 22 - read only paths
ok 23 - rootfs propagation
ok 24 - sysctls
ok 25 - uid mappings
ok 26 - gid mappings
1..26
```

Fixes opencontainers#593

Signed-off-by: Alban Crequy <alban@kinvolk.io>
@alban alban force-pushed the alban/593-tapError-count branch from 399708a to c9b4d66 Compare March 13, 2018 09:37
@alban
Copy link
Contributor Author

alban commented Mar 13, 2018

@wking I am fine with landing this as an intermediate step. I rebased the branch on the recent master.

@liangchenye
Copy link
Member

liangchenye commented Mar 15, 2018

LGTM

Approved with PullApprove

@liangchenye
Copy link
Member

It works good in my test :)

@liangchenye liangchenye merged commit 216ebc7 into opencontainers:master Mar 15, 2018
@dongsupark dongsupark deleted the alban/593-tapError-count branch May 22, 2018 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants