Changeset 22a737b in mod_gnutls


Ignore:
Timestamp:
Jun 25, 2020, 4:01:21 AM (9 days ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
master
Children:
2b3a2814
Parents:
ed493e6
Message:

Detect usable loopback IPs during ./configure

Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • .github/workflows/build.yml

    red493e6 r22a737b  
    3737          cat /etc/hosts
    3838      - name: find usable IPs for tests
    39         shell: python3 {0}
    4039        run: |
    41           import socket
    42           def try_connect(sockaddr):
    43               af, socktype, proto, canonname, sa = sockaddr
    44               try:
    45                   s = socket.socket(af, socktype, proto)
    46                   s.connect(sa)
    47               except:
    48                   return False
    49               finally:
    50                   s.close()
    51               return True
    52 
    53           test_ips = []
    54           for name in ['localhost', socket.gethostname()]:
    55               addrs = list(map(lambda t: t[-1][0], filter(try_connect, socket.getaddrinfo(name, 123, proto=socket.IPPROTO_UDP))))
    56               print(f'{name}: {addrs}')
    57               test_ips += addrs
    58           # IPv6 addresses must be enclosed in square brackets
    59           test_ips = [f'[{i}]' if ':' in i else i for i in test_ips]
    60           print(f'::set-env name=test_ips::{" ".join(test_ips)}')
     40          echo "::set-env name=test_ips::$(python3 test/check_test_ips.py localhost $(hostname))"
    6141      - name: set prefix for container-specific artifacts
    6242        # this is because upload-artifact doesn't like ":" in file names
  • .github/workflows/valgrind.yml

    red493e6 r22a737b  
    2929        run: autoreconf -fiv
    3030      - name: configure
    31         run: TEST_IP=127.0.0.1 APACHE_MUTEX=pthread ./configure --enable-valgrind-test
     31        run: APACHE_MUTEX=pthread ./configure --enable-valgrind-test
    3232      - name: store config.log
    3333        uses: actions/upload-artifact@v1
  • configure.ac

    red493e6 r22a737b  
    251251AM_SUBST_NOTMAKE(PID_AFFIX)
    252252
     253AC_MSG_CHECKING([which loopback addresses are usable])
     254loopback_ips="$("${PYTHON}" test/check_test_ips.py -q ::1 127.0.0.1)"
     255AC_MSG_RESULT(${loopback_ips})
     256
    253257# assign default values to TEST_HOST and TEST_IP if necessary
    254258: ${TEST_HOST:="localhost"}
    255 : ${TEST_IP:="[[::1]] 127.0.0.1"}
     259: ${TEST_IP:="${loopback_ips}"}
    256260AC_ARG_VAR([TEST_HOST], [Host name to use for server instances started by \
    257261                        "make check", must resolve to addresses in TEST_IP. \
  • test/README.md

    red493e6 r22a737b  
    3030directories in `tests/`.
    3131
    32 The default configuration assumes that a loopback device with IPv4 and
    33 IPv6 support is available (`TEST_IP="[::1] 127.0.0.1"`) and that
    34 `TEST_HOST="localhost"` resolves to both of these addresses. If this
    35 does not apply to your system (e.g. most Docker containers), you can
    36 pass different values to `./configure`, e.g. to use IPv4 only:
     32The default configuration assumes that a loopback device is available,
     33and that `TEST_HOST="localhost"` resolves to the IPv6 and IPv4
     34loopback addresses. `./configure` checks if `[::1]` and `127.0.0.1`
     35are available, if one isn't it will be disabled. You can override the
     36defaults by passing different values to `./configure`, e.g. to
     37unconditionally use IPv4 only:
    3738
    3839```bash
    3940$ TEST_HOST="localhost" TEST_IP="127.0.0.1" ./configure
    4041```
     42
     43Note that having less than two addresses in `TEST_IP` will lead to
     44some tests being skipped.
    4145
    4246If tests fail due to expired certificates or PGP signatures, run
Note: See TracChangeset for help on using the changeset viewer.