test_tls.py (1041:9bdd46610ea9) test_tls.py (1064:75a64629661f)
1import re
2import ssl
3import time
4import subprocess
5import unittest
6from unit.applications.tls import TestApplicationTLS
7
8

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

84 self.add_tls()
85
86 self.assertIn(
87 'error',
88 self.conf_delete('/certificates/blah'),
89 'remove nonexistings certificate',
90 )
91
1import re
2import ssl
3import time
4import subprocess
5import unittest
6from unit.applications.tls import TestApplicationTLS
7
8

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

84 self.add_tls()
85
86 self.assertIn(
87 'error',
88 self.conf_delete('/certificates/blah'),
89 'remove nonexistings certificate',
90 )
91
92 @unittest.expectedFailure
92 @unittest.skip('not yet')
93 def test_tls_certificate_update(self):
94 self.load('empty')
95
96 self.certificate()
97
98 self.add_tls()
99
100 cert_old = self.get_server_certificate()
101
102 self.certificate()
103
104 self.assertNotEqual(
105 cert_old, self.get_server_certificate(), 'update certificate'
106 )
107
93 def test_tls_certificate_update(self):
94 self.load('empty')
95
96 self.certificate()
97
98 self.add_tls()
99
100 cert_old = self.get_server_certificate()
101
102 self.certificate()
103
104 self.assertNotEqual(
105 cert_old, self.get_server_certificate(), 'update certificate'
106 )
107
108 @unittest.expectedFailure
108 @unittest.skip('not yet')
109 def test_tls_certificate_key_incorrect(self):
110 self.load('empty')
111
112 self.certificate('first', False)
113 self.certificate('second', False)
114
115 self.assertIn(
116 'error', self.certificate_load('first', 'second'), 'key incorrect'

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

407 self.add_tls(cert='end-int')
408
409 self.assertEqual(
410 self.get_ssl()['status'],
411 200,
412 'certificate chain intermediate server',
413 )
414
109 def test_tls_certificate_key_incorrect(self):
110 self.load('empty')
111
112 self.certificate('first', False)
113 self.certificate('second', False)
114
115 self.assertIn(
116 'error', self.certificate_load('first', 'second'), 'key incorrect'

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

407 self.add_tls(cert='end-int')
408
409 self.assertEqual(
410 self.get_ssl()['status'],
411 200,
412 'certificate chain intermediate server',
413 )
414
415 @unittest.expectedFailure
415 @unittest.skip('not yet')
416 def test_tls_reconfigure(self):
417 self.load('empty')
418
419 self.assertEqual(self.get()['status'], 200, 'init')
420
421 self.certificate()
422
423 (resp, sock) = self.get(

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

466 'Content-Type': 'text/html',
467 },
468 sock=sock,
469 body='0123456789',
470 )
471
472 self.assertEqual(resp['body'], '0123456789', 'keepalive 2')
473
416 def test_tls_reconfigure(self):
417 self.load('empty')
418
419 self.assertEqual(self.get()['status'], 200, 'init')
420
421 self.certificate()
422
423 (resp, sock) = self.get(

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

466 'Content-Type': 'text/html',
467 },
468 sock=sock,
469 body='0123456789',
470 )
471
472 self.assertEqual(resp['body'], '0123456789', 'keepalive 2')
473
474 @unittest.expectedFailure
474 @unittest.skip('not yet')
475 def test_tls_keepalive_certificate_remove(self):
476 self.load('empty')
477
478 self.assertEqual(self.get()['status'], 200, 'init')
479
480 self.certificate()
481
482 self.add_tls()

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

494 resp = self.get_ssl(
495 headers={'Host': 'localhost', 'Connection': 'close'}, sock=sock
496 )
497 except:
498 resp = None
499
500 self.assertEqual(resp, None, 'keepalive remove certificate')
501
475 def test_tls_keepalive_certificate_remove(self):
476 self.load('empty')
477
478 self.assertEqual(self.get()['status'], 200, 'init')
479
480 self.certificate()
481
482 self.add_tls()

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

494 resp = self.get_ssl(
495 headers={'Host': 'localhost', 'Connection': 'close'}, sock=sock
496 )
497 except:
498 resp = None
499
500 self.assertEqual(resp, None, 'keepalive remove certificate')
501
502 @unittest.expectedFailure
502 @unittest.skip('not yet')
503 def test_tls_certificates_remove_all(self):
504 self.load('empty')
505
506 self.certificate()
507
508 self.assertIn(
509 'success',
510 self.conf_delete('/certificates'),

--- 86 unchanged lines hidden ---
503 def test_tls_certificates_remove_all(self):
504 self.load('empty')
505
506 self.certificate()
507
508 self.assertIn(
509 'success',
510 self.conf_delete('/certificates'),

--- 86 unchanged lines hidden ---