Tests: fixed unit.log print.
This commit is contained in:
@@ -8,8 +8,6 @@ from unit.applications.proto import TestApplicationProto
|
||||
|
||||
class TestApplicationTLS(TestApplicationProto):
|
||||
def setup_method(self):
|
||||
super().setup_method()
|
||||
|
||||
self.context = ssl.create_default_context()
|
||||
self.context.check_hostname = False
|
||||
self.context.verify_mode = ssl.CERT_NONE
|
||||
@@ -24,9 +22,9 @@ class TestApplicationTLS(TestApplicationProto):
|
||||
'-x509',
|
||||
'-new',
|
||||
'-subj', '/CN=' + name + '/',
|
||||
'-config', self.temp_dir + '/openssl.conf',
|
||||
'-out', self.temp_dir + '/' + name + '.crt',
|
||||
'-keyout', self.temp_dir + '/' + name + '.key',
|
||||
'-config', option.temp_dir + '/openssl.conf',
|
||||
'-out', option.temp_dir + '/' + name + '.crt',
|
||||
'-keyout', option.temp_dir + '/' + name + '.key',
|
||||
],
|
||||
stderr=subprocess.STDOUT,
|
||||
)
|
||||
@@ -38,8 +36,8 @@ class TestApplicationTLS(TestApplicationProto):
|
||||
if key is None:
|
||||
key = crt
|
||||
|
||||
key_path = self.temp_dir + '/' + key + '.key'
|
||||
crt_path = self.temp_dir + '/' + crt + '.crt'
|
||||
key_path = option.temp_dir + '/' + key + '.key'
|
||||
crt_path = option.temp_dir + '/' + crt + '.crt'
|
||||
|
||||
with open(key_path, 'rb') as k, open(crt_path, 'rb') as c:
|
||||
return self.conf(k.read() + c.read(), '/certificates/' + crt)
|
||||
@@ -66,7 +64,7 @@ class TestApplicationTLS(TestApplicationProto):
|
||||
return ssl.get_server_certificate(addr, ssl_version=ssl_version)
|
||||
|
||||
def openssl_conf(self):
|
||||
conf_path = self.temp_dir + '/openssl.conf'
|
||||
conf_path = option.temp_dir + '/openssl.conf'
|
||||
|
||||
if os.path.exists(conf_path):
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user