Skip to content
Browse files

Make sure bogus files/directories in the file store don't cause probl…

…ems during migration.

git-svn-id: e27351fd-9f3e-4f54-a53b-843176b1656c
  • Loading branch information...
cyrusdaboo committed Jul 2, 2015
1 parent f2d5142 commit 931fc8d4b7845e7685b7d775d4689d2b845037bc
Showing with 11 additions and 1 deletion.
  1. +2 −1 txdav/common/datastore/
  2. +9 −0 txdav/common/datastore/upgrade/test/
@@ -276,7 +276,8 @@ def _homesOfType(self, storeType):
txn = self.newTransaction("enumerate home %r" % (uid,))
home = txn.homeWithUID(storeType, uid, False)
yield (txn, home)
if home is not None:
yield (txn, home)

def _eachCalendarHome(self):
@@ -295,6 +295,15 @@ def test_upgradeCalendarHomes(self):
L{UpgradeToDatabaseService.startService} will do the upgrade, then
start its dependent service by adding it to its service hierarchy.

# Create a fake directory in the same place as a home, but with a non-existent uid
fake_dir = self.filesPath.child("calendars").child("__uids__").child("ho").child("me").child("foobar")

# Create a fake file in the same place as a home,with a name that matches the hash uid prefix
fake_file = self.filesPath.child("calendars").child("__uids__").child("ho").child("me").child("home_file")

yield self.upgrader.stepWithResult(None)
txn = self.sqlStore.newTransaction()

0 comments on commit 931fc8d

Please sign in to comment.
You can’t perform that action at this time.