From 78d9c80226c52bcd70e27e7ee2a3a7754f644b53 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 24 Mar 2018 14:02:20 +0200 Subject: Change: rename blob service to artifact store --- yarns/100-projects.yarn | 2 +- yarns/150-pipelines.yarn | 2 +- yarns/200-version.yarn | 4 ++-- yarns/300-workers.yarn | 2 +- yarns/400-build.yarn | 6 ++--- yarns/500-build-fail.yarn | 2 +- yarns/600-unauthz.yarn | 2 +- yarns/700-artifact-store.yarn | 52 +++++++++++++++++++++++++++++++++++++++++++ yarns/700-blob-service.yarn | 52 ------------------------------------------- yarns/900-implements.yarn | 4 ++-- yarns/900-local.yarn | 32 +++++++++++++------------- 11 files changed, 80 insertions(+), 80 deletions(-) create mode 100644 yarns/700-artifact-store.yarn delete mode 100644 yarns/700-blob-service.yarn (limited to 'yarns') diff --git a/yarns/100-projects.yarn b/yarns/100-projects.yarn index 7c18952..b5a7f78 100644 --- a/yarns/100-projects.yarn +++ b/yarns/100-projects.yarn @@ -55,7 +55,7 @@ building them. We start by starting an instance of the controller. ... uapi_projects_id_put ... uapi_projects_id_delete AND controller config uses statedir at the state directory - AND controller config uses https://blobs.example.com as blob service + AND controller config uses https://blobs.example.com as artifact store AND a running ick controller WHEN user makes request GET /projects diff --git a/yarns/150-pipelines.yarn b/yarns/150-pipelines.yarn index feda6d0..15c4b05 100644 --- a/yarns/150-pipelines.yarn +++ b/yarns/150-pipelines.yarn @@ -63,7 +63,7 @@ running them. We start by starting an instance of the controller. ... uapi_pipelines_id_put ... uapi_pipelines_id_delete AND controller config uses statedir at the state directory - AND controller config uses https://blobs.example.com as blob service + AND controller config uses https://blobs.example.com as artifact store AND a running ick controller WHEN user makes request GET /pipelines diff --git a/yarns/200-version.yarn b/yarns/200-version.yarn index 2f87ac7..d281a19 100644 --- a/yarns/200-version.yarn +++ b/yarns/200-version.yarn @@ -26,13 +26,13 @@ The Ick controller reports is version upon request. AND an access token for user with scopes ... uapi_version_get AND controller config uses statedir at the state directory - AND controller config uses https://blobs.example.com as blob service + AND controller config uses https://blobs.example.com as artifact store AND a running ick controller WHEN user makes request GET /version THEN result has status code 200 AND version in body matches version from setup.py - AND blob service URL is https://blobs.example.com + AND artifact store URL is https://blobs.example.com FINALLY stop ick controller diff --git a/yarns/300-workers.yarn b/yarns/300-workers.yarn index 2cc7ea2..8b12f6f 100644 --- a/yarns/300-workers.yarn +++ b/yarns/300-workers.yarn @@ -60,7 +60,7 @@ controller API. It doesn't actually talk to the worker itself. ... uapi_workers_id_put ... uapi_workers_id_delete AND controller config uses statedir at the state directory - AND controller config uses https://blobs.example.com as blob service + AND controller config uses https://blobs.example.com as artifact store AND a running ick controller WHEN user makes request GET /workers diff --git a/yarns/400-build.yarn b/yarns/400-build.yarn index ef164d9..e2ba579 100644 --- a/yarns/400-build.yarn +++ b/yarns/400-build.yarn @@ -27,7 +27,7 @@ Set up the controller. GIVEN an RSA key pair for token signing AND controller config uses statedir at the state directory - AND controller config uses https://blobs.example.com as blob service + AND controller config uses https://blobs.example.com as artifact store AND an access token for user with scopes ... uapi_pipelines_post ... uapi_projects_post @@ -640,7 +640,7 @@ Set up the controller. GIVEN an RSA key pair for token signing AND controller config uses statedir at the state directory - AND controller config uses https://blobs.example.com as blob service + AND controller config uses https://blobs.example.com as artifact store AND an access token for user with scopes ... uapi_pipelines_post ... uapi_projects_post @@ -797,7 +797,7 @@ Set up the controller. GIVEN an RSA key pair for token signing AND controller config uses statedir at the state directory - AND controller config uses https://blobs.example.com as blob service + AND controller config uses https://blobs.example.com as artifact store AND an access token for user with scopes ... uapi_pipelines_post ... uapi_projects_post diff --git a/yarns/500-build-fail.yarn b/yarns/500-build-fail.yarn index dcc551d..84ec66d 100644 --- a/yarns/500-build-fail.yarn +++ b/yarns/500-build-fail.yarn @@ -28,7 +28,7 @@ Set up the controller. GIVEN an RSA key pair for token signing AND controller config uses statedir at the state directory - AND controller config uses https://blobs.example.com as blob service + AND controller config uses https://blobs.example.com as artifact store AND an access token for user with scopes ... uapi_pipelines_post ... uapi_projects_post diff --git a/yarns/600-unauthz.yarn b/yarns/600-unauthz.yarn index 0a602af..c57f815 100644 --- a/yarns/600-unauthz.yarn +++ b/yarns/600-unauthz.yarn @@ -28,7 +28,7 @@ Set up the controller. GIVEN an RSA key pair for token signing AND controller config uses statedir at the state directory - AND controller config uses https://blobs.example.com as blob service + AND controller config uses https://blobs.example.com as artifact store AND an access token for user with scopes ... uapi_projects_post ... uapi_projects_id_pipelines_id_put diff --git a/yarns/700-artifact-store.yarn b/yarns/700-artifact-store.yarn new file mode 100644 index 0000000..2dcea2e --- /dev/null +++ b/yarns/700-artifact-store.yarn @@ -0,0 +1,52 @@ + + +# Artifact store + +This scenario tests the artifact store API to store and retrieve +blobs. At this stage the artifact store is the simplest possible; so +simple, in fact, it will certainly change in the future. + + SCENARIO artifact store + +Set up the artifact store. + + GIVEN an RSA key pair for token signing + AND artifact store config uses blobs at the blob directory + AND an access token for user with scopes + ... uapi_blobs_id_put + ... uapi_blobs_id_get + AND a running artifact store + +Try to get a non-existent blob. It should result in an error. + + WHEN user retrieves /blobs/cake from artifact store + THEN result has status code 404 + +Create and store a blob, retrieve it and verify we get it back intack. + + WHEN user creates a blob named cake with random data + AND user sends blob cake to artifact store as /blobs/cake + THEN result has status code 200 + + WHEN user retrieves /blobs/cake from artifact store + THEN result has status code 200 + AND body is the same as the blob cake + + FINALLY stop artifact store diff --git a/yarns/700-blob-service.yarn b/yarns/700-blob-service.yarn deleted file mode 100644 index 1fd0c06..0000000 --- a/yarns/700-blob-service.yarn +++ /dev/null @@ -1,52 +0,0 @@ - - -# Blob service - -This scenario tests the blob service API to store and retrieve blobs. -At this stage the blob service is the simplest possible; so simple, in -fact, it will certainly change in the future. - - SCENARIO blob service - -Set up the blob service. - - GIVEN an RSA key pair for token signing - AND blob service config uses blobs at the blob directory - AND an access token for user with scopes - ... uapi_blobs_id_put - ... uapi_blobs_id_get - AND a running blob service - -Try to get a non-existent blob. It should result in an error. - - WHEN user retrieves /blobs/cake from blob service - THEN result has status code 404 - -Create and store a blob, retrieve it and verify we get it back intack. - - WHEN user creates a blob named cake with random data - AND user sends blob cake to blob service as /blobs/cake - THEN result has status code 200 - - WHEN user retrieves /blobs/cake from blob service - THEN result has status code 200 - AND body is the same as the blob cake - - FINALLY stop blob service diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn index c6be689..8a7dff1 100644 --- a/yarns/900-implements.yarn +++ b/yarns/900-implements.yarn @@ -36,7 +36,7 @@ along with this program. If not, see . url = vars['url'] http(vars, get, url + path, token=token) - IMPLEMENTS WHEN (\S+) retrieves (\S+) from blob service + IMPLEMENTS WHEN (\S+) retrieves (\S+) from artifact store user = get_next_match() path = get_next_match() token = get_token(user) @@ -74,7 +74,7 @@ along with this program. If not, see . url = vars['url'] http(vars, put, url + path, body=body, token=token) - IMPLEMENTS WHEN (\S+) sends blob (\S+) to blob service as (\S+) + IMPLEMENTS WHEN (\S+) sends blob (\S+) to artifact store as (\S+) user = get_next_match() filename = get_next_match() path = get_next_match() diff --git a/yarns/900-local.yarn b/yarns/900-local.yarn index 5efad69..4e9dbe1 100644 --- a/yarns/900-local.yarn +++ b/yarns/900-local.yarn @@ -46,8 +46,8 @@ along with this program. If not, see . IMPLEMENTS GIVEN controller config uses (\S+) at the state directory vars['statedir'] = get_next_match() - IMPLEMENTS GIVEN controller config uses (\S+) as blob service - vars['blob_service'] = get_next_match() + IMPLEMENTS GIVEN controller config uses (\S+) as artifact store + vars['artifact_store'] = get_next_match() ## Start and stop the controller @@ -67,7 +67,7 @@ along with this program. If not, see . }, ], 'statedir': vars['statedir'], - 'blob-service': vars['blob_service'], + 'artifact-store': vars['artifact_store'], } env = dict(os.environ) env['ICK_CONTROLLER_CONFIG'] = 'ick_controller.yaml' @@ -109,22 +109,22 @@ along with this program. If not, see . ## Check version result - IMPLEMENTS THEN blob service URL is (\S+) + IMPLEMENTS THEN artifact store URL is (\S+) expected = get_next_match() body = vars['body'] obj = json.loads(body) - actual = obj['blob_service'] + actual = obj['artifact_store'] assertEqual(actual, expected) -## Start and stop blob service +## Start and stop artifact store - IMPLEMENTS GIVEN blob service config uses (\S+) at the blob directory + IMPLEMENTS GIVEN artifact store config uses (\S+) at the blob directory vars['blobdir'] = get_next_match() - IMPLEMENTS GIVEN a running blob service + IMPLEMENTS GIVEN a running artifact store import os, time, cliapp, yaml - vars['blob_service.log'] = 'blob_service.log' - vars['gunicorn3_bs.log'] = 'gunicorn3_bs.log' + vars['artifact_store.log'] = 'artifact_store.log' + vars['gunicorn3_as.log'] = 'gunicorn3_as.log' vars['bsport'] = random_free_port() vars['bsurl'] = 'http://127.0.0.1:{}'.format(vars['bsport']) config = { @@ -133,27 +133,27 @@ along with this program. If not, see . 'token-public-key': cat('token.key.pub'), 'log': [ { - 'filename': vars['blob_service.log'], + 'filename': vars['artifact_store.log'], }, ], 'blobdir': vars['blobdir'], } env = dict(os.environ) - env['BLOB_SERVICE_CONFIG'] = 'blob_service.yaml' - yaml.safe_dump(config, open('blob_service.yaml', 'w')) + env['ARTIFACT_STORE_CONFIG'] = 'artifact_store.yaml' + yaml.safe_dump(config, open('artifact_store.yaml', 'w')) argv = [ 'gunicorn3', '--daemon', '--bind', '127.0.0.1:{}'.format(vars['bsport']), - '--log-file', vars['gunicorn3_bs.log'], + '--log-file', vars['gunicorn3_as.log'], '--log-level', 'debug', '-p', 'bspid', - 'blob_service:app', + 'artifact_store:app', ] cliapp.runcmd(argv, env=env) vars['bspid'] = int(cat('bspid')) wait_for_port(vars['bsport']) - IMPLEMENTS FINALLY stop blob service + IMPLEMENTS FINALLY stop artifact store import os, signal os.kill(vars['bspid'], signal.SIGTERM) -- cgit v1.2.1