Commit 91525e37 authored by Łukasz Nowak's avatar Ł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
...@@ -36,6 +36,7 @@ import time ...@@ -36,6 +36,7 @@ import time
import unittest import unittest
import zc.lockfile import zc.lockfile
import socket import socket
import OpenSSL.SSL
from cryptography import x509 from cryptography import x509
from cryptography.hazmat.backends import default_backend from cryptography.hazmat.backends import default_backend
...@@ -426,9 +427,16 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase): ...@@ -426,9 +427,16 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
with open(incorrect_key_pem, 'w') as out: with open(incorrect_key_pem, 'w') as out:
out.write(key_pem + certificate_pem) out.write(key_pem + certificate_pem)
with self.assertRaises(requests.exceptions.ConnectionError): try:
self.requests_get( self.requests_get(
self.kedifa_url + self.reference, cert=incorrect_key_pem) 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): def revokeCaucaseServiceCertifice(self):
with captured_output() as (out, err): 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 to comment