(t *testing.T)
| 112 | } |
| 113 | |
| 114 | func TestFUSEHelper(t *testing.T) { |
| 115 | testutil.RequiresRoot(t) |
| 116 | const fuseoverlayfsBinary = "fuse-overlayfs" |
| 117 | _, err := exec.LookPath(fuseoverlayfsBinary) |
| 118 | if err != nil { |
| 119 | t.Skip("fuse-overlayfs not installed") |
| 120 | } |
| 121 | td := t.TempDir() |
| 122 | |
| 123 | for _, dir := range []string{"lower1", "lower2", "upper", "work", "merged"} { |
| 124 | if err := os.Mkdir(filepath.Join(td, dir), 0755); err != nil { |
| 125 | t.Fatal(err) |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | opts := fmt.Sprintf("lowerdir=%s:%s,upperdir=%s,workdir=%s", filepath.Join(td, "lower2"), filepath.Join(td, "lower1"), filepath.Join(td, "upper"), filepath.Join(td, "work")) |
| 130 | m := Mount{ |
| 131 | Type: "fuse3." + fuseoverlayfsBinary, |
| 132 | Source: "overlay", |
| 133 | Options: []string{opts}, |
| 134 | } |
| 135 | dest := filepath.Join(td, "merged") |
| 136 | if err := m.Mount(dest); err != nil { |
| 137 | t.Fatal(err) |
| 138 | } |
| 139 | if err := UnmountAll(dest, 0); err != nil { |
| 140 | t.Fatal(err) |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | func TestMountAt(t *testing.T) { |
| 145 | testutil.RequiresRoot(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…