(t *testing.T, scratchFile string, opts []string)
| 76 | } |
| 77 | |
| 78 | func testMount(t *testing.T, scratchFile string, opts []string) error { |
| 79 | root := t.TempDir() |
| 80 | |
| 81 | m := []mount.Mount{ |
| 82 | { |
| 83 | Type: "ext4", |
| 84 | Source: scratchFile, |
| 85 | Options: opts, |
| 86 | }, |
| 87 | } |
| 88 | |
| 89 | if err := mount.All(m, root); err != nil { |
| 90 | return fmt.Errorf("failed to mount device %s: %w", scratchFile, err) |
| 91 | } |
| 92 | |
| 93 | if err := os.Remove(filepath.Join(root, "lost+found")); err != nil { |
| 94 | return err |
| 95 | } |
| 96 | return mount.UnmountAll(root, 0) |
| 97 | } |
| 98 | |
| 99 | func testViewHook(backingFile string, fsType string, defaultOpts []string) error { |
| 100 | root, err := os.MkdirTemp("", "blockfile-testViewHook-XXXX") |
no test coverage detected
searching dependent graphs…