def test_all_builders_exist(self): for p in ['win32', 'win64', 'macosx64']: for i in xrange(1, 7): # test full chunk size builder_task = get_task_by_name( self.graph, "release-beta_firefox_%s_update_verify_beta_%s" % (p, i)) verify(builder_task, self.builder_exists_schema)
def test_partials_present(self): for pl in ["win32", "linux64"]: for part in ["37.0", "38.0"]: task_name = "release-mozilla-beta_firefox_{pl}_l10n_repack_1_{part}_update_generator".format(pl=pl, part=part) partial_task = get_task_by_name(self.graph, task_name) verify(partial_task, Schema(dict)) # The task must exist as a dict (ie not None)
def test_encryption(self): self.task_schema = Schema({ 'task': { 'payload': { 'encryptedEnv': All(Length(2), [Match(r'^wcB')]) # Must have 2 elements, starting with wcB } } }, required=True, extra=True) test_kwargs = create_firefox_test_args({ 'updates_enabled': True, 'repo_path': 'foo/bar', 'branch': 'mozilla-beta', 'signing_class': 'dep-signing', 'release_channels': ['beta'], 'final_verify_channels': ['beta'], 'signing_pvt_key': PVT_KEY_FILE, 'accepted_mar_channel_id': 'firefox-mozilla-beta', 'signing_cert': 'dep', 'moz_disable_mar_cert_verification': True, 'en_US_config': { "platforms": { "macosx64": {"unsigned_task_id": "xyz", "signed_task_id": "xyz"}, "win32": {"unsigned_task_id": "xyz", "signed_task_id": "xyz"}, } }, }) graph = make_task_graph(**test_kwargs) do_common_assertions(graph) for p in ("win32", "macosx64"): for v in ("38.0build1", "37.0build2"): balrog = get_task_by_name(graph, "{}_en-US_{}_funsize_balrog_task".format(p, v)) verify(balrog, self.task_schema)
def do_common_assertions(graph): _cached_taskIDs = set() if graph['tasks']: for t in graph['tasks']: assert t['taskId'] not in _cached_taskIDs verify(t, COMMON_TASK_SCHEMA) _cached_taskIDs.add(t['taskId'])
def test_partials_present(self): for pl in ["win32", "linux64"]: for part in ["37.0", "38.0"]: task_name = "release-mozilla-beta_firefox_{pl}_l10n_repack_1_{part}_update_generator".format( pl=pl, part=part) partial_task = get_task_by_name(self.graph, task_name) verify(partial_task, Schema( dict)) # The task must exist as a dict (ie not None)
def test_partials_present(self): for pl in ["win32", "linux64"]: for part in ["37.0", "38.0"]: for chunk in [1, 2]: partials_name_1 = "release-mozilla-beta_firefox_{pl}_l10n_repack_{chunk}_{part}_update_generator".format( pl=pl, part=part, chunk=chunk) partials_name_2 = "release-mozilla-beta_firefox_{pl}_l10n_repack_{chunk}_{part}_signing_task".format( pl=pl, part=part, chunk=chunk) partials_1 = get_task_by_name(self.graph, partials_name_1) partials_2 = get_task_by_name(self.graph, partials_name_2) # Verify the partial tasks are not none verify(partials_1, self.partials_schema) verify(partials_2, self.partials_schema)
def test_multichannel(self): for chan in ["beta", "release"]: multichan_schema = Schema({ 'task': { 'provisionerId': 'buildbot-bridge', 'workerType': 'buildbot-bridge', 'payload': { 'properties': { 'VERIFY_CONFIG': "{chan}-firefox-win32.cfg".format(chan=chan), } } } }, extra=True, required=True) multichan_task = get_task_by_name(self.graph, "release-beta_firefox_win32_update_verify_{chan}_3".format(chan=chan)) verify(multichan_task, multichan_schema, TestBB_UpdateVerifyMultiChannel.not_allowed)
def test_funsize_name(self): for platform in ("win32", "linux64",): for version in ("37.0", "38.0",): for chunk in ('1', '2',): generator_schema = Schema({ 'task': {'metadata': { 'name': "[funsize] Update generating task %s chunk %s for %s" % (platform, chunk, version,)}} }, extra=True, required=True) signing_schema = Schema({ 'task': {'metadata': { 'name': "[funsize] MAR signing task %s chunk %s for %s" % (platform, chunk, version,)}} }, extra=True, required=True) balrog_schema = Schema({ 'task': {'metadata': { 'name': "[funsize] Publish to Balrog %s chunk %s for %s" % (platform, chunk, version,)}} }, extra=True, required=True) generator = get_task_by_name(self.graph, "release-mozilla-beta_firefox_{pl}_l10n_repack_{c}_{part}_update_generator".format( pl=platform, part=version, c=chunk)) signing = get_task_by_name(self.graph, "release-mozilla-beta_firefox_{pl}_l10n_repack_{c}_{part}_signing_task".format( pl=platform, part=version, c=chunk)) balrog = get_task_by_name(self.graph, "release-mozilla-beta_firefox_{pl}_l10n_repack_{c}_{part}_balrog_task".format( pl=platform, part=version, c=chunk)) verify(generator, generator_schema) verify(signing, signing_schema) verify(balrog, balrog_schema)
def test_bouncer_submission_task(self): verify(self.task, self.task_schema, TestBouncerSubmission.not_allowed)
def test_human_task(self): verify(self.human_task, self.human_task_schema)
def test_uptake_monitoring_task(self): verify(self.task, self.task_schema, self.generate_task_dependency_validator())
def test_task(self): verify(self.task, self.task_schema, self.generate_dependency_validator())
def test_email_final(self): verify(self.task, self.task_schema, self.generate_task_requires_validator())
def test_task(self): verify(self.task, self.test_schema, self.generate_task_dependency_validator(), TestBinaryTransparency.not_allowed)
def test_task(self): verify(self.task, self.task_schema, TestSnapBuilder.validate_task_payload)
def test_decode(self): verify(self.decode, self.claims_schema)
def do_common_assertions(graph): verify(graph, TC_GRAPH_SCHEMA, unique_task_ids)
def test_generator_signing_balrog_tasks(self): for p in ("win32", "macosx64"): for v, appV in (("38.0build1", "38.0"), ("37.0build2", "37.0")): generator = get_task_by_name(self.graph, "{}_en-US_{}_funsize_update_generator".format(p, v)) signing = get_task_by_name(self.graph, "{}_en-US_{}_funsize_signing_task".format(p, v)) balrog = get_task_by_name(self.graph, "{}_en-US_{}_funsize_balrog_task".format(p, v)) generator_schema = Schema({ 'requires': [self.generator_image['taskId']], 'task': { 'metadata': { 'name': "[funsize] Update generating task %s %s for %s" % (p, "en-US", v.split('build')[0],) } } }, extra=True, required=True) signing_schema = Schema({ 'requires': [generator['taskId']], 'task': { 'metadata': { 'name': "[funsize] MAR signing task %s %s for %s" % (p, "en-US", v.split('build')[0],), }, 'payload': { 'signingManifest': "https://queue.taskcluster.net/v1/task/%s/artifacts/public/env/manifest.json" % generator["taskId"], }, 'scopes': [ "project:releng:signing:cert:release-signing", "project:releng:signing:format:mar", "project:releng:signing:format:gpg", ], }, }, extra=True, required=True) balrog_schema = Schema({ 'requires': [signing['taskId'], self.funsize_balrog_image['taskId']], 'task': { 'scopes': ["docker-worker:feature:balrogVPNProxy"], 'metadata': { 'name': "[funsize] Publish to Balrog %s %s for %s" % (p, "en-US", v.split('build')[0],), } } }, extra=True, required=True) if p == "win32": generator_schema = generator_schema.extend({ 'task': { 'extra': { 'funsize': { 'partials': [ { 'from_mar': "http://download.mozilla.org/?product=firefox-%s-complete&os=win&lang=en-US" % appV, 'to_mar': "https://queue.taskcluster.net/v1/task/xyy/artifacts/public/build/firefox-42.0.en-US.win32.complete.mar", } ] } } } }) elif p == "macosx64": generator_schema = generator_schema.extend({ 'task': { 'extra': { 'funsize': { 'partials': [ { 'from_mar': "http://download.mozilla.org/?product=firefox-%s-complete&os=osx&lang=en-US" % appV, 'to_mar': "https://queue.taskcluster.net/v1/task/xyz/artifacts/public/build/firefox-42.0.en-US.mac.complete.mar", } ] } } } }) verify(generator, generator_schema, TestEnUSPartials.generator_not_allowed) verify(balrog, balrog_schema) verify(signing, signing_schema)
def test_task_schema(self): verify(self.task, self.task_schema)
def test_task(self): verify(self.task, TestPushToMirrorsGraph2.validate_command)
def test_publish_balrog_task(self): verify(self.task, self.task_schema, self.generate_task_requires_validator())
def test_source_builder_task(self): verify(self.task, self.task_schema, self.generate_task_requires_validator())
def test_task(self): verify(self.task, self.test_schema, self.generate_task_dependency_validator(), TestChecksums.not_allowed)
def test_source_builder_signing_task(self): verify(self.signing_task, self.signing_task_schema)
def test_task(self): verify(self.task, self.task_schema, TestPushToMirrorsAutomatic.validate_task_not_allowed, TestPushToMirrorsAutomatic.validate_task_command, self.generate_task_requires_validator())
def test_source_signing_task(self): verify(self.foo_source_signing_beet, self.generate_source_signing_dependency_validator())
def test_push_to_mirrors(self): verify(self.push_to_mirrors, self.push_to_mirrors_schema)
def test_tasks(self): for platform, task in self.tasks.iteritems(): verify(task, self.task_schema, self.generate_command_requirements_validator(platform), TestBeetmoverl10nPartialsCandidates.not_allowed)
def test_bb_update_verify_graph(self): verify(self.graph, self.graph_schema)
def test_task(self): verify(self.task, self.generate_task_requires_validator())
def test_all_builders_exist(self): for p in ['win32', 'win64', 'macosx64']: for i in xrange(1, 7): # test full chunk size builder_task = get_task_by_name(self.graph, "release-beta_firefox_%s_update_verify_beta_%s" % (p, i)) verify(builder_task, self.builder_exists_schema)
def test_notification_configuration(self): for task in self.graph['tasks']: verify(task, self.notifications_schema)
def test_task(self): verify(self.task, self.task_schema)
def test_notification_configuration(self): for task in self.graph["tasks"]: verify(task, self.notifications_schema)
def test_generator_signing_balrog_tasks(self): for p in ("win32", "macosx64"): for v, appV in (("38.0build1", "38.0"), ("37.0build2", "37.0")): generator = get_task_by_name( self.graph, "{}_en-US_{}_funsize_update_generator".format(p, v)) signing = get_task_by_name( self.graph, "{}_en-US_{}_funsize_signing_task".format(p, v)) balrog = get_task_by_name( self.graph, "{}_en-US_{}_funsize_balrog_task".format(p, v)) generator_schema = Schema( { 'requires': [self.generator_image['taskId']], 'task': { 'metadata': { 'name': "[funsize] Update generating task %s %s for %s" % ( p, "en-US", v.split('build')[0], ) } } }, extra=True, required=True) signing_schema = Schema( { 'requires': [generator['taskId']], 'task': { 'metadata': { 'name': "[funsize] MAR signing task %s %s for %s" % ( p, "en-US", v.split('build')[0], ), }, 'payload': { 'signingManifest': "https://queue.taskcluster.net/v1/task/%s/artifacts/public/env/manifest.json" % generator["taskId"], }, 'scopes': [ "project:releng:signing:cert:release-signing", "project:releng:signing:format:mar", "project:releng:signing:format:gpg", ], }, }, extra=True, required=True) balrog_schema = Schema( { 'requires': [ signing['taskId'], self.funsize_balrog_image['taskId'] ], 'task': { 'scopes': ["docker-worker:feature:balrogVPNProxy"], 'metadata': { 'name': "[funsize] Publish to Balrog %s %s for %s" % ( p, "en-US", v.split('build')[0], ), } } }, extra=True, required=True) if p == "win32": generator_schema = generator_schema.extend({ 'task': { 'extra': { 'funsize': { 'partials': [{ 'from_mar': "http://download.mozilla.org/?product=firefox-%s-complete&os=win&lang=en-US" % appV, 'to_mar': "https://queue.taskcluster.net/v1/task/xyy/artifacts/public/build/firefox-42.0.en-US.win32.complete.mar", }] } } } }) elif p == "macosx64": generator_schema = generator_schema.extend({ 'task': { 'extra': { 'funsize': { 'partials': [{ 'from_mar': "http://download.mozilla.org/?product=firefox-%s-complete&os=osx&lang=en-US" % appV, 'to_mar': "https://queue.taskcluster.net/v1/task/xyz/artifacts/public/build/firefox-42.0.en-US.mac.complete.mar", }] } } } }) verify(generator, generator_schema, TestEnUSPartials.generator_not_allowed) verify(balrog, balrog_schema) verify(signing, signing_schema)
def test_uptake_monitoring(self): verify(self.uptake_monitoring, self.uptake_monitoring)
def test_graph(self): verify(self.graph, self.graph_schema)
def test_verify(self): verify(self.verify, self.claims_schema)
def test_human_task(self): verify(self.human_task, self.human_task_schema, self.generate_human_task_requires_validator())
def test_bb_update_verify_task(self): verify(self.task, self.task_schema, self.generate_task_dependency_validator())
def test_channel(self): verify(self.task, self.task_schema, self.__class__.not_allowed)
def test_cdns(self): verify(self.task, self.task_schema, self.generate_task_dependency_validator())