Commit 4b562491 authored by Jérome Perrin's avatar Jérome Perrin

software/erp5/test: check backend is serving using a caucase managed certificate

parent 5c20afb2
...@@ -30,6 +30,7 @@ import json ...@@ -30,6 +30,7 @@ import json
import glob import glob
import urlparse import urlparse
import socket import socket
import tempfile
import time import time
import psutil import psutil
...@@ -54,8 +55,22 @@ class TestPublishedURLIsReachableMixin(object): ...@@ -54,8 +55,22 @@ class TestPublishedURLIsReachableMixin(object):
# retry in a loop. # retry in a loop.
# If we can move the "create site" in slapos node instance, then this retry loop # If we can move the "create site" in slapos node instance, then this retry loop
# would not be necessary. # would not be necessary.
# browse caucase HAL to get the CA certificate for services
caucase_hal = requests.get(
self.getRootPartitionConnectionParameterDict()['caucase-http-url']).json()
caucase_cas_hal = requests.get(
caucase_hal['_links']['getCASHAL']['href']).json()
caucase_cas_ca = requests.get(caucase_cas_hal['_links']['getCACertificate']['href']).text
self.assertIn('-----BEGIN CERTIFICATE-----', caucase_cas_ca)
with tempfile.NamedTemporaryFile() as cas_ca_file:
cas_ca_file.write(caucase_cas_ca)
cas_ca_file.flush()
import pdb; pdb.set_trace()
for i in range(1, 60): for i in range(1, 60):
r = requests.get(url, verify=False) # XXX can we get CA from caucase already ? r = requests.get(url, verify=cas_ca_file.name)
if r.status_code in (requests.codes.service_unavailable, if r.status_code in (requests.codes.service_unavailable,
requests.codes.not_found): requests.codes.not_found):
delay = i * 2 delay = i * 2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment