- Timestamp:
- Jan 5, 2020, 5:43:41 AM (3 years ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- 459a982
- Parents:
- 0b3733d
- git-author:
- Fiona Klute <fiona.klute@…> (01/05/20 05:41:39)
- git-committer:
- Fiona Klute <fiona.klute@…> (01/05/20 05:43:41)
- Location:
- test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
test/mgstest/tests.py
r0b3733d r1fe7cac 43 43 # HTTPS). 44 44 transport: 'gnutls' 45 description ='This connection description will be logged.'45 description: 'This connection description will be logged.' 46 46 actions: 47 47 - !request … … 364 364 print(errs.decode(), file=conn_log) 365 365 366 if proc.returncode != 0: 367 if len(outs) != 0: 368 raise TestExpectationFailed( 369 f'Connection failed, but got output: {outs!r}') 370 if self.expects_conn_reset(): 371 print('connection reset as expected.') 372 return 373 else: 374 raise TestExpectationFailed( 375 'Connection failed unexpectedly!') 376 else: 377 if self.expects_conn_reset(): 378 raise TestExpectationFailed( 379 'Expected connection reset did not occur!') 380 366 381 # first line of the received data must be the status 367 382 status, rest = outs.decode().split('\r\n', maxsplit=1) -
test/sample_fail.yml
r0b3733d r1fe7cac 1 # Example: The first TLS connection fails (certificate error), the2 # second succeeds but receives a 404.3 1 - !connection 2 description: 'This TLS connection must fail with a certificate error.' 4 3 gnutls_params: 5 4 - x509cafile=rogueca/x509.pem … … 10 9 reset: yes 11 10 - !connection 11 description: 'TLS connection succeeds, the request receives error 404.' 12 12 gnutls_params: 13 13 - x509cafile=authority/x509.pem 14 14 actions: 15 15 - !request 16 path: / 16 path: /missing-file.txt 17 17 expect: 18 18 status: 404 19 - !connection 20 description: 'This TLS connection must fail with a certificate error.' 21 gnutls_params: 22 - x509cafile=rogueca/x509.pem 23 actions: 24 - !request10 25 path: /test.txt 26 headers: 27 Host: localhost 28 expect: 29 reset: yes -
test/sample_test.yml
r0b3733d r1fe7cac 28 28 - 'Using GnuTLS version: ' 29 29 - 'Current TLS session: (TLS1.3)' 30 - !request10 31 path: /test.txt 32 headers: 33 Host: localhost 34 expect: 35 headers: 36 Content-Type: 'text/plain'
Note: See TracChangeset
for help on using the changeset viewer.