source: mod_gnutls/test/test-16_view-status.bash

mod_gnutls/0.9.1
Last change on this file was eb4cab7, checked in by Fiona Klute <fiona.klute@…>, 15 months ago

Test suite: Compare cipher suites to test the status page

Expecting a fixed output required a fixed cipher suite, which could
break due to minor changes in GnuTLS. Instead require the status page
and client log to agree about the cipher suite in use. Fix header line
endings in the request while at it.

  • Property mode set to 100755
File size: 667 bytes
Line 
1#!/bin/bash
2set -e
3${srcdir}/runtests t-16
4
5# expected output file
6output="outputs/16_view-status.output"
7# get the cipher suite reported by gnutls-cli
8cli_suite="$(grep -o -P '(?<=^-\sDescription:\s).*$' "${output}")" || true
9# extract cipher suite from the server status output
10status_suite="$(grep -o -P '(?<=^Current TLS session:\s).*$' "${output}")" \
11    || true
12
13echo
14if [[ -n "${cli_suite}" && "${status_suite}" = "${cli_suite}" ]]; then
15    echo "Server and client report matching cipher suite: ${status_suite}"
16else
17    echo "ERROR: Cipher suites mismatching or missing!"
18    echo "Server: '${status_suite}'"
19    echo "Client: '${cli_suite}'"
20    exit 1
21fi
Note: See TracBrowser for help on using the repository browser.