Skip to content

Commit 2cbb341

Browse files
committed
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 <[email protected]>
1 parent 4882fc1 commit 2cbb341

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Diff for: validate/validate_test.go

+34
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,40 @@ func TestJSONSchema(t *testing.T) {
6161
},
6262
error: "process.args: Invalid type. Expected: array, given: null",
6363
},
64+
{
65+
config: &rspec.Spec{
66+
Version: "1.0.0",
67+
Linux: &rspec.Linux{},
68+
},
69+
error: "",
70+
},
71+
{
72+
config: &rspec.Spec{
73+
Version: "1.0.0",
74+
Linux: &rspec.Linux{
75+
RootfsPropagation: "",
76+
},
77+
},
78+
error: "",
79+
},
80+
{
81+
config: &rspec.Spec{
82+
Version: "1.0.0",
83+
Linux: &rspec.Linux{
84+
RootfsPropagation: "shared",
85+
},
86+
},
87+
error: "",
88+
},
89+
{
90+
config: &rspec.Spec{
91+
Version: "1.0.0",
92+
Linux: &rspec.Linux{
93+
RootfsPropagation: "rshared",
94+
},
95+
},
96+
error: "linux.rootfsPropagation: linux.rootfsPropagation must be one of the following: \"private\", \"shared\", \"slave\", \"unbindable\"",
97+
},
6498
{
6599
config: &rspec.Spec{
66100
Version: "1.0.0-rc5",

0 commit comments

Comments
 (0)