test_tls.py (1388:375fcf0e75a7) test_tls.py (1453:71af60a59338)
1import io
2import os
3import re
4import ssl
5import subprocess
6import unittest
7from unit.applications.tls import TestApplicationTLS
8

--- 507 unchanged lines hidden (view full) ---

516
517 self.assertIn(
518 'success',
519 self.conf_delete('/certificates'),
520 'remove all certificates',
521 )
522
523 def test_tls_application_respawn(self):
1import io
2import os
3import re
4import ssl
5import subprocess
6import unittest
7from unit.applications.tls import TestApplicationTLS
8

--- 507 unchanged lines hidden (view full) ---

516
517 self.assertIn(
518 'success',
519 self.conf_delete('/certificates'),
520 'remove all certificates',
521 )
522
523 def test_tls_application_respawn(self):
524 self.skip_alerts.append(r'process \d+ exited on signal 9')
525 self.load('mirror')
526
527 self.certificate()
528
529 self.conf('1', 'applications/mirror/processes')
530
531 self.add_tls(application='mirror')
532
524 self.load('mirror')
525
526 self.certificate()
527
528 self.conf('1', 'applications/mirror/processes')
529
530 self.add_tls(application='mirror')
531
533 (resp, sock) = self.post_ssl(
532 (_, sock) = self.post_ssl(
534 headers={
535 'Host': 'localhost',
536 'Connection': 'keep-alive',
537 'Content-Type': 'text/html',
538 },
539 start=True,
540 body='0123456789',
541 read_timeout=1,
542 )
543
544 app_id = self.findall(r'(\d+)#\d+ "mirror" application started')[0]
545
546 subprocess.call(['kill', '-9', app_id])
547
533 headers={
534 'Host': 'localhost',
535 'Connection': 'keep-alive',
536 'Content-Type': 'text/html',
537 },
538 start=True,
539 body='0123456789',
540 read_timeout=1,
541 )
542
543 app_id = self.findall(r'(\d+)#\d+ "mirror" application started')[0]
544
545 subprocess.call(['kill', '-9', app_id])
546
547 self.skip_alerts.append(r'process %s exited on signal 9' % app_id)
548
548 self.wait_for_record(
549 re.compile(
550 ' (?!' + app_id + '#)(\d+)#\d+ "mirror" application started'
551 )
552 )
553
554 resp = self.post_ssl(
555 headers={

--- 68 unchanged lines hidden ---
549 self.wait_for_record(
550 re.compile(
551 ' (?!' + app_id + '#)(\d+)#\d+ "mirror" application started'
552 )
553 )
554
555 resp = self.post_ssl(
556 headers={

--- 68 unchanged lines hidden ---