diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-11-19 18:11:34 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-11-19 18:11:34 +0100 |
commit | db4b1d3822daf0a0da0ba6e838231251950f3f2e (patch) | |
tree | 1384ce2356308d15cc2c466558f427dc6050f297 /yarns/400-build.yarn | |
parent | 196e9c65b6ed1a488a7163148a75b72aea3d07fe (diff) | |
download | ick2-db4b1d3822daf0a0da0ba6e838231251950f3f2e.tar.gz |
Add: scenario for testing unauthorized access
Diffstat (limited to 'yarns/400-build.yarn')
-rw-r--r-- | yarns/400-build.yarn | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/yarns/400-build.yarn b/yarns/400-build.yarn index 07ae2f7..30dbc5b 100644 --- a/yarns/400-build.yarn +++ b/yarns/400-build.yarn @@ -29,8 +29,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 @@ -40,7 +40,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": [ @@ -70,7 +70,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" ... } @@ -79,11 +80,11 @@ Register a worker. Trigger build. First with an invalid status, then a real one. WHEN user makes request PUT /projects/rome/pipelines/construct - ... { "status": "VANDALS!" } + ... with a valid token and body { "status": "VANDALS!" } THEN result has status code 400 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. If the worker asks @@ -171,7 +172,7 @@ User can now see pipeline is running and which worker is building it. Worker reports some build output. Note the null exit code. - 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", @@ -210,7 +211,7 @@ The build log is immediately accessible. Report the step is done, and successfully. - 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", @@ -267,7 +268,7 @@ User sees changed status. Report it done. - 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", @@ -332,7 +333,7 @@ Also, there's a build with a log. Start build again. This should become build number 2. 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 WHEN worker-manager makes request GET /work/obelix @@ -374,7 +375,7 @@ Start build again. This should become build number 2. ... ] ... } - WHEN worker-manager makes request POST /work + WHEN worker-manager makes request POST /work with a valid token and body ... { ... "build_id": 2, ... "worker": "obelix", @@ -390,7 +391,7 @@ Start build again. This should become build number 2. WHEN worker-manager makes request GET /work/obelix THEN result has status code 200 - WHEN worker-manager makes request POST /work + WHEN worker-manager makes request POST /work with a valid token and body ... { ... "build_id": 2, ... "worker": "obelix", |