(t *testing.T)
| 58 | } |
| 59 | |
| 60 | func TestRoLoop(t *testing.T) { |
| 61 | testutil.RequiresRoot(t) |
| 62 | |
| 63 | backingFile := createTempFile(t) |
| 64 | |
| 65 | file, err := SetupLoop(backingFile, LoopParams{Readonly: true, Autoclear: true}) |
| 66 | require.NoError(t, err) |
| 67 | t.Cleanup(func() { |
| 68 | file.Close() |
| 69 | }) |
| 70 | |
| 71 | if _, err := file.Write(randomData); err == nil { |
| 72 | t.Fatalf("writing to readonly loop device should fail") |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | func TestRwLoop(t *testing.T) { |
| 77 | testutil.RequiresRoot(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…