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)
| 631 | // option is true and the permissions do not match between the file on disk and |
| 632 | // in the db. |
| 633 | func 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 | |
| 655 | func TestCopyOwner(t *testing.T) { |
| 656 | // Verifies that owner and group are copied from the parent, for both |
nothing calls this directly
no test coverage detected