mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
@@ -50,9 +50,10 @@ func TestParseInitVersion(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseRuncVersion(t *testing.T) {
|
||||
func parseRuncVersion(t *testing.T) {
|
||||
tests := []struct {
|
||||
output string
|
||||
runtime string
|
||||
version string
|
||||
commit string
|
||||
invalid bool
|
||||
@@ -63,6 +64,7 @@ runc version 1.0.0-rc5+dev
|
||||
commit: 69663f0bd4b60df09991c08812a60108003fa340
|
||||
spec: 1.0.0
|
||||
`,
|
||||
runtime: "runc",
|
||||
version: "1.0.0-rc5+dev",
|
||||
commit: "69663f0bd4b60df09991c08812a60108003fa340",
|
||||
},
|
||||
@@ -71,6 +73,7 @@ spec: 1.0.0
|
||||
runc version 1.0.0-rc5+dev
|
||||
spec: 1.0.0
|
||||
`,
|
||||
runtime: "runc",
|
||||
version: "1.0.0-rc5+dev",
|
||||
},
|
||||
{
|
||||
@@ -86,6 +89,7 @@ crun version 0.7
|
||||
spec: 1.0.0
|
||||
+SYSTEMD +SELINUX +CAP +SECCOMP +EBPF +YAJL
|
||||
`,
|
||||
runtime: "crun",
|
||||
version: "0.7",
|
||||
},
|
||||
{
|
||||
@@ -99,12 +103,13 @@ spec: 1.0.0
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
version, commit, err := parseRuncVersion(string(test.output))
|
||||
runtime, version, commit, err := parseRuntimeVersion(string(test.output))
|
||||
if test.invalid {
|
||||
assert.Check(t, is.ErrorContains(err, ""))
|
||||
} else {
|
||||
assert.Check(t, err)
|
||||
}
|
||||
assert.Equal(t, test.runtime, runtime)
|
||||
assert.Equal(t, test.version, version)
|
||||
assert.Equal(t, test.commit, commit)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user