Skip to content

Commit 0e66689

Browse files
committed
squash! Add support for tap output from runtime test
Granular TAP output makes it easier to see what's being tested (and what's going wrong). You could feed this into any TAP harness you like, but I've chosen prove (it seems popular). You need a TAP harness looking for test failures, because runtimetest now returns zero when it successfully runs the tests (regardless of whether the tests all pass). The OPTIND shift is out of getopts(1p). I've dropped the "VALIDATING RUNTIME" header since prove displays the command it's running in its usual output (e.g. "/usr/bin/runc .. ok").
1 parent b1c32c3 commit 0e66689

File tree

3 files changed

+221
-246
lines changed

3 files changed

+221
-246
lines changed

README.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,38 @@ INFO[0000] Bundle validation succeeded.
2929

3030
## Testing OCI runtimes
3131

32-
```sh
32+
With [prove][] installed:
33+
34+
```
3335
$ make
3436
$ sudo make install
35-
$ sudo ./test_runtime.sh -r runc
36-
-----------------------------------------------------------------------------------
37-
VALIDATING RUNTIME: runc
38-
-----------------------------------------------------------------------------------
39-
validating container process
40-
validating capabilities
41-
validating hostname
42-
validating rlimits
43-
validating sysctls
44-
Runtime runc passed validation
37+
$ sudo ./test_runtime.sh -r /usr/bin/runc
38+
/usr/bin/runc .. ok
39+
All tests successful.
40+
Files=1, Tests=90, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.02 cusr 0.01 csys = 0.06 CPU)
41+
Result: PASS
42+
```
43+
44+
You can also use the usual prove options (separated by `--`):
45+
46+
```
47+
$ sudo ./test_runtime.sh -r /usr/bin/runc -- -v
48+
/home/wking/bin/runc ..
49+
TAP version 13
50+
ok 1 - # SKIP root.readonly falsy
51+
ok 2 - hostname matches expected value
52+
53+
ok 90 - # SKIP linux.gidMappings checks (no mappings specified)
54+
1..90
55+
ok
56+
All tests successful.
57+
Files=1, Tests=90, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.02 cusr 0.01 csys = 0.05 CPU)
58+
Result: PASS
4559
```
4660

4761
[bundle]: https://github.com/opencontainers/runtime-spec/blob/master/bundle.md
4862
[config.json]: https://github.com/opencontainers/runtime-spec/blob/master/config.md
63+
[prove]: http://perldoc.perl.org/prove.html
4964
[runC]: https://github.com/opencontainers/runc
5065
[runtime-spec]: https://github.com/opencontainers/runtime-spec
5166

0 commit comments

Comments
 (0)