(t testing.TB, devices []specs.LinuxDeviceCgroup, expectedStr string)
| 37 | } |
| 38 | |
| 39 | func testDeviceFilter(t testing.TB, devices []specs.LinuxDeviceCgroup, expectedStr string) { |
| 40 | insts, _, err := DeviceFilter(devices) |
| 41 | require.NoErrorf(t, err, "%s: (devices: %+v)", t.Name(), devices) |
| 42 | |
| 43 | s := insts.String() |
| 44 | t.Logf("%s: devices: %+v\n%s", t.Name(), devices, s) |
| 45 | if expectedStr != "" { |
| 46 | hashed := hash(s, "//") |
| 47 | expectedHashed := hash(expectedStr, "//") |
| 48 | require.Equal(t, expectedHashed, hashed) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | func TestDeviceFilter_Nil(t *testing.T) { |
| 53 | expected := ` |
no test coverage detected
searching dependent graphs…