Ignore:
Timestamp:
Dec 7, 2019, 11:22:36 AM (17 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, master, proxy-ticket
Children:
eb84747
Parents:
7054040
Message:

Support plain HTTP in the Python test framework

This makes it possible to run test 26 "redirect HTTP to HTTPS" without
an external HTTP client, the only thing still different from most
other tests is the TEST_HTTP_PORT environment variable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test-26_redirect_HTTP_to_HTTPS.bash

    r7054040 r0e069b6  
    44# with "%{HTTPS}".
    55
    6 set -e
    7 : ${srcdir:="."}
    8 . ${srcdir}/common.bash
    9 netns_reexec ${@}
    10 
    11 testdir="${srcdir}/tests/26_redirect_HTTP_to_HTTPS"
    12 TEST_NAME="$(basename ${testdir})"
    13 . $(dirname ${0})/apache_service.bash
    14 
    156: ${TEST_HTTP_PORT:="9935"}
    167export TEST_HTTP_PORT
    178
    18 function stop_server
    19 {
    20     apache_service "${testdir}" "apache.conf" stop
    21 }
    22 apache_service "${testdir}" "apache.conf" start "${TEST_LOCK}"
    23 trap stop_server EXIT
    24 
    25 output="outputs/${TEST_NAME}.output"
    26 rm -f "$output"
    27 
    28 # Send status request over HTTP. This should get redirected to HTTPS.
    29 URL="http://${TEST_HOST}:${TEST_HTTP_PORT}/status?auto"
    30 if [ "$(basename ${HTTP_CLI})" = "curl" ]; then
    31     ${HTTP_CLI} --location --verbose --cacert authority/x509.pem "${URL}" \
    32                 >"${output}"
    33 elif [ "$(basename ${HTTP_CLI})" = "wget" ]; then
    34     ${HTTP_CLI} --ca-certificate=authority/x509.pem -O "${output}" "${URL}"
    35 else
    36     echo "No HTTP client (curl or wget) found, skipping." 2>&1
    37     exit 77
    38 fi
    39 
    40 # If the request was redirected correctly, the status report lists the
    41 # used ciphersuite.
    42 grep "Current TLS session: (TLS" "${output}"
    43 
    44 stop_server
    45 trap - EXIT
     9${srcdir}/runtests t-26
Note: See TracChangeset for help on using the changeset viewer.