(t *testing.T)
| 1722 | } |
| 1723 | |
| 1724 | func TestRWScanRecovery(t *testing.T) { |
| 1725 | fcfg := config.FolderConfiguration{ |
| 1726 | FilesystemType: config.FilesystemTypeFake, |
| 1727 | ID: "default", |
| 1728 | Path: srand.String(32), |
| 1729 | Type: config.FolderTypeSendReceive, |
| 1730 | RescanIntervalS: 1, |
| 1731 | MarkerName: config.DefaultMarkerName, |
| 1732 | } |
| 1733 | cfg, cancel := newConfigWrapper(config.Configuration{ |
| 1734 | Version: config.CurrentVersion, |
| 1735 | Folders: []config.FolderConfiguration{fcfg}, |
| 1736 | Devices: []config.DeviceConfiguration{ |
| 1737 | { |
| 1738 | DeviceID: device1, |
| 1739 | }, |
| 1740 | }, |
| 1741 | }) |
| 1742 | defer cancel() |
| 1743 | m := newModel(t, cfg, myID, nil) |
| 1744 | |
| 1745 | m.sdb.Update("default", protocol.LocalDeviceID, []protocol.FileInfo{ |
| 1746 | {Name: "dummyfile", Version: protocol.Vector{Counters: []protocol.Counter{{ID: 42, Value: 1}}}}, |
| 1747 | }) |
| 1748 | |
| 1749 | ffs := fcfg.Filesystem() |
| 1750 | |
| 1751 | // Generate error |
| 1752 | if err := ffs.Remove(config.DefaultMarkerName); err != nil { |
| 1753 | t.Fatal(err) |
| 1754 | } |
| 1755 | |
| 1756 | sub := m.evLogger.Subscribe(events.StateChanged) |
| 1757 | defer sub.Unsubscribe() |
| 1758 | m.ServeBackground() |
| 1759 | defer cleanupModel(m) |
| 1760 | |
| 1761 | waitForState(t, sub, "default", config.ErrMarkerMissing.Error()) |
| 1762 | |
| 1763 | fd, err := ffs.Create(config.DefaultMarkerName) |
| 1764 | if err != nil { |
| 1765 | t.Error(err) |
| 1766 | } |
| 1767 | fd.Close() |
| 1768 | |
| 1769 | waitForState(t, sub, "default", "") |
| 1770 | } |
| 1771 | |
| 1772 | func TestGlobalDirectoryTree(t *testing.T) { |
| 1773 | m, conn, fcfg := setupModelWithConnection(t) |
nothing calls this directly
no test coverage detected