test_tls.py (1848:4bd548074e2c) test_tls.py (1850:839024ce4a6a)
1import io
2import re
3import ssl
4import subprocess
5
6import pytest
7
8from unit.applications.tls import TestApplicationTLS
1import io
2import re
3import ssl
4import subprocess
5
6import pytest
7
8from unit.applications.tls import TestApplicationTLS
9from unit.option import option
10
11
12class TestTLS(TestApplicationTLS):
13 prerequisites = {'modules': {'python': 'any', 'openssl': 'any'}}
14
9
10
11class TestTLS(TestApplicationTLS):
12 prerequisites = {'modules': {'python': 'any', 'openssl': 'any'}}
13
15 def findall(self, pattern):
16 with open(option.temp_dir + '/unit.log', 'r', errors='ignore') as f:
17 return re.findall(pattern, f.read())
18
19 def openssl_date_to_sec_epoch(self, date):
20 return self.date_to_sec_epoch(date, '%b %d %H:%M:%S %Y %Z')
21
22 def add_tls(self, application='empty', cert='default', port=7080):
23 assert 'success' in self.conf(
24 {
25 "pass": "applications/" + application,
26 "tls": {"certificate": cert},

--- 579 unchanged lines hidden ---
14 def openssl_date_to_sec_epoch(self, date):
15 return self.date_to_sec_epoch(date, '%b %d %H:%M:%S %Y %Z')
16
17 def add_tls(self, application='empty', cert='default', port=7080):
18 assert 'success' in self.conf(
19 {
20 "pass": "applications/" + application,
21 "tls": {"certificate": cert},

--- 579 unchanged lines hidden ---