Changeset 2d25c1c in mod_gnutls for test/mgstest/__init__.py


Ignore:
Timestamp:
Dec 28, 2019, 6:32:02 AM (17 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, master, proxy-ticket
Children:
079859e
Parents:
dd91d9c
Message:

Test 16_view-status: Use post_check hook for GnuTLS 3.6.11 compatibility

Since 3.6.11 GnuTLS lists the certificate type used for authentication
in the TLS session information. In most tests (including this one) the
client does not authenticate, so the strings aren't exactly
equivalent. The new hook takes this into consideration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/mgstest/__init__.py

    rdd91d9c r2d25c1c  
    5454                fcntl.flock(lockfile, fcntl.LOCK_UN)
    5555                print(f'Unlocked {file}.', file=sys.stderr)
     56
     57
     58
     59def first_line_match(regexp, file):
     60    """Return the first match of the regular expression in file (by line),
     61    or None. Technically applicable to any iterable containing
     62    strings, not just files opened for reading.
     63    """
     64    for line in file:
     65        m = regexp.search(line)
     66        if m:
     67            return m
     68    return None
Note: See TracChangeset for help on using the changeset viewer.