You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Capture stdout and stderr from create invocations, because we don't
want to pollute the TAP output with things like runc's:
Incorrect Usage.
...
(which is for some reason printed to stdout) or:
runc: "create" requires exactly 1 argument(s)
which is printed to stderr. Instead, show the captured stderr as a
diagnostic, and hide the stdout completely. Unless stderr is empty,
in which case show stdout in case it contains something useful.
Most of these tests are broken because we aren't collecting the
container exit code or post-start stdout. But the tests haven't been
doing that since the create/start split in 15577bd (add runtime
struct; add create test, 2017-08-24, #447) anyway [1]. This commit
just makes that more obvious.
The patsubst and wildcard Makefile syntax is documented in [2]. The
$(VALIDATION_TESTS) rule uses the static pattern rule syntax [3].
And use 'console' instead of 'sh' in the README, because these are
shell sessions, not scripts. See [4,5]. I don't have a working runc
locally, so the mock results based on a dummy runtime script.
[1]: #447 (comment)
[2]: https://www.gnu.org/software/make/manual/html_node/Wildcard-Function.html
[3]: https://www.gnu.org/software/make/manual/html_node/Static-Usage.html#Static-Usage
[4]: https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
[5]: https://github.com/github/linguist/blob/v5.3.3/lib/linguist/languages.yml#L4249-L4260
Signed-off-by: W. Trevor King <wking@tremily.us>
Copy file name to clipboardExpand all lines: README.md
+39-43Lines changed: 39 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ To build from source code, runtime-tools requires Go 1.7.x or above.
8
8
[`oci-runtime-tool generate`][generate.1] generates [configuration JSON][config.json] for an [OCI bundle][bundle].
9
9
[OCI-compatible runtimes][runtime-spec] like [runC][] expect to read the configuration from `config.json`.
10
10
11
-
```sh
11
+
```console
12
12
$ oci-runtime-tool generate --output config.json
13
13
$ cat config.json
14
14
{
@@ -22,63 +22,59 @@ $ cat config.json
22
22
[`oci-runtime-tool validate`][validate.1] validates an OCI bundle.
23
23
The error message will be printed if the OCI bundle failed the validation procedure.
24
24
25
-
```sh
25
+
```console
26
26
$ oci-runtime-tool generate
27
27
$ oci-runtime-tool validate
28
28
INFO[0000] Bundle validation succeeded.
29
29
```
30
30
31
31
## Testing OCI runtimes
32
32
33
-
```sh
33
+
The runtime validation suite uses [`prove`][prove], which is packaged for most distributions (for example, it is in [Debian's `perl` package][debian-perl] and [Gentoo's `dev-lang/perl` package][gentoo-perl]).
34
+
If you cannot install `prove`, you can probably run the test suite with another [TAP consumer][tap-consumers], although you'll have to edit the [`Makefile`](Makefile) to replace `prove`.
35
+
36
+
```console
34
37
$ sudo make RUNTIME=runc localvalidation
35
-
RUNTIME=runc go test -tags "" -v github.com/opencontainers/runtime-tools/validation
If you are confident that the `validation/*.t` are current, you can run `prove` (or your preferred TAP consumer) directly to avoid unnecessary rebuilds:
{"", false, specerror.NewError(specerror.CreateWithBundlePathAndID, fmt.Errorf("create MUST generate an error if the ID is not provided"), rspecs.Version)},
44
+
{containerID, true, specerror.NewError(specerror.CreateNewContainer, fmt.Errorf("create MUST create a new container"), rspecs.Version)},
45
+
{containerID, false, specerror.NewError(specerror.CreateWithUniqueID, fmt.Errorf("create MUST generate an error if the ID provided is not unique"), rspecs.Version)},
0 commit comments