Example #1
0
func (s *fuseTestSuite) TestUnlink() {
	datasetName := "TestUnlink"
	str := spec.CreateValueSpecString("ldb", s.LdbDir, datasetName)

	var testfs pathfs.FileSystem

	start(str, func(fs pathfs.FileSystem) { testfs = fs })

	_, code := testfs.Create("dilma", uint32(os.O_CREATE)|uint32(os.O_WRONLY), 0755, nil)
	assert.Equal(s.T(), fuse.OK, code)
	assertAttr(s, testfs, "", 0777|fuse.S_IFDIR, 1) // 1 means it's there
	code = testfs.Unlink("dilma", nil)
	assert.Equal(s.T(), fuse.OK, code)
	assertAttr(s, testfs, "", 0777|fuse.S_IFDIR, 0) // 0 means no entries
}