MCPcopy
hub / github.com/syncthing/syncthing / TestDeleteIgnorePerms

Function TestDeleteIgnorePerms

lib/model/folder_sendrecv_test.go:633–653  ·  view source on GitHub ↗

TestDeleteIgnorePerms checks, that a file gets deleted when the IgnorePerms option is true and the permissions do not match between the file on disk and in the db.

(t *testing.T)

Source from the content-addressed store, hash-verified

631// option is true and the permissions do not match between the file on disk and
632// in the db.
633func TestDeleteIgnorePerms(t *testing.T) {
634 _, f := setupSendReceiveFolder(t)
635 ffs := f.Filesystem()
636 f.IgnorePerms = true
637
638 name := "deleteIgnorePerms"
639 file, err := ffs.Create(name)
640 if err != nil {
641 t.Error(err)
642 }
643 defer file.Close()
644
645 stat, err := file.Stat()
646 must(t, err)
647 fi, err := scanner.CreateFileInfo(stat, name, ffs, false, false, config.XattrFilter{})
648 must(t, err)
649 ffs.Chmod(name, 0o600)
650 scanChan := make(chan string, 1)
651 err = f.checkToBeDeleted(fi, fi, true, scanChan)
652 must(t, err)
653}
654
655func TestCopyOwner(t *testing.T) {
656 // Verifies that owner and group are copied from the parent, for both

Callers

nothing calls this directly

Calls 10

CreateFileInfoFunction · 0.92
setupSendReceiveFolderFunction · 0.85
mustFunction · 0.85
FilesystemMethod · 0.80
checkToBeDeletedMethod · 0.80
CreateMethod · 0.65
ErrorMethod · 0.65
CloseMethod · 0.65
StatMethod · 0.65
ChmodMethod · 0.65

Tested by

no test coverage detected