Skip to content

Commit

Permalink
Bug 1337642 - fallbackMapping sidesteps checks on version and buildID…
Browse files Browse the repository at this point in the history
… increasing (#243). r=bhearsum
  • Loading branch information
NinadBhat authored and bhearsum committed Feb 8, 2017
1 parent 70f9690 commit 4c49780
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions auslib/AUS.py
Expand Up @@ -88,6 +88,9 @@ def evaluateRules(self, updateQuery):
if fallbackReleaseName:
release = dbo.releases.getReleases(name=fallbackReleaseName, limit=1)[0]
blob = release['data']
if not blob.shouldServeUpdate(updateQuery):
return None, None
self.log.debug("Returning fallback release %s", release['name'])
return blob, rule['update_type']

self.log.debug("No fallback releases. Request was dropped")
Expand Down
7 changes: 7 additions & 0 deletions auslib/test/web/test_client.py
Expand Up @@ -717,6 +717,13 @@ def testVersion6GetWithFallbackMapping(self):
<patch type="complete" URL="http://a.com/fallback" hashFunction="sha512" hashValue="5" size="5"/>
</update>
</updates>
""")

def testShouldNotServeUpdateForOldVersion(self):
ret = self.client.get('/update/6/q/2.0/1/p/l/a/a/a/a/1/update.xml')
self.assertUpdateEqual(ret, """<?xml version="1.0"?>
<updates>
</updates>
""")

def testVersion6GetWithoutSystemCapabilitiesMatch(self):
Expand Down

0 comments on commit 4c49780

Please sign in to comment.