Changeset a08b25e in mod_gnutls


Ignore:
Timestamp:
Nov 25, 2015, 5:14:01 PM (4 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
412ee84
Parents:
3e04c0b
git-author:
Thomas Klute <thomas2.klute@…> (11/25/15 16:58:03)
git-committer:
Thomas Klute <thomas2.klute@…> (11/25/15 17:14:01)
Message:

Test suite: Listen on IPv6 and IPv4 loopback by default

Distributions handle host names for loopback addresses and their
resolution differently, which caused trouble with the previous
defaults of TEST_HOST=localhost and TEST_IP=[::1]. While they work
fine on Debian, tests on Ubuntu failed apparently randomly because
connections to localhost sometimes used 127.0.0.1, and setting
TEST_IP=127.0.0.1 would sometimes be hit by the opposite effect.

The best solution seems to be to let the test servers listen on both
IPv4 and IPv6 loopback addresses (127.0.0.1 and [::1]): "localhost"
should always resolve to at least one of them, so we don't have to
care about the details. Apache handles the transport layer anyway, so
this change will not hide bugs in mod_gnutls itself.

Listening on both addresses is achieved by treating TEST_IP as a list
of addresses to listen on, changing the default to "[::1] 127.0.0.1",
and building a config file containing "Listen" directives for the test
servers from that. With this change there is no need to export TEST_IP
to the test environment any more.

Users who want to set their own TEST_IP can do so as before, but
should note that IPv6 addresses must be enclosed in square brackets.

Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r3e04c0b ra08b25e  
    120120# assign default values to TEST_HOST and TEST_IP if necessary
    121121: ${TEST_HOST:="localhost"}
    122 : ${TEST_IP:="[::1]"}
     122: ${TEST_IP:="[[::1]] 127.0.0.1"}
    123123AC_ARG_VAR([TEST_HOST], [Host name to use for server instances started by \
    124                         "make check", must resolve to TEST_IP. The default \
    125                         is "localhost".])
    126 AC_ARG_VAR([TEST_IP], [IP address to use for server instances started by \
    127                       "make check". The default is the IPv6 loopback address \
    128                       [::1].])
     124                        "make check", must resolve to addresses in TEST_IP. \
     125                        The default is "localhost".])
     126AC_ARG_VAR([TEST_IP], [List of IP addresses to use for server instances \
     127                      started by "make check". The default is \
     128                      "[::1] 127.0.0.1". Note that IPv6 addresses must be \
     129                      enclosed in square brackets.])
     130AM_SUBST_NOTMAKE(TEST_IP)
     131
     132dnl Build list of "Listen" statements for Apache
     133LISTEN_LIST="# Listen addresses for the test servers"
     134for i in ${TEST_IP}; do
     135        LISTEN_LIST="${LISTEN_LIST}
     136Listen ${i}:\${TEST_PORT}"
     137done
     138AC_SUBST(LISTEN_LIST)
     139AM_SUBST_NOTMAKE(LISTEN_LIST)
    129140
    130141AC_CONFIG_FILES([Makefile src/Makefile test/Makefile test/tests/Makefile \
    131                           doc/Makefile include/mod_gnutls.h])
     142                          doc/Makefile include/mod_gnutls.h test/listen.conf])
    132143AC_OUTPUT
    133144
  • test/.gitignore

    r3e04c0b ra08b25e  
    11cache
     2listen.conf
    23*~
    34logs
  • test/Makefile.am

    r3e04c0b ra08b25e  
    146146        export TEST_LOCK_WAIT="$(lock_wait)"; \
    147147        export TEST_HOST="$(TEST_HOST)"; \
    148         export TEST_IP="$(TEST_IP)"; \
    149148        export TEST_PORT="$(TEST_PORT)"; \
    150149        export MSVA_PORT="$(MSVA_PORT)"; \
     
    152151        export TEST_MSVA_WAIT="$(TEST_MSVA_WAIT)"; \
    153152        export TEST_QUERY_DELAY="$(TEST_QUERY_DELAY)"; \
    154         export BACKEND_HOST="$(TEST_HOST)"; \
    155         export BACKEND_IP="$(TEST_IP)";
     153        export BACKEND_HOST="$(TEST_HOST)";
    156154
    157155# Echo AM_TESTS_ENVIRONMENT. This can be useful for debugging, e.g. if
  • test/base_apache.conf

    r3e04c0b ra08b25e  
    1414TypesConfig ${srcdir}/mime.types
    1515
    16 Listen ${TEST_IP}:${TEST_PORT}
     16Include ${srcdir}/listen.conf
    1717
    1818DocumentRoot ${srcdir}/data
  • test/runtests

    r3e04c0b ra08b25e  
    1717
    1818BADVARS=0
    19 for v in APACHE2 TEST_HOST TEST_IP TEST_PORT TEST_QUERY_DELAY TEST_MSVA_WAIT \
     19for v in APACHE2 TEST_HOST TEST_PORT TEST_QUERY_DELAY TEST_MSVA_WAIT \
    2020                 MSVA_PORT TEST_LOCK; do
    2121    if [ ! -v "$v" ]; then
Note: See TracChangeset for help on using the changeset viewer.