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

mod_gnutls/0.12.0
Last change on this file was 5357109, checked in by Fiona Klute <fiona.klute@…>, 12 months ago

Fix flake8 warnings in test hooks.py

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