Permalink
Browse files

Bug 775541 - support for multiple partial updates in update verify bu…

…mp script. r=bhearsum
  • Loading branch information...
1 parent 382877f commit a91ad2e26bf9ae1674a7071d1dfc3ec18d76c554 @rail rail committed Aug 21, 2012
@@ -1,4 +1,4 @@
-release="4.0" product="Firefox" platform="Linux_x86-gcc3" build_id="888" locales="af de en-US ja zh-TW" channel="betatest" patch_types="partial complete" from="/firefox/4.0rc1.tar.bz2" aus_server="https://aus2.mozilla.org" ftp_server="stage.mozilla.org/firefox" to="/firefox/4.0rc2.tar.bz2"
-release="4.0b12" product="Firefox" platform="Linux_x86-gcc3" build_id="777" locales="af en-US" channel="betatest" patch_types="complete" from="/firefox/4.0b12.tar.bz2"
-release="4.0b12" product="Firefox" platform="Linux_x86-gcc3" build_id="777" locales="de ja zh-TW" channel="betatest" patch_types="complete"
-release="3.7a1" product="Firefox" platform="Linux_x86-gcc3" build_id="666" locales="en-US" channel="betatest" patch_types="complete"
+release="4.0" product="Firefox" platform="Linux_x86-gcc3" build_id="888" locales="af de en-US ja zh-TW" channel="betatest" patch_types="partial complete" from="/firefox/4.0rc1.tar.bz2" aus_server="https://aus2.mozilla.org" ftp_server_from="stage.mozilla.org/firefox" ftp_server_to="stage.mozilla.org/firefox" to="/firefox/4.0rc2.tar.bz2"
+release="4.0b12" product="Firefox" platform="Linux_x86-gcc3" build_id="777" locales="af en-US" channel="betatest" patch_types="complete" from="/firefox/4.0b12.tar.bz2" ftp_server_from="stage.mozilla.org/firefox" ftp_server_to="stage.mozilla.org/firefox"
+release="4.0b12" product="Firefox" platform="Linux_x86-gcc3" build_id="777" locales="de ja zh-TW" channel="betatest" patch_types="complete" ftp_server_from="stage.mozilla.org/firefox" ftp_server_to="stage.mozilla.org/firefox"
+release="3.7a1" product="Firefox" platform="Linux_x86-gcc3" build_id="666" locales="en-US" channel="betatest" patch_types="complete" ftp_server_from="stage.mozilla.org/firefox" ftp_server_to="stage.mozilla.org/firefox"
@@ -24,14 +24,16 @@ def testEq(self):
self.uvc.channel = "betatest"
self.uvc.platform = "bar"
self.uvc.aus_server = "aus"
- self.uvc.ftp_server = "ftp"
+ self.uvc.ftp_server_from = "ftp"
+ self.uvc.ftp_server_to = "ftp"
self.uvc.to = "/firefox/4.0rc2.tar.bz2"
uvc2 = UpdateVerifyConfig()
uvc2.product = "foo"
uvc2.channel = "betatest"
uvc2.platform = "bar"
uvc2.aus_server = "aus"
- uvc2.ftp_server = "ftp"
+ uvc2.ftp_server_form = "ftp"
+ uvc2.ftp_server_to = "ftp"
uvc2.to = "/firefox/4.0rc2.tar.bz2"
self.assertEquals(self.uvc, uvc2)
@@ -48,57 +50,79 @@ def testAddRelease(self):
"build_id": 555,
"locales": ["af", "de"],
"patch_types": ["partial", "complete"],
- "from": "/pub/firefox/foo.bz2"
+ "from": "/pub/firefox/foo.bz2",
+ "ftp_server_from": "from",
+ "ftp_server_to": "to"
}
]
self.uvc.addRelease("4.0", build_id=555, locales=["af", "de"],
patch_types=["partial", "complete"],
- from_path="/pub/firefox/foo.bz2")
+ from_path="/pub/firefox/foo.bz2",
+ ftp_server_from="from", ftp_server_to="to")
self.assertEquals(self.uvc.releases, releases)
def testRead(self):
+ ftp_server_from = "stage.mozilla.org/firefox"
+ ftp_server_to = "stage.mozilla.org/firefox"
uvc2 = UpdateVerifyConfig()
uvc2.product = "Firefox"
uvc2.platform = "Linux_x86-gcc3"
uvc2.channel = "betatest"
uvc2.aus_server = "https://aus2.mozilla.org"
- uvc2.ftp_server = "stage.mozilla.org/firefox"
uvc2.to = "/firefox/4.0rc2.tar.bz2"
uvc2.addRelease("4.0", build_id="888",
locales=["af", "de", "en-US", "ja", "zh-TW"],
patch_types=["partial", "complete"],
- from_path="/firefox/4.0rc1.tar.bz2")
+ from_path="/firefox/4.0rc1.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
uvc2.addRelease("4.0b12", build_id="777",
locales=["af", "en-US"],
- from_path="/firefox/4.0b12.tar.bz2")
+ from_path="/firefox/4.0b12.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
uvc2.addRelease("4.0b12", build_id="777",
- locales=["de", "ja", "zh-TW"])
- uvc2.addRelease("3.7a1", build_id="666", locales=["en-US"])
+ locales=["de", "ja", "zh-TW"],
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
+ uvc2.addRelease("3.7a1", build_id="666", locales=["en-US"],
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.uvc.read(self.config)
self.assertEquals(self.uvc, uvc2)
def testWrite(self):
+ ftp_server_from = "stage.mozilla.org/firefox"
+ ftp_server_to = "stage.mozilla.org/firefox"
self.uvc.product = "Firefox"
self.uvc.platform = "Linux_x86-gcc3"
self.uvc.channel = "betatest"
self.uvc.aus_server = "https://aus2.mozilla.org"
- self.uvc.ftp_server = "stage.mozilla.org/firefox"
self.uvc.to = "/firefox/4.0rc2.tar.bz2"
self.uvc.addRelease("4.0", build_id="888",
locales=("af", "de", "en-US", "ja", "zh-TW"),
patch_types=("partial", "complete"),
- from_path="/firefox/4.0rc1.tar.bz2")
+ from_path="/firefox/4.0rc1.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.uvc.addRelease("4.0b12", build_id="777",
locales=["af", "en-US"],
- from_path="/firefox/4.0b12.tar.bz2")
+ from_path="/firefox/4.0b12.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.uvc.addRelease("4.0b12", build_id="777",
- locales=("de", "ja", "zh-TW"))
- self.uvc.addRelease("3.7a1", build_id="666", locales=("en-US",))
+ locales=("de", "ja", "zh-TW"),
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
+ self.uvc.addRelease("3.7a1", build_id="666", locales=("en-US",),
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.uvc.write(self.tmpfile)
self.tmpfile.close()
- self.assertEquals(md5(open(self.config).read()).hexdigest(), md5(open(self.tmpfilename).read()).hexdigest())
+ self.assertEquals(md5(open(self.config).read()).hexdigest(),
+ md5(open(self.tmpfilename).read()).hexdigest())
def testReadInvalidKey(self):
invalidLine = 'foo="bar"'
@@ -113,21 +137,26 @@ def testParseLineBad(self):
self.assertRaises(UpdateVerifyError, self.uvc._parseLine, invalidLine)
def testGetChunk(self):
+ ftp_server_from = "stage.mozilla.org/firefox"
+ ftp_server_to = "stage.mozilla.org/firefox"
self.uvc.read(self.config)
uvc2 = UpdateVerifyConfig()
uvc2.product = "Firefox"
uvc2.platform = "Linux_x86-gcc3"
uvc2.channel = "betatest"
uvc2.aus_server = "https://aus2.mozilla.org"
- uvc2.ftp_server = "stage.mozilla.org/firefox"
uvc2.to = "/firefox/4.0rc2.tar.bz2"
uvc2.addRelease("4.0", build_id="888",
locales=["af", "de", "en-US"],
patch_types=["partial", "complete"],
- from_path="/firefox/4.0rc1.tar.bz2")
+ from_path="/firefox/4.0rc1.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
uvc2.addRelease("4.0b12", build_id="777",
locales=["de", "ja"],
patch_types=["complete"],
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to,
from_path=None)
chunkedConfig = self.uvc.getChunk(chunks=3, thisChunk=1)
self.assertEquals(chunkedConfig, uvc2)
@@ -137,7 +166,8 @@ def testGetChunkWithPathWithSpaces(self):
self.uvc.platform = "Linux_x86-gcc3"
self.uvc.channel = "betatest"
self.uvc.aus_server = "https://aus2.mozilla.org"
- self.uvc.ftp_server = "stage.mozilla.org/firefox"
+ self.uvc.ftp_server_from = "stage.mozilla.org/firefox"
+ self.uvc.ftp_server_to = "stage.mozilla.org/firefox"
self.uvc.to = "/firefox/Firefox 4.0 Beta 2.exe"
self.uvc.addRelease("4.0b1", build_id="222",
locales=["en-US", "ja", "zh-TW"],
@@ -148,7 +178,8 @@ def testGetChunkWithPathWithSpaces(self):
uvc2.platform = "Linux_x86-gcc3"
uvc2.channel = "betatest"
uvc2.aus_server = "https://aus2.mozilla.org"
- uvc2.ftp_server = "stage.mozilla.org/firefox"
+ uvc2.ftp_server_from = "stage.mozilla.org/firefox"
+ uvc2.ftp_server_to = "stage.mozilla.org/firefox"
uvc2.to = "/firefox/Firefox 4.0 Beta 2.exe"
uvc2.addRelease("4.0b1", build_id="222",
locales=["en-US", "ja"],
@@ -178,39 +209,49 @@ def testGetReleaseNonexistenceRelease(self):
self.assertEquals(self.uvc.getRelease("123", None), {})
def testGetFullReleaseTests(self):
+ ftp_server_from = "stage.mozilla.org/firefox"
+ ftp_server_to = "stage.mozilla.org/firefox"
self.uvc.read(self.config)
uvc2 = UpdateVerifyConfig()
uvc2.product = "Firefox"
uvc2.platform = "Linux_x86-gcc3"
uvc2.channel = "betatest"
uvc2.aus_server = "https://aus2.mozilla.org"
- uvc2.ftp_server = "stage.mozilla.org/firefox"
uvc2.to = "/firefox/4.0rc2.tar.bz2"
uvc2.addRelease("4.0", build_id="888",
locales=["af", "de", "en-US", "ja", "zh-TW"],
patch_types=["partial", "complete"],
- from_path="/firefox/4.0rc1.tar.bz2")
+ from_path="/firefox/4.0rc1.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
uvc2.addRelease("4.0b12", build_id="777",
locales=["af", "en-US"],
patch_types=["complete"],
- from_path="/firefox/4.0b12.tar.bz2")
+ from_path="/firefox/4.0b12.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.assertEquals(self.uvc.getFullReleaseTests(), uvc2.releases)
def testGetQuickReleaseTests(self):
+ ftp_server_from = "stage.mozilla.org/firefox"
+ ftp_server_to = "stage.mozilla.org/firefox"
self.uvc.read(self.config)
uvc2 = UpdateVerifyConfig()
uvc2.product = "Firefox"
uvc2.platform = "Linux_x86-gcc3"
uvc2.channel = "betatest"
uvc2.aus_server = "https://aus2.mozilla.org"
- uvc2.ftp_server = "stage.mozilla.org/firefox"
uvc2.to = "/firefox/4.0rc2.tar.bz2"
uvc2.addRelease("4.0b12", build_id="777",
locales=["de", "ja", "zh-TW"],
patch_types=["complete"],
- from_path=None)
+ from_path=None,
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
uvc2.addRelease("3.7a1", build_id="666",
locales=["en-US"],
patch_types=["complete"],
- from_path=None)
+ from_path=None,
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.assertEquals(self.uvc.getQuickReleaseTests(), uvc2.releases)
@@ -70,7 +70,8 @@ def getL10nRepositories(fileName, l10nRepoPath, relbranch=None):
def makeReleaseRepackUrls(productName, brandName, version, platform,
- locale='en-US', signed=False):
+ locale='en-US', signed=False,
+ exclude_secondary=False):
longVersion = version
builds = {}
platformDir = buildbot2ftp(platform)
@@ -90,10 +91,11 @@ def makeReleaseRepackUrls(productName, brandName, version, platform,
if not signed:
prefix.append('unsigned')
prefix.extend([platformDir, locale])
- builds[filename] = '/'.join(
- [p.strip('/') for p in
- prefix + ['%s-%s.zip' % (productName, version)]]
- )
+ if not exclude_secondary:
+ builds[filename] = '/'.join(
+ [p.strip('/') for p in
+ prefix + ['%s-%s.zip' % (productName, version)]]
+ )
builds[instname] = '/'.join(
[p.strip('/') for p in
prefix + ['%s Setup %s.exe' % (brandName, longVersion)]]
@@ -1,7 +1,7 @@
from urlparse import urlunsplit
def makeCandidatesDir(product, version, buildNumber, nightlyDir=None,
- protocol=None, server=None):
+ protocol=None, server=None, ftp_root='/pub/mozilla.org/'):
if protocol:
assert server is not None, "server is required with protocol"
@@ -15,22 +15,22 @@ def makeCandidatesDir(product, version, buildNumber, nightlyDir=None,
if not nightlyDir:
nightlyDir = 'nightly'
- dir = '/pub/mozilla.org/' + product + '/' + nightlyDir + '/' + \
+ directory = ftp_root + product + '/' + nightlyDir + '/' + \
str(version) + '-candidates/build' + str(buildNumber) + '/'
if protocol:
- return urlunsplit((protocol, server, dir, None, None))
+ return urlunsplit((protocol, server, directory, None, None))
else:
- return dir
+ return directory
-def makeReleasesDir(product, version, protocol=None, server=None):
- # TODO: add "devpreview" style directories
+def makeReleasesDir(product, version, protocol=None, server=None,
+ ftp_root='/pub/mozilla.org/'):
if protocol:
assert server is not None, "server is required with protocol"
- dir = '/pub/mozilla.org/%s/releases/%s/' % (product, version)
+ directory = '%s%s/releases/%s/' % (ftp_root, product, version)
if protocol:
- return urlunsplit((protocol, server, dir, None, None))
+ return urlunsplit((protocol, server, directory, None, None))
else:
- return dir
+ return directory
Oops, something went wrong.

0 comments on commit a91ad2e

Please sign in to comment.