source: mod_gnutls/test/test-28_HTTP2_support.bash @ b47dc70

debian/master
Last change on this file since b47dc70 was d50dac5, checked in by Fiona Klute <fiona.klute@…>, 19 months ago

New test case for HTTP/2 support

  • Property mode set to 100755
File size: 1.2 KB
Line 
1#!/bin/bash
2#
3# Check if HTTP/2 connections using mod_gnutls and mod_http2 work
4
5set -e
6: ${srcdir:="."}
7. ${srcdir}/common.bash
8netns_reexec ${@}
9
10testdir="${srcdir}/tests/28_HTTP2_support"
11TEST_NAME="$(basename ${testdir})"
12. $(dirname ${0})/apache_service.bash
13
14if [ ! -r ${AP_LIBEXECDIR}/mod_http2.so ]; then
15    echo "mod_http2.so not found, skipping." 2>&1
16    exit 77
17elif [ "$(basename ${HTTP_CLI})" != "curl" ] \
18       || ! ${HTTP_CLI} -V | grep -P '\sHTTP2($|\s)'; then
19    echo "Curl not found or does not support HTTP/2, skipping." 2>&1
20    exit 77
21fi
22
23function stop_server
24{
25    apache_service "${testdir}" "apache.conf" stop
26}
27apache_service "${testdir}" "apache.conf" start "${TEST_LOCK}"
28trap stop_server EXIT
29
30output="outputs/${TEST_NAME}.output"
31header="outputs/${TEST_NAME}.header"
32rm -f "${output}" "${header}"
33
34URL="https://${TEST_HOST}:${TEST_PORT}/status?auto"
35${HTTP_CLI} --http2 --location --verbose --cacert authority/x509.pem \
36            --dump-header "${header}" --output "${output}" "${URL}"
37
38echo "Checking for HTTP/2 in logged header:"
39grep "HTTP/2 200" "${header}"
40echo "Checking for TLS session status:"
41grep "Current TLS session: (TLS" "${output}"
42
43apache_service "${testdir}" "apache.conf" stop
44trap - EXIT
Note: See TracBrowser for help on using the repository browser.