Go Shell Makefile
Clone or download
liangchenye Merge pull request #652 from kinvolk/alban/mount-empty-source
mountinfo: parse empty strings in source
Latest commit d2fbafa Jul 20, 2018
Failed to load latest commit information.
Godeps vendor/github.com/mndrix/tap-go: Bump to 629fa407 Jan 10, 2018
api/socket travis: add go 1.10 Jun 27, 2018
cgroups mountinfo: parse empty strings in source Jun 21, 2018
cmd Merge pull request #652 from kinvolk/alban/mount-empty-source Jul 20, 2018
completions/bash bash: add os Apr 15, 2018
contrib contrib/rootfs-builder: Use $(cat rootfs-files) Mar 15, 2018
docs doc: add developer guidelines Apr 17, 2018
error runtimetest: Make TAP output more granular Apr 6, 2018
filepath filepath/clean: Add Windows support Dec 8, 2017
generate validation: test linux_cgroups_cpus with different values Jun 6, 2018
man fix some misspells Jun 5, 2018
schema docs/command-line-interface: Add Runtime CLI Spec (#321) Jan 10, 2018
specerror specerror: Add NewRFCError and NewRFCErrorOrPanic Apr 19, 2018
validate validate: With --host-specific, compare config platform vs. runtime Apr 11, 2018
validation Merge pull request #649 from q384566678/spell-fix Jul 20, 2018
vendor vendor/github.com/mndrix/tap-go: Bump to 629fa407 Jan 10, 2018
.gitignore Add RUNTIME_TOOLS_LINK in Makefile Oct 29, 2016
.mailmap .mailmap: Add entries for inconsistent users Jun 18, 2016
.pullapprove.yml Relax LGTM acquirement for PullApprove Jan 23, 2018
.travis.yml travis: add go 1.10 Jun 27, 2018
CHANGELOG.md release v0.6.0 May 16, 2018
CONTRIBUTING.md Update contributing guidelines and add maintainer guidelines May 3, 2016
LICENSE Update LICENSE to the same as the specs repository Jan 19, 2016
MAINTAINERS add q384566678 as a maintainer Jul 26, 2017
MAINTAINERS_GUIDE.md change two LGTMs requirement to one Feb 1, 2018
Makefile travis: add go 1.10 Jun 27, 2018
README.md fix some misspells Jun 5, 2018
VERSION release v0.6.0 May 16, 2018
rootfs-386.tar.gz rootfs-386.tar.gz: Add with BusyBox v1.28.0 Mar 9, 2018
rootfs-amd64.tar.gz rootfs-386.tar.gz: Add with BusyBox v1.28.0 Mar 9, 2018


oci-runtime-tool Build Status Go Report Card

oci-runtime-tool is a collection of tools for working with the OCI runtime specification. To build from source code, runtime-tools requires Go 1.7.x or above.

Generating an OCI runtime spec configuration files

oci-runtime-tool generate generates configuration JSON for an OCI bundle. OCI-compatible runtimes like runC expect to read the configuration from config.json.

$ oci-runtime-tool generate --output config.json
$ cat config.json
        "ociVersion": "0.5.0",


Validating an OCI bundle

oci-runtime-tool validate validates an OCI bundle. The error message will be printed if the OCI bundle failed the validation procedure.

$ oci-runtime-tool generate
$ oci-runtime-tool validate
INFO[0000] Bundle validation succeeded.

Testing OCI runtimes

The runtime validation suite uses node-tap, which is packaged for some distributions (for example, it is in Debian's node-tap package). If your distribution does not package node-tap, you can install npm (for example, from Gentoo's nodejs package) and use it:

$ npm install tap

Build the validation executables:

$ make runtimetest validation-executables

Runtime validation currently only supports the OCI Runtime Command Line Interface. If we add support for alternative APIs in the future, runtime validation will gain an option to select the desired runtime API. For the command line interface, the RUNTIME option selects the runtime command (funC in the OCI Runtime Command Line Interface).

$ sudo make RUNTIME=runc localvalidation
RUNTIME=runc tap validation/pidfile.t validation/linux_cgroups_hugetlb.t validation/linux_cgroups_memory.t validation/linux_rootfs_propagation_shared.t validation/kill.t validation/create.t validation/poststart.t validation/linux_cgroups_network.t validation/poststop_fail.t validation/linux_readonly_paths.t validation/prestart_fail.t validation/hooks_stdin.t validation/default.t validation/linux_masked_paths.t validation/poststop.t validation/misc_props.t validation/prestart.t validation/poststart_fail.t validation/mounts.t validation/linux_cgroups_relative_pids.t validation/process_user.t validation/process.t validation/hooks.t validation/process_capabilities_fail.t validation/process_rlimits_fail.t validation/linux_cgroups_relative_cpus.t validation/process_rlimits.t validation/linux_cgroups_relative_blkio.t validation/linux_sysctl.t validation/linux_seccomp.t validation/linux_devices.t validation/start.t validation/linux_cgroups_pids.t validation/process_capabilities.t validation/process_oom_score_adj.t validation/linux_cgroups_relative_hugetlb.t validation/linux_cgroups_cpus.t validation/linux_cgroups_relative_memory.t validation/state.t validation/root_readonly_true.t validation/linux_cgroups_blkio.t validation/linux_rootfs_propagation_unbindable.t validation/delete.t validation/linux_cgroups_relative_network.t validation/hostname.t validation/killsig.t validation/linux_uid_mappings.t
validation/pidfile.t .failed to create the container
container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"process_linux.go:367: setting cgroup config for procHooks process caused \\\"failed to write 56892210544640 to hugetlb.1GB.limit_in_bytes: open /sys/fs/cgroup/hugetlb/cgrouptest/hugetlb.1GB.limit_in_bytes: permission denied\\\"\""
exit status 1
validation/pidfile.t .................................. 1/1 315ms
validation/linux_cgroups_hugetlb.t .................... 0/1
  not ok validation/linux_cgroups_hugetlb.t
    timeout: 30000
    file: validation/linux_cgroups_hugetlb.t
    command: validation/linux_cgroups_hugetlb.t
    args: []
      - 0
      - pipe
      - 2
    cwd: /…/go/src/github.com/opencontainers/runtime-tools
    exitCode: 1

validation/linux_cgroups_memory.t ..................... 9/9
validation/linux_rootfs_propagation_shared.t ...... 252/282
  not ok shared root propagation exposes "/target348456609/mount892511628/example376408222"

  Skipped: 29
     /dev/null (default device) has unconfigured permissions
total ........................................... 4381/4962

  4381 passing (1m)
  567 pending
  14 failing

make: *** [Makefile:44: localvalidation] Error 1

You can also run an individual test executable directly:

$ RUNTIME=runc validation/default.t
TAP version 13
ok 1 - has expected hostname
    "actual": "mrsdalloway",
    "expected": "mrsdalloway"

ok 287 # SKIP linux.gidMappings not set

If you cannot install node-tap, you can probably run the test suite with another TAP consumer. For example, with prove:

$ sudo make TAP='prove -Q -j9' RUNTIME=runc VALIDATION_TESTS=validation/pidfile.t localvalidation
RUNTIME=runc prove -Q -j9 validation/pidfile.t
All tests successful.
Files=1, Tests=1,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.03 cusr  0.03 csys =  0.08 CPU)
Result: PASS