Changeset 2e736df in mod_gnutls for test/https-test-client.py
- Timestamp:
- Dec 4, 2019, 9:41:20 AM (14 months ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- 1de6754
- Parents:
- ce85a5f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/https-test-client.py
rce85a5f r2e736df 336 336 parser.add_argument('host', nargs='?', help='Access the specified host', 337 337 default='localhost') 338 parser.add_argument('--insecure', action='store_true',339 help='do not validate the server certificate')340 338 parser.add_argument('-p', '--port', type=int, 341 339 help='Access the specified port', default='8000') 342 parser.add_argument('--x509cafile', type=str,343 help='Use the specified CA to validate the '344 'server certificate')345 340 parser.add_argument('--test-config', type=argparse.FileType('r'), 346 help='load YAML test configuration')341 required=True, help='load YAML test configuration') 347 342 348 343 # enable bash completion if argcomplete is available … … 356 351 357 352 test_conn = None 358 test_actions = None 359 360 if args.test_config: 361 config = yaml.load(args.test_config, Loader=yaml.Loader) 362 if type(config) is TestConnection: 363 test_conn = config 364 print(test_conn) 365 test_actions = test_conn.actions 353 354 config = yaml.load(args.test_config, Loader=yaml.Loader) 355 if type(config) is TestConnection: 356 test_conn = config 357 print(test_conn) 366 358 else: 367 # simple default request 368 test_actions = [TestRequest(path='/test.txt', 369 expect={'status': 200, 'body': 'test\n'}, 370 method='GET')] 371 359 raise TypeError(f'Unsupported configuration: {config!r}') 372 360 373 361 # note: "--logfile" option requires GnuTLS version >= 3.6.7 374 362 command = ['gnutls-cli', '--logfile=/dev/stderr'] 375 if args.insecure: 376 command.append('--insecure') 377 if args.x509cafile: 378 command.append('--x509cafile') 379 command.append(args.x509cafile) 380 if test_conn != None: 381 for s in test_conn.gnutls_params: 382 command.append('--' + s) 363 for s in test_conn.gnutls_params: 364 command.append('--' + s) 383 365 command = command + ['-p', str(args.port), args.host] 384 366 … … 388 370 389 371 try: 390 for act in test_ actions:372 for act in test_conn.actions: 391 373 if type(act) is TestRequest: 392 374 act.run(conn)
Note: See TracChangeset
for help on using the changeset viewer.