diff options
Diffstat (limited to 'yarns/300-workers.yarn')
-rw-r--r-- | yarns/300-workers.yarn | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/yarns/300-workers.yarn b/yarns/300-workers.yarn index 6399b20..cea6c81 100644 --- a/yarns/300-workers.yarn +++ b/yarns/300-workers.yarn @@ -1,6 +1,6 @@ <!-- -Copyright 2017-2018 Lars Wirzenius +Copyright 2017-2019 Lars Wirzenius This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by @@ -52,18 +52,13 @@ Note that this only tests managing information about workers via the controller API. It doesn't actually talk to the worker itself. SCENARIO managing workers - GIVEN an RSA key pair for token signing - AND an access token for user with scopes + GIVEN an access token for user with scopes ... uapi_workers_get ... uapi_workers_id_get ... uapi_workers_id_put ... uapi_workers_id_delete AND an access token for obelix with scopes ... uapi_workers_post - AND controller config uses statedir at the state directory - AND controller config uses https://blobs.example.com as artifact store - AND controller config uses https://auth.example.com as authentication - AND controller config uses https://notify.example.com as notify AND a running ick controller WHEN user makes request GET /workers @@ -72,7 +67,6 @@ controller API. It doesn't actually talk to the worker itself. WHEN obelix makes request POST /workers with a valid token and body ... { - ... "worker": "obelix", ... "protocol": "ssh", ... "address": "obelix.ick.example", ... "user": "ick", @@ -81,9 +75,10 @@ controller API. It doesn't actually talk to the worker itself. ... } ... } THEN result has status code 201 + AND worker id is OBELIX AND body matches ... { - ... "worker": "obelix", + ... "worker": "${OBELIX}", ... "protocol": "ssh", ... "address": "obelix.ick.example", ... "user": "ick", @@ -99,7 +94,7 @@ controller API. It doesn't actually talk to the worker itself. ... { ... "workers": [ ... { - ... "worker": "obelix", + ... "worker": "${OBELIX}", ... "protocol": "ssh", ... "address": "obelix.ick.example", ... "user": "ick", @@ -112,11 +107,11 @@ controller API. It doesn't actually talk to the worker itself. WHEN user stops ick controller GIVEN a running ick controller - WHEN user makes request GET /workers/obelix + WHEN user makes request GET /workers/${OBELIX} THEN result has status code 200 AND body matches ... { - ... "worker": "obelix", + ... "worker": "${OBELIX}", ... "protocol": "ssh", ... "address": "obelix.ick.example", ... "user": "ick", @@ -125,10 +120,10 @@ controller API. It doesn't actually talk to the worker itself. ... } ... } - WHEN user makes request PUT /workers/obelix with a valid token + WHEN user makes request PUT /workers/${OBELIX} with a valid token ... and body ... { - ... "worker": "obelix", + ... "worker": "${OBELIX}", ... "protocol": "local", ... "keywords": { ... "debian_codename": "unstable" @@ -137,7 +132,7 @@ controller API. It doesn't actually talk to the worker itself. THEN result has status code 200 AND body matches ... { - ... "worker": "obelix", + ... "worker": "${OBELIX}", ... "protocol": "local", ... "keywords": { ... "debian_codename": "unstable" @@ -145,20 +140,20 @@ controller API. It doesn't actually talk to the worker itself. ... } AND controller state directory contains worker obelix - WHEN user makes request GET /workers/obelix + WHEN user makes request GET /workers/${OBELIX} THEN result has status code 200 AND body matches ... { - ... "worker": "obelix", + ... "worker": "${OBELIX}", ... "protocol": "local", ... "keywords": { ... "debian_codename": "unstable" ... } ... } - WHEN user makes request DELETE /workers/obelix + WHEN user makes request DELETE /workers/${OBELIX} THEN result has status code 200 - WHEN user makes request GET /workers/obelix + WHEN user makes request GET /workers/${OBELIX} THEN result has status code 404 FINALLY stop ick controller |