Skip to content

Commit

Permalink
Merge 2ac0e18 into ccb4f52
Browse files Browse the repository at this point in the history
  • Loading branch information
escapewindow committed Jan 18, 2017
2 parents ccb4f52 + 2ac0e18 commit b30ccc8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
5 changes: 4 additions & 1 deletion scriptworker/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@

# scriptworker identification
"scriptworker_worker_types": (
"pushapk-v1",
"balrogworker-v1",
"beetmoverworker-v1",
"signing-linux-v1",
Expand Down Expand Up @@ -218,11 +219,13 @@
# Map scopes to restricted-level
'cot_restricted_scopes': frozendict({
'firefox': {
'project:releng:beetmover:release': 'release',
'project:releng:balrog:release': 'release',
'project:releng:beetmover:release': 'release',
'project:releng:pushapk:release': 'release',
'project:releng:signing:cert:release-signing': 'release',
'project:releng:balrog:nightly': 'nightly',
'project:releng:beetmover:nightly': 'nightly',
'project:releng:pushapk:nightly': 'nightly',
'project:releng:signing:cert:nightly-signing': 'nightly',
}
}),
Expand Down
17 changes: 17 additions & 0 deletions scriptworker/cot/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def get_valid_task_types():
'l10n': verify_build_task,
'decision': verify_decision_task,
'docker-image': verify_docker_image_task,
'pushapk': verify_pushapk_task,
'signing': verify_signing_task,
})

Expand Down Expand Up @@ -959,6 +960,22 @@ async def verify_beetmover_task(chain, obj):
return await verify_scriptworker_task(chain, obj)


# verify_pushapk_task {{{1
async def verify_pushapk_task(chain, obj):
"""Verify the pushapk trust object.
Currently the only check is to make sure it was run on a scriptworker.
Args:
chain (ChainOfTrust): the chain we're operating on
obj (ChainOfTrust or LinkOfTrust): the trust object for the pushapk task.
Raises:
CoTError: on error.
"""
return await verify_scriptworker_task(chain, obj)


# verify_signing_task {{{1
async def verify_signing_task(chain, obj):
"""Verify the signing trust object.
Expand Down
6 changes: 4 additions & 2 deletions scriptworker/test/test_cot_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,15 +835,17 @@ async def test_verify_docker_image_task_command(chain, docker_image_link):

# verify_scriptworker_task {{{1
@pytest.mark.parametrize("func", ["verify_balrog_task", "verify_beetmover_task",
"verify_signing_task", "verify_scriptworker_task"])
"verify_pushapk_task", "verify_signing_task",
"verify_scriptworker_task"])
@pytest.mark.asyncio
async def test_verify_scriptworker_task(chain, build_link, func):
build_link.worker_impl = 'scriptworker'
await getattr(cotverify, func)(chain, build_link)


@pytest.mark.parametrize("func", ["verify_balrog_task", "verify_beetmover_task",
"verify_signing_task", "verify_scriptworker_task"])
"verify_pushapk_task", "verify_signing_task",
"verify_scriptworker_task"])
@pytest.mark.asyncio
async def test_verify_scriptworker_task_worker_impl(chain, build_link, func):
build_link.worker_impl = 'bad_impl'
Expand Down

0 comments on commit b30ccc8

Please sign in to comment.