Commit 91525e37 by Łukasz Nowak

test: Be tolerant regarding exceptions on SSL issue

Depending on the environment, various exceptions can be risen, so be tolerant
regarding the exception type.
parent 90f54bcc
Pipeline #7998 failed with stage
in 0 seconds
......@@ -36,6 +36,7 @@ import time
import unittest
import zc.lockfile
import socket
import OpenSSL.SSL
from cryptography import x509
from cryptography.hazmat.backends import default_backend
......@@ -426,9 +427,16 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
with open(incorrect_key_pem, 'w') as out:
out.write(key_pem + certificate_pem)
with self.assertRaises(requests.exceptions.ConnectionError):
try:
self.requests_get(
self.kedifa_url + self.reference, cert=incorrect_key_pem)
except (
requests.exceptions.ConnectionError,
requests.exceptions.SSLError,
OpenSSL.SSL.SysCallError):
pass
except Exception:
raise
def revokeCaucaseServiceCertifice(self):
with captured_output() as (out, err):
......
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 sign in to comment