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

Function TestValidateKernelVersion

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

Source from the content-addressed store, hash-verified

60}
61
62func TestValidateKernelVersion(t *testing.T) {
63 cases := []struct {
64 version string
65 result string
66 desc string
67 }{
68 {"2.6.3", Supported, kernelStandardDesc},
69 {"3.6.3", Recommended, kernelStandardDesc},
70 {"1.0beta", Unsupported, kernelStandardDesc},
71 {"0.1beta", Unsupported, kernelStandardDesc},
72 {"0.1", Unknown, kernelErrorDesc},
73 {"3.1", Unknown, kernelErrorDesc},
74 }
75
76 for i, c := range cases {
77 res, desc := validateKernelVersion(c.version)
78 if res != c.result {
79 t.Errorf("[%d] Unexpected result, should %v, but got %v", i, c.result, res)
80 }
81 if !strings.Contains(desc, c.desc) {
82 t.Errorf("[%d] Unexpected description, should %v, but got %v", i, c.desc, desc)
83 }
84 }
85}
86
87func TestValidateDockerVersion(t *testing.T) {
88 cases := []struct {

Callers

nothing calls this directly

Calls 2

validateKernelVersionFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…