(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestGpusOptAll(t *testing.T) { |
| 12 | for _, testcase := range []string{ |
| 13 | "all", |
| 14 | "-1", |
| 15 | "count=all", |
| 16 | "count=-1", |
| 17 | } { |
| 18 | var gpus GpuOpts |
| 19 | assert.Check(t, gpus.Set(testcase)) |
| 20 | gpuReqs := gpus.Value() |
| 21 | assert.Assert(t, is.Len(gpuReqs, 1)) |
| 22 | assert.Check(t, is.DeepEqual(gpuReqs[0], container.DeviceRequest{ |
| 23 | Count: -1, |
| 24 | Capabilities: [][]string{{"gpu"}}, |
| 25 | Options: map[string]string{}, |
| 26 | })) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func TestGpusOptInvalidCount(t *testing.T) { |
| 31 | var gpus GpuOpts |