MCPcopy Index your code
hub / github.com/google/cadvisor / TestValidateDockerVersion

Function TestValidateDockerVersion

validate/validate_test.go:87–110  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func TestValidateDockerVersion(t *testing.T) {
88 cases := []struct {
89 version string
90 result string
91 desc string
92 }{
93 {"1.1.3", Supported, dockerStandardDesc},
94 {"1.6.3", Recommended, dockerStandardDesc},
95 {"1.0beta", Supported, dockerStandardDesc},
96 {"0.1beta", Unsupported, dockerStandardDesc},
97 {"0.1", Unknown, dockerErrorDesc},
98 {"1.6", Unknown, dockerErrorDesc},
99 }
100
101 for i, c := range cases {
102 res, desc := validateDockerVersion(c.version)
103 if res != c.result {
104 t.Errorf("[%d] Unexpected result, should %v, but got %v", i, c.result, res)
105 }
106 if !strings.Contains(desc, c.desc) {
107 t.Errorf("[%d] Unexpected description, should %v, but got %v", i, c.desc, desc)
108 }
109 }
110}
111
112func TestAreCgroupsPresent(t *testing.T) {
113 cases := []struct {

Callers

nothing calls this directly

Calls 2

validateDockerVersionFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…