From db4b1d3822daf0a0da0ba6e838231251950f3f2e Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 19 Nov 2017 18:11:34 +0100 Subject: Add: scenario for testing unauthorized access --- yarns/500-build-fail.yarn | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'yarns/500-build-fail.yarn') diff --git a/yarns/500-build-fail.yarn b/yarns/500-build-fail.yarn index cfa1a12..e0c35b0 100644 --- a/yarns/500-build-fail.yarn +++ b/yarns/500-build-fail.yarn @@ -30,8 +30,8 @@ Set up the controller. AND controller config uses statedir at the state directory AND an access token for user with scopes ... uapi_projects_post - ... uapi_projects_id_pipeline_id_put - ... uapi_projects_id_pipeline_id_get + ... uapi_projects_id_pipelines_id_put + ... uapi_projects_id_pipelines_id_get ... uapi_projects_id_builds_get ... uapi_workers_id_get ... uapi_builds_get @@ -41,7 +41,7 @@ Set up the controller. Add up a project. - WHEN user makes request POST /projects + WHEN user makes request POST /projects with a valid token and body ... { ... "project": "rome", ... "pipelines": [ @@ -61,7 +61,8 @@ Register a worker. GIVEN an access token for worker-manager with scopes ... uapi_workers_post ... uapi_work_post - WHEN worker-manager makes request POST /workers + ... uapi_work_id_get + WHEN worker-manager makes request POST /workers with a valid token and body ... { ... "worker": "obelix" ... } @@ -70,7 +71,7 @@ Register a worker. Trigger build. First with an invalid status, then a real one. WHEN user makes request PUT /projects/rome/pipelines/construct - ... { "status": "triggered" } + ... with a valid token and body { "status": "triggered" } THEN result has status code 200 Worker wants work and gets the first step to run. @@ -93,7 +94,7 @@ Worker wants work and gets the first step to run. Worker reports some build output. Note the exit code indicating failure. - WHEN worker-manager makes request POST /work + WHEN worker-manager makes request POST /work with a valid token and body ... { ... "build_id": 1, ... "worker": "obelix", -- cgit v1.2.1