(t *testing.T)
| 60 | } |
| 61 | |
| 62 | func 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 | |
| 87 | func TestValidateDockerVersion(t *testing.T) { |
| 88 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…