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

@ -40,6 +40,19 @@
ProxyPass / http://localhost:8000/ retry=0
ProxyPassReverse / http://localhost:8000/
# Redirect all /api requests to the internal server's address for backward
# compatibility - previously the vhost configuration redirected all /api
# requests to a wsgi app which executed refstack to handle the request.
# Now the refstack server is containerized and the server is served by pecan
# where 'pecan serve' does the same as the wsgi app before plus it also
# serves the UI interface. This has caused that the resources previously
# found under /api/ are one level higher (omitting the /api part of the
# URLs).
# Example: <hostname>/api/v1/results is now at <hostname>/v1/results
<Location "/api/">
ProxyPass "http://localhost:8000/"
</Location>
<Location "/robots.txt">
ProxyPass !
</Location>

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

View File

@ -909,6 +909,7 @@
host-vars:
refstack01.openstack.org:
host_copy_output:
'/var/log/apache2/': logs
'/var/lib/refstack/': logs
'/var/refstack/': logs
vars: