- Timestamp:
- Jan 23, 2020, 8:02:50 AM (12 months ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- 4f2c988
- Parents:
- f94938c
- Location:
- test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/mgstest/tests.py
rf94938c r4fe52e6 180 180 elif type(act) is TestReq10: 181 181 act.run(command, timeout, conn_log, response_log) 182 elif type(act) is Resume: 183 act.run(conn, command) 182 184 else: 183 185 raise TypeError(f'Unsupported action requested: {act!r}') … … 424 426 425 427 428 class Resume(yaml.YAMLObject): 429 """Test action to close and resume the TLS session. 430 431 Send the gnutls-cli inline command "^resume^" to close and resume 432 the TLS session. "inline-commands" must be present in 433 gnutls_params of the parent connection. This action does not need 434 any arguments, but you must specify with an explicitly empty 435 dictionary for YAML parsing to work, like this: 436 437 !resume {} 438 439 """ 440 yaml_tag = '!resume' 441 def run(self, conn, command): 442 if not '--inline-commands' in command: 443 raise ValueError('gnutls_params must include "inline-commands" ' 444 'to use the resume action!') 445 if not type(conn) is HTTPSubprocessConnection: 446 raise TypeError('Resume action works only with ' 447 'HTTPSubprocessConnection.') 448 conn.sock.send(b'^resume^\n') 449 450 451 426 452 def filter_cert_log(in_stream, out_stream): 427 453 """Filter to stop an erroneous gnutls-cli log message. -
test/tests/14_resume_session/test.yml
rf94938c r4fe52e6 2 2 gnutls_params: 3 3 - x509cafile=authority/x509.pem 4 - resume4 - inline-commands 5 5 actions: 6 6 - !request … … 11 11 exactly: | 12 12 test 13 - !resume {} 14 - !request 15 path: /test.txt 16 expect: 17 status: 200 18 body: 19 exactly: | 20 test
Note: See TracChangeset
for help on using the changeset viewer.