(t *testing.T)
| 85 | } |
| 86 | |
| 87 | func 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 | |
| 112 | func TestAreCgroupsPresent(t *testing.T) { |
| 113 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…