Changeset 1fe7cac in mod_gnutls for test/mgstest


Ignore:
Timestamp:
Jan 5, 2020, 5:43:41 AM (19 months ago)
Author:
Fiona Klute <fiona.klute@…>
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)
Message:

TestReq10: Handle expected and unexpected connection failure

With this TestReq10 supports the same options as TestRequest?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/mgstest/tests.py

    r0b3733d r1fe7cac  
    4343# HTTPS).
    4444transport: 'gnutls'
    45 description='This connection description will be logged.'
     45description: 'This connection description will be logged.'
    4646actions:
    4747  - !request
     
    364364            print(errs.decode(), file=conn_log)
    365365
     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
    366381        # first line of the received data must be the status
    367382        status, rest = outs.decode().split('\r\n', maxsplit=1)
Note: See TracChangeset for help on using the changeset viewer.