Changeset a213967 in mod_gnutls for test


Ignore:
Timestamp:
Mar 31, 2015, 11:16:11 AM (4 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
232fb60
Parents:
ed82a6a
Message:

Test suite: Filter "Server" header when checking output

Like "Date", this header is likely to change between builds or runs, e.g. because
of different Apache and GnuTLS versions between hosts.

Location:
test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/runtests

    red82a6a ra213967  
    3333}
    3434
    35 # Compare expected/actual outputs, filtering out the "Date" header
    36 # from actual output because it is expected to change. It must have
    37 # been manually excluded from the expected output.
     35# Compare expected/actual outputs, filtering out headers from actual
     36# output that are expected to change between runs or builds (currently
     37# "Date" and "Server"). The headers must be excluded in the expected
     38# output.
    3839#
    3940# Parameters:
     
    4142# $2: path to actual output
    4243# $3: additional options for diff (optional)
    43 function diff_output_filter_date()
     44function diff_output_filter_headers()
    4445{
    4546    expected="$1"
    4647    actual="$2"
    4748    diff $3 -u "${expected}" <( cat "${actual}" | \
    48         grep -v -P '^Date:\s.*GMT\s?$' | tail -n "$(wc -l < ${expected})" )
     49        grep -v -P '^Date:\s.*GMT\s?$' | \
     50        grep -v -P '^Server:\sApache'  | \
     51        tail -n "$(wc -l < ${expected})" )
    4952}
    5053
     
    5457    if [ -e output ]; then
    5558        printf "\ngnutls-cli outputs:\n"
    56         diff_output_filter_date "output" "$output" || true
     59        diff_output_filter_headers "output" "$output" || true
    5760    fi
    5861    printf "\nApache error logs:\n"
     
    131134
    132135    if [ -e output ] ; then
    133         diff_output_filter_date "output" "$output" "-q"
     136        diff_output_filter_headers "output" "$output" "-q"
    134137    fi
    135138    /usr/sbin/apache2 -f "$(pwd)/apache.conf" -k stop || [ -e fail.server ]
  • test/tests/21_TLS_reverse_proxy_wrong_cert/output

    red82a6a ra213967  
    11HTTP/1.1 502 Proxy Error
    2 Server: Apache/2.4.10 (Ubuntu) mod_gnutls/0.6 GnuTLS/3.2.16
    32Content-Length: 407
    43Connection: close
Note: See TracChangeset for help on using the changeset viewer.