refstack: Edit URL of public RefStackAPI

The previous refstack server had 'api' in the endpoint
addresses of API calls. Let's try to set it in the new
instance as well to keep the same interface.

Also, fix the typo in the testinfra host match and in
the test name.

Change-Id: I7319990144396b3a753678975a09b0add3ac4465
This commit is contained in:
Martin Kopec
2021-02-17 23:12:11 +00:00
committed by Ian Wienand
parent 0dfee1540a
commit 834e39fc7e
3 changed files with 18 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ import time
import urllib3
testinfra_hosts = ['refstack01.openstack.org:8000']
testinfra_hosts = ['refstack01.openstack.org']
test_result_json = {
"cpid": "9cddf99456964d7c90b98362e7175a12",
@@ -49,10 +49,10 @@ def test_refstack_container_running(host):
assert out[0]["State"]["Status"] == "running"
assert out[0]["RestartCount"] == 0
def test_result_submission(host):
url = testinfra_hosts[0] + "/v1/results/"
def test_refstack_result_submission(host):
url = "https://refstack01.openstack.org/v1/results/"
headers = {'Content-type': 'application/json'}
data = json.dumps(test_result_json)
http = urllib3.PoolManager()
http = urllib3.PoolManager(cert_reqs='CERT_NONE')
resp = http.request('POST', url, body=data, headers=headers)
assert resp.status == 201