From 1fc41ad97411b435c512ba3a0de63929eda9c33d Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 28 Jun 2019 08:00:28 +0300 Subject: Change: make yarns run against a remote Ick instance, not local --- yarns/900-implements.yarn | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'yarns/900-implements.yarn') diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn index 4dcbd8b..92acaa4 100644 --- a/yarns/900-implements.yarn +++ b/yarns/900-implements.yarn @@ -32,6 +32,7 @@ along with this program. If not, see . IMPLEMENTS WHEN (\S+) makes request GET (\S+) user = get_next_match() path = get_next_match() + path = expand_vars(path, V) token = get_token(user) url = V['url'] http(V, get, url + path, token=token) @@ -40,8 +41,19 @@ along with this program. If not, see . user = get_next_match() path = get_next_match() token = get_token(user) - url = V['bsurl'] - http(V, get_blob, url + path, token=token) + url = V['url'] + version = get_version(url) + asurl = version['artifact_store'] + http(V, get_blob, asurl + path, token=token) + + IMPLEMENTS WHEN (\S+) deletes (\S+) from artifact store + user = get_next_match() + path = get_next_match() + token = get_token(user) + url = V['url'] + version = get_version(url) + asurl = version['artifact_store'] + http(V, delete, asurl + path, token=token) IMPLEMENTS WHEN (\S+) makes request GET (\S+) with an invalid token user = get_next_match() @@ -54,6 +66,8 @@ along with this program. If not, see . user = get_next_match() path = get_next_match() body = get_next_match() + body = expand_vars(body, V) + V['xxxPOSTbodyvalid'] = body token = get_token(user) url = V['url'] http(V, post, url + path, body=body, token=token) @@ -62,6 +76,8 @@ along with this program. If not, see . user = get_next_match() path = get_next_match() body = get_next_match() + body = expand_vars(body, V) + V['xxxPOSTbody'] = body token = get_token(user) url = V['url'] http(V, post, url + path, body=body, token='invalid') @@ -69,7 +85,10 @@ along with this program. If not, see . IMPLEMENTS WHEN (\S+) makes request PUT (\S+) with a valid token and body (.+) user = get_next_match() path = get_next_match() + path = expand_vars(path, V) body = get_next_match() + body = expand_vars(body, V) + V['xxxPUTbody'] = body token = get_token(user) url = V['url'] http(V, put, url + path, body=body, token=token) @@ -80,12 +99,15 @@ along with this program. If not, see . path = get_next_match() body = cat(filename) token = get_token(user) - url = V['bsurl'] - http(V, put_blob, url + path, body=body, token=token) + url = V['url'] + version = get_version(url) + asurl = version['artifact_store'] + http(V, put_blob, asurl + path, body=body, token=token) IMPLEMENTS WHEN (\S+) makes request PUT (\S+) with an invalid token user = get_next_match() path = get_next_match() + path = expand_vars(path, V) body = '{}' token = get_token(user) url = V['url'] @@ -94,18 +116,25 @@ along with this program. If not, see . IMPLEMENTS WHEN (\S+) makes request DELETE (\S+) user = get_next_match() path = get_next_match() + path = expand_vars(path, V) token = get_token(user) url = V['url'] http(V, delete, url + path, token=token) ## HTTP response inspection + IMPLEMENTS THEN worker id is (\S+) + varname = get_next_match() + body = json.loads(V['body']) + V[varname] = body['worker'] + IMPLEMENTS THEN result has status code (\d+) expected = int(get_next_match()) assertEqual(expected, V['status_code']) IMPLEMENTS THEN body matches (.+) expected_text = get_next_match() + expected_text = expand_vars(expected_text, V) expected = json.loads(expected_text) actual = json.loads(V['body']) print 'expected' -- cgit v1.2.1