Changeset 92cf138 in mod_gnutls for test/runtest.py
- Timestamp:
- Dec 31, 2019, 11:37:18 AM (3 years ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- 4de8cd3
- Parents:
- b457e67
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/runtest.py
rb457e67 r92cf138 21 21 import subprocess 22 22 import sys 23 import tempfile 23 24 24 25 import mgstest.hooks … … 55 56 return (found.path, found.name) 56 57 58 def temp_logfile(): 59 return tempfile.SpooledTemporaryFile(max_size=4096, mode='w+', 60 prefix='mod_gnutls', suffix=".log") 61 62 57 63 58 64 … … 187 193 # run extra checks the test's hooks.py might define 188 194 if plugin.post_check: 189 if args.log_connection: 190 args.log_connection.seek(0) 191 if args.log_responses: 192 args.log_responses.seek(0) 195 args.log_connection.seek(0) 196 args.log_responses.seek(0) 193 197 plugin.post_check(conn_log=args.log_connection, 194 198 response_log=args.log_responses) … … 202 206 parser.add_argument('--test-number', type=int, 203 207 required=True, help='load YAML test configuration') 204 # TODO: The log files should be created as temporary205 # files if needed by the plugin but not configured.206 208 parser.add_argument('--log-connection', type=argparse.FileType('w+'), 207 default= None,209 default=temp_logfile(), 208 210 help='write connection log to this file') 209 211 parser.add_argument('--log-responses', type=argparse.FileType('w+'), 210 default= None,212 default=temp_logfile(), 211 213 help='write HTTP responses to this file') 212 214 … … 221 223 222 224 with contextlib.ExitStack() as stack: 223 if args.log_connection: 224 stack.enter_context(contextlib.closing(args.log_connection)) 225 if args.log_responses: 226 stack.enter_context(contextlib.closing(args.log_responses)) 225 stack.enter_context(contextlib.closing(args.log_connection)) 226 stack.enter_context(contextlib.closing(args.log_responses)) 227 227 main(args)
Note: See TracChangeset
for help on using the changeset viewer.