From 2cbb3413ff9d9db59ec7febac2febc1b9a812a3a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 14 Sep 2017 09:57:52 -0700 Subject: [PATCH] validate/validate_test: Add linux.rootfsPropagation checks To demonstrate that this is covered by the 1.0.0 JSON Schema checks, and show that the omitempty protects us from errors for empty-string values despite there being no empty-string entry in [1]. [1]: https://github.com/opencontainers/runtime-spec/blob/v1.0.0/schema/defs-linux.json#L4-L11 Signed-off-by: W. Trevor King --- validate/validate_test.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/validate/validate_test.go b/validate/validate_test.go index 9c3e3ea29..4de21622b 100644 --- a/validate/validate_test.go +++ b/validate/validate_test.go @@ -61,6 +61,40 @@ func TestJSONSchema(t *testing.T) { }, error: "process.args: Invalid type. Expected: array, given: null", }, + { + config: &rspec.Spec{ + Version: "1.0.0", + Linux: &rspec.Linux{}, + }, + error: "", + }, + { + config: &rspec.Spec{ + Version: "1.0.0", + Linux: &rspec.Linux{ + RootfsPropagation: "", + }, + }, + error: "", + }, + { + config: &rspec.Spec{ + Version: "1.0.0", + Linux: &rspec.Linux{ + RootfsPropagation: "shared", + }, + }, + error: "", + }, + { + config: &rspec.Spec{ + Version: "1.0.0", + Linux: &rspec.Linux{ + RootfsPropagation: "rshared", + }, + }, + error: "linux.rootfsPropagation: linux.rootfsPropagation must be one of the following: \"private\", \"shared\", \"slave\", \"unbindable\"", + }, { config: &rspec.Spec{ Version: "1.0.0-rc5",