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

	var testfs pathfs.FileSystem

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

	_, code := testfs.Create("passwords.txt", uint32(os.O_CREATE)|uint32(os.O_WRONLY), 0777, nil)
	assert.Equal(s.T(), fuse.OK, code)
	code = testfs.Chmod("passwords.txt", 0444, nil)
	assert.Equal(s.T(), fuse.OK, code)
	assertAttr(s, testfs, "passwords.txt", 0444|fuse.S_IFREG, 0)
}