[CalendarServer-changes] [8572] CalendarServer/branches/users/glyph/parallel-upgrade_to_1/ twistedcaldav/test/test_upgrade.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Jan 24 00:54:26 PST 2012
Revision: 8572
http://trac.macosforge.org/projects/calendarserver/changeset/8572
Author: glyph at apple.com
Date: 2012-01-24 00:54:25 -0800 (Tue, 24 Jan 2012)
Log Message:
-----------
Add a hook for testing parallel upgrade.
Modified Paths:
--------------
CalendarServer/branches/users/glyph/parallel-upgrade_to_1/twistedcaldav/test/test_upgrade.py
Modified: CalendarServer/branches/users/glyph/parallel-upgrade_to_1/twistedcaldav/test/test_upgrade.py
===================================================================
--- CalendarServer/branches/users/glyph/parallel-upgrade_to_1/twistedcaldav/test/test_upgrade.py 2012-01-24 08:52:59 UTC (rev 8571)
+++ CalendarServer/branches/users/glyph/parallel-upgrade_to_1/twistedcaldav/test/test_upgrade.py 2012-01-24 08:54:25 UTC (rev 8572)
@@ -66,7 +66,13 @@
config.ResourceService.params.xmlFile = resourceFile
+ def doUpgrade(self, config):
+ """
+ Perform the actual upgrade. (Hook for parallel tests.)
+ """
+ return upgradeData(config)
+
def setUpInitialStates(self):
self.setUpXMLDirectory()
@@ -77,6 +83,7 @@
self.setUpNewDataRoot()
self.setUpDataRootWithProxyDB()
+
def setUpOldDocRoot(self):
# Set up doc root
@@ -155,7 +162,7 @@
self.assertTrue(os.path.exists(os.path.join(config.DocumentRoot, "principals", OLDPROXYFILE)))
self.assertFalse(os.path.exists(os.path.join(config.DataRoot, NEWPROXYFILE)))
- (yield upgradeData(config))
+ (yield self.doUpgrade(config))
# Check post-conditions
self.assertFalse(os.path.exists(os.path.join(config.DocumentRoot, "principals",)))
@@ -177,7 +184,7 @@
self.assertFalse(os.path.exists(os.path.join(config.DocumentRoot, "principals")))
self.assertTrue(os.path.exists(os.path.join(config.DataRoot, NEWPROXYFILE)))
- (yield upgradeData(config))
+ (yield self.doUpgrade(config))
# Check post-conditions
self.assertFalse(os.path.exists(os.path.join(config.DocumentRoot, "principals",)))
@@ -273,12 +280,12 @@
config.DocumentRoot = root
config.DataRoot = root
- (yield upgradeData(config))
+ (yield self.doUpgrade(config))
self.assertTrue(self.verifyHierarchy(root, after))
if reverify:
# Ensure that repeating the process doesn't change anything
- (yield upgradeData(config))
+ (yield self.doUpgrade(config))
self.assertTrue(self.verifyHierarchy(root, after))
@@ -1316,7 +1323,7 @@
config.DataRoot = root
try:
- (yield upgradeData(config))
+ (yield self.doUpgrade(config))
except UpgradeError:
pass
else:
@@ -1379,7 +1386,7 @@
config.DocumentRoot = root
config.DataRoot = root
- (yield upgradeData(config))
+ (yield self.doUpgrade(config))
self.assertTrue(self.verifyHierarchy(root, after))
proxydbClass = namedClass(config.ProxyDBService.type)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120124/ad27da65/attachment.html>
More information about the calendarserver-changes
mailing list