Changeset 2d25c1c in mod_gnutls


Ignore:
Timestamp:
Dec 28, 2019, 6:32:02 AM (3 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
master
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.

Location:
test
Files:
1 added
2 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
  • test/test-16_view-status.bash

    rdd91d9c r2d25c1c  
    22set -e
    33
    4 # expected output files
     4# output files, needed for post_check hook
    55log="outputs/16_view-status.log"
    66output="outputs/16_view-status.output"
    77
    8 ${srcdir}/netns_py.bash ${srcdir}/runtest.py --test-number 16 \
    9          --log-connection "${log}" --log-responses "${output}"
    10 
    11 # get the cipher suite reported by gnutls-cli
    12 cli_suite="$(grep -o -P '(?<=^-\sDescription:\s).*$' "${log}")" || true
    13 # extract cipher suite from the server status output
    14 status_suite="$(grep -o -P '(?<=^Current TLS session:\s).*$' "${output}")" \
    15     || true
    16 
    17 echo
    18 if [[ -n "${cli_suite}" && "${status_suite}" = "${cli_suite}" ]]; then
    19     echo "Server and client report matching cipher suite: ${status_suite}"
    20 else
    21     echo "ERROR: Cipher suites mismatching or missing!"
    22     echo "Server: '${status_suite}'"
    23     echo "Client: '${cli_suite}'"
    24     exit 1
    25 fi
     8. ${srcdir}/netns_py.bash ${srcdir}/runtest.py --test-number 16 \
     9        --log-connection "${log}" --log-responses "${output}"
Note: See TracChangeset for help on using the changeset viewer.