func TestMountOptionSubtype(t *testing.T) { if runtime.GOOS == "darwin" { t.Skip("OS X does not support Subtype") } if runtime.GOOS == "freebsd" { t.Skip("FreeBSD does not support Subtype") } t.Parallel() const name = "FuseTestMarker" mnt, err := fstestutil.MountedT(t, fstestutil.SimpleFS{fstestutil.Dir{}}, nil, fuse.Subtype(name), ) if err != nil { t.Fatal(err) } defer mnt.Close() info, err := fstestutil.GetMountInfo(mnt.Dir) if err != nil { t.Fatal(err) } if g, e := info.Type, "fuse."+name; g != e { t.Errorf("wrong Subtype: %q != %q", g, e) } }
func testMountOptionFSNameEvil(t *testing.T, evil string) { if runtime.GOOS == "freebsd" { t.Skip("FreeBSD does not support FSName") } t.Parallel() var name = "FuseTest" + evil + "Marker" mnt, err := fstestutil.MountedT(t, fstestutil.SimpleFS{fstestutil.Dir{}}, nil, fuse.FSName(name), ) if err != nil { t.Fatal(err) } defer mnt.Close() info, err := fstestutil.GetMountInfo(mnt.Dir) if err != nil { t.Fatal(err) } if g, e := info.FSName, name; g != e { t.Errorf("wrong FSName: %q != %q", g, e) } }