source: mod_gnutls/test/tests/30_ip_based_vhosts/hooks.py @ c26a163

asyncio
Last change on this file since c26a163 was baa0056, checked in by Fiona Klute <fiona.klute@…>, 21 months ago

Test 30_ip_based_vhosts: Move to prepare_env hook

  • Property mode set to 100644
File size: 631 bytes
Line 
1import os
2from unittest import SkipTest
3
4def prepare_env():
5    addrs = os.environ['TEST_IP'].split()
6    if len(addrs) < 2:
7        raise SkipTest('This test needs two or more IP addresses in '
8                       'TEST_IP, check ./configure options!')
9
10    # The two virtual hosts have different IPs, so we can check if
11    # selection without SNI works correctly. The request will go to the
12    # second one.
13    os.environ['VHOST1_IP'] = addrs[0]
14    os.environ['VHOST2_IP'] = addrs[1]
15
16    # gnutls-cli expects IPv6 addresses without enclosing brackets,
17    # remove them
18    os.environ['TARGET_IP'] = addrs[1].strip('[]')
Note: See TracBrowser for help on using the repository browser.