summaryrefslogtreecommitdiff
path: root/yarns/300-workers.yarn
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-06-28 08:00:28 +0300
committerLars Wirzenius <liw@liw.fi>2019-07-05 20:59:10 +0300
commit1fc41ad97411b435c512ba3a0de63929eda9c33d (patch)
tree753b342e70c5ac2bf64eb619e95f815d47588e0b /yarns/300-workers.yarn
parent1c6d50edf9041055f4804a1ba21a4fc5499bb0a9 (diff)
downloadick2-1fc41ad97411b435c512ba3a0de63929eda9c33d.tar.gz
Change: make yarns run against a remote Ick instance, not local
Diffstat (limited to 'yarns/300-workers.yarn')
-rw-r--r--yarns/300-workers.yarn33
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