Commit 74f5a8d9 authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Drop unneeded parameter public-ipv4

The public-ipv4 comes from the historical usage of the system, but since
new implementation came into place it was never needed, so now it's time to
say goodbye.

Test has been updated to do in-house mimic of the used IP to access.
parent a4d59ef5
...@@ -60,14 +60,12 @@ This is to deploy an entire frontend server with a public IPv4. If you want to ...@@ -60,14 +60,12 @@ This is to deploy an entire frontend server with a public IPv4. If you want to
First, you will need to request a "master" instance of Caddy Frontend with: First, you will need to request a "master" instance of Caddy Frontend with:
* A ``domain`` parameter where the frontend will be available * A ``domain`` parameter where the frontend will be available
* A ``public-ipv4`` parameter to state which public IPv4 will be used
like:: like::
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<instance> <instance>
<parameter id="domain">moulefrite.org</parameter> <parameter id="domain">moulefrite.org</parameter>
<parameter id="public-ipv4">xxx.xxx.xxx.xxx</parameter>
</instance> </instance>
Then, it is possible to request many slave instances (currently only from slapconsole, UI doesn't work yet) of Caddy Frontend, like:: Then, it is possible to request many slave instances (currently only from slapconsole, UI doesn't work yet) of Caddy Frontend, like::
...@@ -189,10 +187,6 @@ Name of the domain to be used (example: mydomain.com). Sub domains of this domai ...@@ -189,10 +187,6 @@ Name of the domain to be used (example: mydomain.com). Sub domains of this domai
Using the IP given by the Master Instance. "domain" is a mandatory Parameter. Using the IP given by the Master Instance. "domain" is a mandatory Parameter.
public-ipv4
~~~~~~~~~~~
Public ipv4 of the frontend (the one Caddy will be indirectly listening to)
port port
~~~~ ~~~~
Port used by Caddy. Optional parameter, defaults to 4443. Port used by Caddy. Optional parameter, defaults to 4443.
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# not need these here). # not need these here).
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 28bf0c4c75c028bed79fc38786831b3e md5sum = 04015a7a552285984d091293ef573fb9
[profile-common] [profile-common]
filename = instance-common.cfg.in filename = instance-common.cfg.in
...@@ -26,11 +26,11 @@ md5sum = a6a626fd1579fd1d4b80ea67433ca16a ...@@ -26,11 +26,11 @@ md5sum = a6a626fd1579fd1d4b80ea67433ca16a
[profile-caddy-replicate] [profile-caddy-replicate]
filename = instance-apache-replicate.cfg.in filename = instance-apache-replicate.cfg.in
md5sum = 5fb1da6ff50234870f25a86ae51f5d5e md5sum = b7eeb3268b32b9fceb9a6f3c248a7bbf
[profile-slave-list] [profile-slave-list]
_update_hash_filename_ = templates/apache-custom-slave-list.cfg.in _update_hash_filename_ = templates/apache-custom-slave-list.cfg.in
md5sum = eadc3ee8927461fe9475e8b01667bbfe md5sum = e61477243ed7405b1d8b746287a8f03b
[profile-replicate-publish-slave-information] [profile-replicate-publish-slave-information]
_update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in _update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
'enable-http2-by-default', 'enable-http2-by-default',
'global-disable-http2', 'global-disable-http2',
'mpm-graceful-shutdown-timeout', 'mpm-graceful-shutdown-timeout',
'public-ipv4',
're6st-verification-url', 're6st-verification-url',
'backend-connect-timeout', 'backend-connect-timeout',
'backend-connect-retries', 'backend-connect-retries',
...@@ -271,7 +270,7 @@ config-monitor-username = ${monitor-instance-parameter:username} ...@@ -271,7 +270,7 @@ config-monitor-username = ${monitor-instance-parameter:username}
config-monitor-password = ${monitor-htpasswd:passwd} config-monitor-password = ${monitor-htpasswd:passwd}
software-type = {{frontend_type}} software-type = {{frontend_type}}
return = private-ipv4 public-ipv4 slave-instance-information-list monitor-base-url backend-client-csr_id-url csr_id-url csr_id-certificate backend-haproxy-statistic-url return = private-ipv4 slave-instance-information-list monitor-base-url backend-client-csr_id-url csr_id-url csr_id-certificate backend-haproxy-statistic-url
{#- Send only needed parameters to frontend nodes #} {#- Send only needed parameters to frontend nodes #}
{%- set base_node_configuration_dict = {} %} {%- set base_node_configuration_dict = {} %}
......
...@@ -50,11 +50,6 @@ ...@@ -50,11 +50,6 @@
"title": "Duration of the graceful shutdown period. Warning: Changing the parameter will result in restarting Caddy process.", "title": "Duration of the graceful shutdown period. Warning: Changing the parameter will result in restarting Caddy process.",
"type": "integer" "type": "integer"
}, },
"public-ipv4": {
"description": "Public ipv4 of the frontend (the one Caddy will be indirectly listening to).",
"title": "Public IPv4",
"type": "string"
},
"re6st-verification-url": { "re6st-verification-url": {
"description": "Url to verify if the internet and/or re6stnet is working.", "description": "Url to verify if the internet and/or re6stnet is working.",
"title": "Test Verification URL", "title": "Test Verification URL",
......
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
"description": "List of URLs to access logs", "description": "List of URLs to access logs",
"type": "array" "type": "array"
}, },
"public-ipv4": {
"description": "Public IPv4 to be included on DNS",
"type": "string"
},
"replication_number": { "replication_number": {
"description": "Number of nodes the slave is replicated", "description": "Number of nodes the slave is replicated",
"type": "integer" "type": "integer"
......
...@@ -78,7 +78,6 @@ cert = ${slap-connection:cert-file} ...@@ -78,7 +78,6 @@ cert = ${slap-connection:cert-file}
# All parameters are available through the configuration.XX syntax. # All parameters are available through the configuration.XX syntax.
# All possible parameters should have a default. # All possible parameters should have a default.
configuration.domain = example.org configuration.domain = example.org
configuration.public-ipv4 =
configuration.port = 4443 configuration.port = 4443
configuration.plain_http_port = 8080 configuration.plain_http_port = 8080
configuration.plain_nginx_port = 8081 configuration.plain_nginx_port = 8081
......
...@@ -178,7 +178,6 @@ context = ...@@ -178,7 +178,6 @@ context =
{%- set slave_log_access_url = urlparse_module.unquote(furled.tostr()) %} {%- set slave_log_access_url = urlparse_module.unquote(furled.tostr()) %}
{%- do slave_publish_dict.__setitem__('log-access', slave_log_access_url) %} {%- do slave_publish_dict.__setitem__('log-access', slave_log_access_url) %}
{%- do slave_publish_dict.__setitem__('slave-reference', slave_reference) %} {%- do slave_publish_dict.__setitem__('slave-reference', slave_reference) %}
{%- do slave_publish_dict.__setitem__('public-ipv4', configuration['public-ipv4']) %}
{%- do slave_publish_dict.__setitem__('backend-client-caucase-url', backend_client_caucase_url) %} {%- do slave_publish_dict.__setitem__('backend-client-caucase-url', backend_client_caucase_url) %}
{#- Set slave domain if none was defined #} {#- Set slave domain if none was defined #}
{%- if slave_instance.get('custom_domain', None) == None %} {%- if slave_instance.get('custom_domain', None) == None %}
...@@ -435,7 +434,6 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg ...@@ -435,7 +434,6 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
{#- Publish information for the instance #} {#- Publish information for the instance #}
[publish-caddy-information] [publish-caddy-information]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
public-ipv4 = {{ configuration['public-ipv4'] }}
private-ipv4 = {{ instance_parameter_dict['ipv4-random'] }} private-ipv4 = {{ instance_parameter_dict['ipv4-random'] }}
{%- if configuration['extra_slave_instance_list'] %} {%- if configuration['extra_slave_instance_list'] %}
{#- sort_keys are important in order to avoid shuffling parameters on each run #} {#- sort_keys are important in order to avoid shuffling parameters on each run #}
......
...@@ -84,6 +84,9 @@ KEDIFA_PORT = '15080' ...@@ -84,6 +84,9 @@ KEDIFA_PORT = '15080'
# has to be not partition one # has to be not partition one
SOURCE_IP = '127.0.0.1' SOURCE_IP = '127.0.0.1'
# IP on which test run, in order to mimic HTTP[s] access
TEST_IP = os.environ['SLAPOS_TEST_IPV4']
# "--resolve" inspired from https://stackoverflow.com/a/44378047/9256748 # "--resolve" inspired from https://stackoverflow.com/a/44378047/9256748
DNS_CACHE = {} DNS_CACHE = {}
...@@ -254,11 +257,11 @@ def subprocess_output(*args, **kwargs): ...@@ -254,11 +257,11 @@ def subprocess_output(*args, **kwargs):
return subprocess_status_output(*args, **kwargs)[1] return subprocess_status_output(*args, **kwargs)[1]
def isHTTP2(domain, ip): def isHTTP2(domain):
curl_command = 'curl --http2 -v -k -H "Host: %(domain)s" ' \ curl_command = 'curl --http2 -v -k -H "Host: %(domain)s" ' \
'https://%(domain)s:%(https_port)s/ '\ 'https://%(domain)s:%(https_port)s/ '\
'--resolve %(domain)s:%(https_port)s:%(ip)s' % dict( '--resolve %(domain)s:%(https_port)s:%(ip)s' % dict(
ip=ip, domain=domain, https_port=HTTPS_PORT) ip=TEST_IP, domain=domain, https_port=HTTPS_PORT)
prc = subprocess.Popen( prc = subprocess.Popen(
curl_command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE curl_command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE
) )
...@@ -395,7 +398,7 @@ class TestDataMixin(object): ...@@ -395,7 +398,7 @@ class TestDataMixin(object):
self.assertTestData(runtime_data, hash_value_dict=hash_value_dict) self.assertTestData(runtime_data, hash_value_dict=hash_value_dict)
def fakeHTTPSResult(domain, real_ip, path, port=HTTPS_PORT, def fakeHTTPSResult(domain, path, port=HTTPS_PORT,
headers=None, cookies=None, source_ip=SOURCE_IP): headers=None, cookies=None, source_ip=SOURCE_IP):
if headers is None: if headers is None:
headers = {} headers = {}
...@@ -414,7 +417,7 @@ def fakeHTTPSResult(domain, real_ip, path, port=HTTPS_PORT, ...@@ -414,7 +417,7 @@ def fakeHTTPSResult(domain, real_ip, path, port=HTTPS_PORT,
session.mount('https://', new_source) session.mount('https://', new_source)
socket_getaddrinfo = socket.getaddrinfo socket_getaddrinfo = socket.getaddrinfo
try: try:
add_custom_dns(domain, port, real_ip) add_custom_dns(domain, port, TEST_IP)
socket.getaddrinfo = new_getaddrinfo socket.getaddrinfo = new_getaddrinfo
return session.get( return session.get(
'https://%s:%s/%s' % (domain, port, path), 'https://%s:%s/%s' % (domain, port, path),
...@@ -427,7 +430,7 @@ def fakeHTTPSResult(domain, real_ip, path, port=HTTPS_PORT, ...@@ -427,7 +430,7 @@ def fakeHTTPSResult(domain, real_ip, path, port=HTTPS_PORT,
socket.getaddrinfo = socket_getaddrinfo socket.getaddrinfo = socket_getaddrinfo
def fakeHTTPResult(domain, real_ip, path, port=HTTP_PORT, def fakeHTTPResult(domain, path, port=HTTP_PORT,
headers=None, source_ip=SOURCE_IP): headers=None, source_ip=SOURCE_IP):
if headers is None: if headers is None:
headers = {} headers = {}
...@@ -445,7 +448,7 @@ def fakeHTTPResult(domain, real_ip, path, port=HTTP_PORT, ...@@ -445,7 +448,7 @@ def fakeHTTPResult(domain, real_ip, path, port=HTTP_PORT,
session.mount('http://', new_source) session.mount('http://', new_source)
session.mount('https://', new_source) session.mount('https://', new_source)
return session.get( return session.get(
'http://%s:%s/%s' % (real_ip, port, path), 'http://%s:%s/%s' % (TEST_IP, port, path),
headers=headers, headers=headers,
allow_redirects=False, allow_redirects=False,
) )
...@@ -921,7 +924,7 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase): ...@@ -921,7 +924,7 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase):
def waitForCaddy(cls): def waitForCaddy(cls):
def method(): def method():
fakeHTTPSResult( fakeHTTPSResult(
cls._ipv4_address, cls._ipv4_address, cls._ipv4_address,
'/', '/',
) )
cls.waitForMethod('waitForCaddy', method) cls.waitForMethod('waitForCaddy', method)
...@@ -1038,10 +1041,10 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase): ...@@ -1038,10 +1041,10 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase):
def waitForSlave(cls): def waitForSlave(cls):
def method(): def method():
for parameter_dict in cls.getSlaveConnectionParameterDictList(): for parameter_dict in cls.getSlaveConnectionParameterDictList():
if 'domain' in parameter_dict and 'public-ipv4' in parameter_dict: if 'domain' in parameter_dict:
try: try:
fakeHTTPSResult( fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], '/') parameter_dict['domain'], '/')
except requests.exceptions.InvalidURL: except requests.exceptions.InvalidURL:
# ignore slaves to which connection is impossible by default # ignore slaves to which connection is impossible by default
continue continue
...@@ -1117,7 +1120,6 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase): ...@@ -1117,7 +1120,6 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
...@@ -1192,7 +1194,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -1192,7 +1194,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'domain': 'example.com', 'domain': 'example.com',
'public-ipv4': cls._ipv4_address,
'port': HTTPS_PORT, 'port': HTTPS_PORT,
'plain_http_port': HTTP_PORT, 'plain_http_port': HTTP_PORT,
'kedifa_port': KEDIFA_PORT, 'kedifa_port': KEDIFA_PORT,
...@@ -1701,7 +1702,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -1701,7 +1702,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
def test_empty(self): def test_empty(self):
parameter_dict = self.assertSlaveBase('empty') parameter_dict = self.assertSlaveBase('empty')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
der2pem(result.peercert)) der2pem(result.peercert))
...@@ -1709,7 +1710,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -1709,7 +1710,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code) self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code)
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
httplib.FOUND, httplib.FOUND,
result_http.status_code result_http.status_code
...@@ -1722,7 +1723,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -1722,7 +1723,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
# check that 404 is as configured # check that 404 is as configured
result_missing = fakeHTTPSResult( result_missing = fakeHTTPSResult(
'forsuredoesnotexists.example.com', parameter_dict['public-ipv4'], '') 'forsuredoesnotexists.example.com', '')
self.assertEqual(httplib.NOT_FOUND, result_missing.status_code) self.assertEqual(httplib.NOT_FOUND, result_missing.status_code)
self.assertEqual( self.assertEqual(
"""<html> """<html>
...@@ -1806,7 +1807,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -1806,7 +1807,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'warning-list': [ 'warning-list': [
"slave url ' %s ' has been converted to '%s'" % ( "slave url ' %s ' has been converted to '%s'" % (
...@@ -1816,7 +1816,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -1816,7 +1816,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={ headers={
'Timeout': '10', # more than default backend-connect-timeout == 5 'Timeout': '10', # more than default backend-connect-timeout == 5
...@@ -1878,7 +1878,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -1878,7 +1878,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
log_regexp) log_regexp)
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -1956,7 +1956,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -1956,7 +1956,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
# 4. check that you can access this backend via frontend # 4. check that you can access this backend via frontend
# (so it means that auth to backend worked) # (so it means that auth to backend worked)
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={ headers={
'Timeout': '10', # more than default backend-connect-timeout == 5 'Timeout': '10', # more than default backend-connect-timeout == 5
...@@ -2045,7 +2045,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2045,7 +2045,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
# 4. check that you can access this backend via frontend # 4. check that you can access this backend via frontend
# (so it means that auth to backend worked) # (so it means that auth to backend worked)
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={ headers={
'Timeout': '10', # more than default backend-connect-timeout == 5 'Timeout': '10', # more than default backend-connect-timeout == 5
...@@ -2074,7 +2074,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2074,7 +2074,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('auth-to-backend-backend-ignore') parameter_dict = self.assertSlaveBase('auth-to-backend-backend-ignore')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={ headers={
'Timeout': '10', # more than default backend-connect-timeout == 5 'Timeout': '10', # more than default backend-connect-timeout == 5
...@@ -2103,7 +2103,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2103,7 +2103,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2130,7 +2130,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2130,7 +2130,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'warning-list': [ 'warning-list': [
"slave url ' %s ' has been converted to '%s'" % ( "slave url ' %s ' has been converted to '%s'" % (
...@@ -2140,7 +2139,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2140,7 +2139,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result_compressed = fakeHTTPSResult( result_compressed = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={ headers={
'Accept-Encoding': 'gzip', 'Accept-Encoding': 'gzip',
...@@ -2162,7 +2161,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2162,7 +2161,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result_not_compressed = fakeHTTPSResult( result_not_compressed = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={ headers={
'Accept-Encoding': 'gzip', 'Accept-Encoding': 'gzip',
...@@ -2183,7 +2182,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2183,7 +2182,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'warning-list': [ 'warning-list': [
"slave url ' %s ' has been converted to '%s'" % ( "slave url ' %s ' has been converted to '%s'" % (
...@@ -2192,7 +2190,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2192,7 +2190,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={ headers={
'Accept-Encoding': 'gzip', 'Accept-Encoding': 'gzip',
...@@ -2224,7 +2222,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2224,7 +2222,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://url.example.com', 'url': 'http://url.example.com',
'site_url': 'http://url.example.com', 'site_url': 'http://url.example.com',
'secure_access': 'https://url.example.com', 'secure_access': 'https://url.example.com',
'public-ipv4': self._ipv4_address,
}, },
parameter_dict parameter_dict
) )
...@@ -2248,7 +2245,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2248,7 +2245,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('type-zope-path') parameter_dict = self.assertSlaveBase('type-zope-path')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2268,7 +2265,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2268,7 +2265,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('type-zope-default-path') parameter_dict = self.assertSlaveBase('type-zope-default-path')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], '') parameter_dict['domain'], '')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -2290,7 +2287,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2290,7 +2287,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('server-alias') parameter_dict = self.assertSlaveBase('server-alias')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2300,7 +2297,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2300,7 +2297,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
result = fakeHTTPSResult( result = fakeHTTPSResult(
'alias1.example.com', parameter_dict['public-ipv4'], 'alias1.example.com',
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2310,7 +2307,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2310,7 +2307,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
result = fakeHTTPSResult( result = fakeHTTPSResult(
'alias2.example.com', parameter_dict['public-ipv4'], 'alias2.example.com',
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2321,7 +2318,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2321,7 +2318,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('server-alias-empty') parameter_dict = self.assertSlaveBase('server-alias-empty')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={ headers={
'Timeout': '10', # more than default backend-connect-timeout == 5 'Timeout': '10', # more than default backend-connect-timeout == 5
...@@ -2360,14 +2357,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2360,14 +2357,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://serveraliaswildcard.example.com', 'url': 'http://serveraliaswildcard.example.com',
'site_url': 'http://serveraliaswildcard.example.com', 'site_url': 'http://serveraliaswildcard.example.com',
'secure_access': 'https://serveraliaswildcard.example.com', 'secure_access': 'https://serveraliaswildcard.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -2376,7 +2372,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2376,7 +2372,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path') self.assertEqualResultJson(result, 'Path', '/test-path')
result = fakeHTTPSResult( result = fakeHTTPSResult(
'wild.alias1.example.com', parameter_dict['public-ipv4'], 'test-path') 'wild.alias1.example.com', 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -2395,14 +2391,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2395,14 +2391,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://serveraliasduplicated.example.com', 'url': 'http://serveraliasduplicated.example.com',
'site_url': 'http://serveraliasduplicated.example.com', 'site_url': 'http://serveraliasduplicated.example.com',
'secure_access': 'https://serveraliasduplicated.example.com', 'secure_access': 'https://serveraliasduplicated.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -2411,7 +2406,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2411,7 +2406,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path') self.assertEqualResultJson(result, 'Path', '/test-path')
result = fakeHTTPSResult( result = fakeHTTPSResult(
'alias3.example.com', parameter_dict['public-ipv4'], 'test-path') 'alias3.example.com', 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -2431,14 +2426,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2431,14 +2426,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://alias4.example.com', 'url': 'http://alias4.example.com',
'site_url': 'http://alias4.example.com', 'site_url': 'http://alias4.example.com',
'secure_access': 'https://alias4.example.com', 'secure_access': 'https://alias4.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -2464,7 +2458,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2464,7 +2458,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'site_url': 'http://customdomainsslcrtsslkeysslcacrt.example.com', 'site_url': 'http://customdomainsslcrtsslkeysslcacrt.example.com',
'secure_access': 'secure_access':
'https://customdomainsslcrtsslkeysslcacrt.example.com', 'https://customdomainsslcrtsslkeysslcacrt.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
...@@ -2488,7 +2481,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2488,7 +2481,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.runKedifaUpdater() self.runKedifaUpdater()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.customdomain_ca_certificate_pem, self.customdomain_ca_certificate_pem,
...@@ -2516,7 +2509,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2516,7 +2509,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'site_url': 'http://sslcacrtonly.example.com', 'site_url': 'http://sslcacrtonly.example.com',
'secure_access': 'secure_access':
'https://sslcacrtonly.example.com', 'https://sslcacrtonly.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
...@@ -2549,7 +2541,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2549,7 +2541,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'site_url': 'http://sslcacrtgarbage.example.com', 'site_url': 'http://sslcacrtgarbage.example.com',
'secure_access': 'secure_access':
'https://sslcacrtgarbage.example.com', 'https://sslcacrtgarbage.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
...@@ -2575,7 +2566,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2575,7 +2566,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.runKedifaUpdater() self.runKedifaUpdater()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
ca_certificate_pem, ca_certificate_pem,
...@@ -2604,7 +2595,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2604,7 +2595,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'site_url': 'http://sslcacrtdoesnotmatch.example.com', 'site_url': 'http://sslcacrtdoesnotmatch.example.com',
'secure_access': 'secure_access':
'https://sslcacrtdoesnotmatch.example.com', 'https://sslcacrtdoesnotmatch.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
...@@ -2626,7 +2616,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2626,7 +2616,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.runKedifaUpdater() self.runKedifaUpdater()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -2646,7 +2636,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2646,7 +2636,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('https-only') parameter_dict = self.assertSlaveBase('https-only')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2656,7 +2646,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2656,7 +2646,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqualResultJson(result_http, 'Path', '/test-path/deeper') self.assertEqualResultJson(result_http, 'Path', '/test-path/deeper')
...@@ -2674,14 +2664,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2674,14 +2664,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -2702,14 +2691,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2702,14 +2691,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -2718,7 +2706,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2718,7 +2706,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path') self.assertEqualResultJson(result, 'Path', '/test-path')
result = fakeHTTPSResult( result = fakeHTTPSResult(
'mycustomdomainserveralias1.example.com', parameter_dict['public-ipv4'], 'mycustomdomainserveralias1.example.com',
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2738,14 +2726,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2738,14 +2726,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://*.customdomain.example.com', 'url': 'http://*.customdomain.example.com',
'site_url': 'http://*.customdomain.example.com', 'site_url': 'http://*.customdomain.example.com',
'secure_access': 'https://*.customdomain.example.com', 'secure_access': 'https://*.customdomain.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
'wild.customdomain.example.com', parameter_dict['public-ipv4'], 'wild.customdomain.example.com',
'test-path') 'test-path')
self.assertEqual( self.assertEqual(
...@@ -2768,7 +2755,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2768,7 +2755,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
...@@ -2789,7 +2775,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2789,7 +2775,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.runKedifaUpdater() self.runKedifaUpdater()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.customdomain_certificate_pem, self.customdomain_certificate_pem,
...@@ -2801,7 +2787,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2801,7 +2787,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('type-zope') parameter_dict = self.assertSlaveBase('type-zope')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2822,7 +2808,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2822,7 +2808,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2841,7 +2827,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2841,7 +2827,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'type-zope-prefer-gzip-encoding-to-backend-https-only') 'type-zope-prefer-gzip-encoding-to-backend-https-only')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2863,7 +2849,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2863,7 +2849,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqualResultJson( self.assertEqualResultJson(
...@@ -2875,7 +2861,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2875,7 +2861,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'gzip, deflate'}) headers={'Accept-Encoding': 'gzip, deflate'})
...@@ -2900,7 +2886,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2900,7 +2886,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'gzip', result.json()['Incoming Headers']['accept-encoding']) 'gzip', result.json()['Incoming Headers']['accept-encoding'])
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'gzip, deflate'}) headers={'Accept-Encoding': 'gzip, deflate'})
...@@ -2919,7 +2905,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2919,7 +2905,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'type-zope-prefer-gzip-encoding-to-backend') 'type-zope-prefer-gzip-encoding-to-backend')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2941,7 +2927,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2941,7 +2927,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -2956,7 +2942,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2956,7 +2942,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'gzip, deflate'}) headers={'Accept-Encoding': 'gzip, deflate'})
...@@ -2981,7 +2967,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2981,7 +2967,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'gzip', result.json()['Incoming Headers']['accept-encoding']) 'gzip', result.json()['Incoming Headers']['accept-encoding'])
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'gzip, deflate'}) headers={'Accept-Encoding': 'gzip, deflate'})
...@@ -3001,7 +2987,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3001,7 +2987,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'type-zope-virtualhostroot-http-port') 'type-zope-virtualhostroot-http-port')
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqualResultJson( self.assertEqualResultJson(
result, result,
...@@ -3015,7 +3001,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3015,7 +3001,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'type-zope-virtualhostroot-https-port') 'type-zope-virtualhostroot-https-port')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -3041,14 +3027,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3041,14 +3027,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path', 'test-path',
HTTPS_PORT) HTTPS_PORT)
...@@ -3059,7 +3044,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3059,7 +3044,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path') self.assertEqualResultJson(result, 'Path', '/test-path')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test/terminals/websocket/test', 'test/terminals/websocket/test',
HTTPS_PORT) HTTPS_PORT)
...@@ -3069,14 +3054,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3069,14 +3054,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/terminals/websocket') self.assertEqualResultJson(result, 'Path', '/terminals/websocket')
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
def test_type_websocket(self): def test_type_websocket(self):
parameter_dict = self.assertSlaveBase( parameter_dict = self.assertSlaveBase(
'type-websocket') 'type-websocket')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
headers={'Connection': 'Upgrade'}) headers={'Connection': 'Upgrade'})
self.assertEqual( self.assertEqual(
...@@ -3099,14 +3084,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3099,14 +3084,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
self.assertTrue('x-real-ip' in j['Incoming Headers']) self.assertTrue('x-real-ip' in j['Incoming Headers'])
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
def test_type_websocket_websocket_transparent_false(self): def test_type_websocket_websocket_transparent_false(self):
parameter_dict = self.assertSlaveBase( parameter_dict = self.assertSlaveBase(
'type-websocket-websocket-transparent-false') 'type-websocket-websocket-transparent-false')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
headers={'Connection': 'Upgrade'}) headers={'Connection': 'Upgrade'})
self.assertEqual( self.assertEqual(
...@@ -3132,14 +3117,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3132,14 +3117,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
self.assertFalse('x-real-ip' in j['Incoming Headers']) self.assertFalse('x-real-ip' in j['Incoming Headers'])
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
def test_type_websocket_websocket_path_list(self): def test_type_websocket_websocket_path_list(self):
parameter_dict = self.assertSlaveBase( parameter_dict = self.assertSlaveBase(
'type-websocket-websocket-path-list') 'type-websocket-websocket-path-list')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
headers={'Connection': 'Upgrade'}) headers={'Connection': 'Upgrade'})
self.assertEqual( self.assertEqual(
...@@ -3152,7 +3137,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3152,7 +3137,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'/test-path' '/test-path'
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
try: try:
j = result.json() j = result.json()
except Exception: except Exception:
...@@ -3161,7 +3146,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3161,7 +3146,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertTrue('x-real-ip' in j['Incoming Headers']) self.assertTrue('x-real-ip' in j['Incoming Headers'])
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'ws/test-path', parameter_dict['domain'], 'ws/test-path',
headers={'Connection': 'Upgrade'}) headers={'Connection': 'Upgrade'})
self.assertEqualResultJson( self.assertEqualResultJson(
...@@ -3170,7 +3155,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3170,7 +3155,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'/ws/test-path' '/ws/test-path'
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
try: try:
j = result.json() j = result.json()
except Exception: except Exception:
...@@ -3183,7 +3168,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3183,7 +3168,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertTrue('x-real-ip' in j['Incoming Headers']) self.assertTrue('x-real-ip' in j['Incoming Headers'])
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'with%20space/test-path', headers={'Connection': 'Upgrade'}) 'with%20space/test-path', headers={'Connection': 'Upgrade'})
self.assertEqualResultJson( self.assertEqualResultJson(
...@@ -3192,7 +3177,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3192,7 +3177,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'/with%20space/test-path' '/with%20space/test-path'
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
try: try:
j = result.json() j = result.json()
except Exception: except Exception:
...@@ -3210,7 +3195,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3210,7 +3195,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'type-websocket-websocket-path-list-websocket-transparent-false') 'type-websocket-websocket-path-list-websocket-transparent-false')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
headers={'Connection': 'Upgrade'}) headers={'Connection': 'Upgrade'})
self.assertEqual( self.assertEqual(
...@@ -3223,7 +3208,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3223,7 +3208,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'/test-path' '/test-path'
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
try: try:
j = result.json() j = result.json()
except Exception: except Exception:
...@@ -3235,7 +3220,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3235,7 +3220,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertFalse('x-real-ip' in j['Incoming Headers']) self.assertFalse('x-real-ip' in j['Incoming Headers'])
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'ws/test-path', parameter_dict['domain'], 'ws/test-path',
headers={'Connection': 'Upgrade'}) headers={'Connection': 'Upgrade'})
self.assertEqualResultJson( self.assertEqualResultJson(
...@@ -3244,7 +3229,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3244,7 +3229,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'/ws/test-path' '/ws/test-path'
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
try: try:
j = result.json() j = result.json()
except Exception: except Exception:
...@@ -3259,7 +3244,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3259,7 +3244,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertFalse('x-real-ip' in j['Incoming Headers']) self.assertFalse('x-real-ip' in j['Incoming Headers'])
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'with%20space/test-path', headers={'Connection': 'Upgrade'}) 'with%20space/test-path', headers={'Connection': 'Upgrade'})
self.assertEqualResultJson( self.assertEqualResultJson(
...@@ -3268,7 +3253,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3268,7 +3253,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'/with%20space/test-path' '/with%20space/test-path'
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
try: try:
j = result.json() j = result.json()
except Exception: except Exception:
...@@ -3298,14 +3283,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3298,14 +3283,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://typeeventsource.nginx.example.com', 'url': 'http://typeeventsource.nginx.example.com',
'site_url': 'http://typeeventsource.nginx.example.com', 'site_url': 'http://typeeventsource.nginx.example.com',
'secure_access': 'https://typeeventsource.nginx.example.com', 'secure_access': 'https://typeeventsource.nginx.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'pub', parameter_dict['domain'], 'pub',
# NGINX_HTTPS_PORT # NGINX_HTTPS_PORT
) )
...@@ -3335,7 +3319,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3335,7 +3319,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('type-redirect') parameter_dict = self.assertSlaveBase('type-redirect')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -3365,14 +3349,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3365,14 +3349,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -3404,14 +3387,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3404,14 +3387,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'http://sslproxyverifysslproxycacrtunverified.example.com', 'http://sslproxyverifysslproxycacrtunverified.example.com',
'secure_access': 'secure_access':
'https://sslproxyverifysslproxycacrtunverified.example.com', 'https://sslproxyverifysslproxycacrtunverified.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -3423,7 +3405,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3423,7 +3405,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
httplib.FOUND, httplib.FOUND,
...@@ -3440,7 +3422,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3440,7 +3422,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('ssl-proxy-verify_ssl_proxy_ca_crt') parameter_dict = self.assertSlaveBase('ssl-proxy-verify_ssl_proxy_ca_crt')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -3462,7 +3444,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3462,7 +3444,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
httplib.FOUND, httplib.FOUND,
...@@ -3479,7 +3461,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3479,7 +3461,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('ssl-proxy-verify-unverified') parameter_dict = self.assertSlaveBase('ssl-proxy-verify-unverified')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -3507,14 +3489,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3507,14 +3489,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'http://enablecachesslproxyverifysslproxycacrtunverified.example.com', 'http://enablecachesslproxyverifysslproxycacrtunverified.example.com',
'secure_access': 'secure_access':
'https://enablecachesslproxyverifysslproxycacrtunverified.example.com', 'https://enablecachesslproxyverifysslproxycacrtunverified.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -3527,7 +3508,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3527,7 +3508,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deeper') 'test-path/deeper')
self.assertEqual( self.assertEqual(
...@@ -3546,7 +3527,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3546,7 +3527,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'enable_cache-ssl-proxy-verify_ssl_proxy_ca_crt') 'enable_cache-ssl-proxy-verify_ssl_proxy_ca_crt')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -3580,7 +3561,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3580,7 +3561,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'enable_cache-ssl-proxy-verify-unverified') 'enable_cache-ssl-proxy-verify-unverified')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -3607,14 +3588,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3607,14 +3588,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'http://typezopesslproxyverifysslproxycacrtunverified.example.com', 'http://typezopesslproxyverifysslproxycacrtunverified.example.com',
'secure_access': 'secure_access':
'https://typezopesslproxyverifysslproxycacrtunverified.example.com', 'https://typezopesslproxyverifysslproxycacrtunverified.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -3626,7 +3606,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3626,7 +3606,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
httplib.FOUND, httplib.FOUND,
...@@ -3644,7 +3624,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3644,7 +3624,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'type-zope-ssl-proxy-verify_ssl_proxy_ca_crt') 'type-zope-ssl-proxy-verify_ssl_proxy_ca_crt')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -3665,7 +3645,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3665,7 +3645,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
httplib.FOUND, httplib.FOUND,
...@@ -3683,7 +3663,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3683,7 +3663,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'type-zope-ssl-proxy-verify-unverified') 'type-zope-ssl-proxy-verify-unverified')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -3698,7 +3678,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3698,7 +3678,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('monitor-ipv6-test') parameter_dict = self.assertSlaveBase('monitor-ipv6-test')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -3707,7 +3687,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3707,7 +3687,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code) self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code)
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
httplib.FOUND, httplib.FOUND,
result_http.status_code result_http.status_code
...@@ -3735,7 +3715,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3735,7 +3715,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('monitor-ipv4-test') parameter_dict = self.assertSlaveBase('monitor-ipv4-test')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -3744,7 +3724,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3744,7 +3724,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code) self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code)
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
httplib.FOUND, httplib.FOUND,
result_http.status_code result_http.status_code
...@@ -3773,7 +3753,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3773,7 +3753,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('ciphers') parameter_dict = self.assertSlaveBase('ciphers')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -3782,7 +3762,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3782,7 +3762,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code) self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code)
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
httplib.FOUND, httplib.FOUND,
...@@ -3816,14 +3796,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3816,14 +3796,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', headers={ 'test-path/deep/.././deeper', headers={
'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-' 'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-'
'revalidate=3600, stale-if-error=3600'}) 'revalidate=3600, stale-if-error=3600'})
...@@ -3865,7 +3844,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3865,7 +3844,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('enable_cache_server_alias') parameter_dict = self.assertSlaveBase('enable_cache_server_alias')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', headers={ 'test-path/deep/.././deeper', headers={
'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-' 'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-'
'revalidate=3600, stale-if-error=3600'}) 'revalidate=3600, stale-if-error=3600'})
...@@ -3904,7 +3883,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3904,7 +3883,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result = fakeHTTPResult( result = fakeHTTPResult(
'enablecacheserveralias1.example.com', parameter_dict['public-ipv4'], 'enablecacheserveralias1.example.com',
'test-path/deep/.././deeper', headers={ 'test-path/deep/.././deeper', headers={
'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-' 'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-'
'revalidate=3600, stale-if-error=3600'}) 'revalidate=3600, stale-if-error=3600'})
...@@ -3924,7 +3903,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3924,7 +3903,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
source_ip = '127.0.0.1' source_ip = '127.0.0.1'
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', headers={ 'test-path/deep/.././deeper', headers={
'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-' 'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-'
'revalidate=3600, stale-if-error=3600', 'revalidate=3600, stale-if-error=3600',
...@@ -4073,7 +4052,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4073,7 +4052,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
def checkResult(status_code, body): def checkResult(status_code, body):
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], path, parameter_dict['domain'], path,
source_ip=source_ip source_ip=source_ip
) )
self.assertEqual(result.status_code, status_code) self.assertEqual(result.status_code, status_code)
...@@ -4118,7 +4097,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4118,7 +4097,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
source_ip = '127.0.0.1' source_ip = '127.0.0.1'
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', headers={ 'test-path/deep/.././deeper', headers={
'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-' 'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-'
'revalidate=3600, stale-if-error=3600', 'revalidate=3600, stale-if-error=3600',
...@@ -4169,7 +4148,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4169,7 +4148,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.stopServerProcess() self.stopServerProcess()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', headers={ 'test-path/deep/.././deeper', headers={
'X-Reply-Header-Cache-Control': 'max-age=1', 'X-Reply-Header-Cache-Control': 'max-age=1',
}, },
...@@ -4185,7 +4164,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4185,7 +4164,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
# check that timeout seen by ATS does not result in many queries done # check that timeout seen by ATS does not result in many queries done
# to the backend and that next request works like a charm # to the backend and that next request works like a charm
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test_enable_cache_ats_timeout', headers={ 'test_enable_cache_ats_timeout', headers={
'Timeout': '15', 'Timeout': '15',
'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-' 'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-'
...@@ -4252,7 +4231,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4252,7 +4231,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
# the result is available immediately after # the result is available immediately after
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', headers={ 'test-path/deep/.././deeper', headers={
'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-' 'X-Reply-Header-Cache-Control': 'max-age=1, stale-while-'
'revalidate=3600, stale-if-error=3600'}) 'revalidate=3600, stale-if-error=3600'})
...@@ -4264,7 +4243,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4264,7 +4243,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'enable_cache-disable-no-cache-request') 'enable_cache-disable-no-cache-request')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
headers={'Pragma': 'no-cache', 'Cache-Control': 'something'}) headers={'Pragma': 'no-cache', 'Cache-Control': 'something'})
self.assertEqual( self.assertEqual(
...@@ -4312,7 +4291,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4312,7 +4291,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('enable_cache-disable-via-header') parameter_dict = self.assertSlaveBase('enable_cache-disable-via-header')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -4353,7 +4332,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4353,7 +4332,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('enable-http2-false') parameter_dict = self.assertSlaveBase('enable-http2-false')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -4381,13 +4360,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4381,13 +4360,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
def test_enable_http2_default(self): def test_enable_http2_default(self):
parameter_dict = self.assertSlaveBase('enable-http2-default') parameter_dict = self.assertSlaveBase('enable-http2-default')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -4415,14 +4394,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4415,14 +4394,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
self.assertTrue( self.assertTrue(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
def test_prefer_gzip_encoding_to_backend_https_only(self): def test_prefer_gzip_encoding_to_backend_https_only(self):
parameter_dict = self.assertSlaveBase( parameter_dict = self.assertSlaveBase(
'prefer-gzip-encoding-to-backend-https-only') 'prefer-gzip-encoding-to-backend-https-only')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'gzip, deflate'}) headers={'Accept-Encoding': 'gzip, deflate'})
...@@ -4438,7 +4417,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4438,7 +4417,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'gzip', result.json()['Incoming Headers']['accept-encoding']) 'gzip', result.json()['Incoming Headers']['accept-encoding'])
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'deflate'}) headers={'Accept-Encoding': 'deflate'})
...@@ -4450,7 +4429,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4450,7 +4429,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'deflate', result.json()['Incoming Headers']['accept-encoding']) 'deflate', result.json()['Incoming Headers']['accept-encoding'])
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -4460,13 +4439,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4460,13 +4439,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'gzip, deflate'}) headers={'Accept-Encoding': 'gzip, deflate'})
...@@ -4479,7 +4458,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4479,7 +4458,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'gzip', result.json()['Incoming Headers']['accept-encoding']) 'gzip', result.json()['Incoming Headers']['accept-encoding'])
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'deflate'}) headers={'Accept-Encoding': 'deflate'})
...@@ -4492,13 +4471,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4492,13 +4471,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'deflate', result.json()['Incoming Headers']['accept-encoding']) 'deflate', result.json()['Incoming Headers']['accept-encoding'])
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
...@@ -4508,7 +4487,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4508,7 +4487,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'prefer-gzip-encoding-to-backend') 'prefer-gzip-encoding-to-backend')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'gzip, deflate'}) headers={'Accept-Encoding': 'gzip, deflate'})
...@@ -4524,7 +4503,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4524,7 +4503,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'gzip', result.json()['Incoming Headers']['accept-encoding']) 'gzip', result.json()['Incoming Headers']['accept-encoding'])
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'deflate'}) headers={'Accept-Encoding': 'deflate'})
...@@ -4536,7 +4515,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4536,7 +4515,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'deflate', result.json()['Incoming Headers']['accept-encoding']) 'deflate', result.json()['Incoming Headers']['accept-encoding'])
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -4546,13 +4525,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4546,13 +4525,13 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'gzip, deflate'}) headers={'Accept-Encoding': 'gzip, deflate'})
...@@ -4567,7 +4546,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4567,7 +4546,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={'Accept-Encoding': 'deflate'}) headers={'Accept-Encoding': 'deflate'})
...@@ -4582,7 +4561,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4582,7 +4561,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -4596,7 +4575,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4596,7 +4575,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
) )
result = fakeHTTPResult( result = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -4613,7 +4592,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4613,7 +4592,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('disabled-cookie-list') parameter_dict = self.assertSlaveBase('disabled-cookie-list')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
cookies=dict( cookies=dict(
Chocolate='absent', Chocolate='absent',
Vanilia='absent', Vanilia='absent',
...@@ -4635,7 +4614,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4635,7 +4614,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('url_https-url') parameter_dict = self.assertSlaveBase('url_https-url')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -4645,7 +4624,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4645,7 +4624,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/https/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/https/test-path/deeper')
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper') 'test-path/deep/.././deeper')
self.assertEqual( self.assertEqual(
...@@ -4675,7 +4654,6 @@ class TestReplicateSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4675,7 +4654,6 @@ class TestReplicateSlave(SlaveHttpFrontendTestCase, TestDataMixin):
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'domain': 'example.com', 'domain': 'example.com',
'public-ipv4': cls._ipv4_address,
'-frontend-quantity': 2, '-frontend-quantity': 2,
'-sla-2-computer_guid': cls.slap._computer_id, '-sla-2-computer_guid': cls.slap._computer_id,
'-frontend-2-state': 'stopped', '-frontend-2-state': 'stopped',
...@@ -4705,14 +4683,13 @@ class TestReplicateSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4705,14 +4683,13 @@ class TestReplicateSlave(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://replicate.example.com', 'url': 'http://replicate.example.com',
'site_url': 'http://replicate.example.com', 'site_url': 'http://replicate.example.com',
'secure_access': 'https://replicate.example.com', 'secure_access': 'https://replicate.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -4721,7 +4698,7 @@ class TestReplicateSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4721,7 +4698,7 @@ class TestReplicateSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path') self.assertEqualResultJson(result, 'Path', '/test-path')
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqualResultJson(result_http, 'Path', '/test-path') self.assertEqualResultJson(result_http, 'Path', '/test-path')
# prove 2nd frontend by inspection of the instance # prove 2nd frontend by inspection of the instance
...@@ -4743,7 +4720,6 @@ class TestReplicateSlaveOtherDestroyed(SlaveHttpFrontendTestCase): ...@@ -4743,7 +4720,6 @@ class TestReplicateSlaveOtherDestroyed(SlaveHttpFrontendTestCase):
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'domain': 'example.com', 'domain': 'example.com',
'public-ipv4': cls._ipv4_address,
'-frontend-quantity': 2, '-frontend-quantity': 2,
'-sla-2-computer_guid': cls.slap._computer_id, '-sla-2-computer_guid': cls.slap._computer_id,
'-frontend-2-state': 'destroyed', '-frontend-2-state': 'destroyed',
...@@ -4783,7 +4759,6 @@ class TestEnableHttp2ByDefaultFalseSlave(SlaveHttpFrontendTestCase, ...@@ -4783,7 +4759,6 @@ class TestEnableHttp2ByDefaultFalseSlave(SlaveHttpFrontendTestCase,
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'domain': 'example.com', 'domain': 'example.com',
'public-ipv4': cls._ipv4_address,
'enable-http2-by-default': 'false', 'enable-http2-by-default': 'false',
'port': HTTPS_PORT, 'port': HTTPS_PORT,
'plain_http_port': HTTP_PORT, 'plain_http_port': HTTP_PORT,
...@@ -4820,14 +4795,13 @@ class TestEnableHttp2ByDefaultFalseSlave(SlaveHttpFrontendTestCase, ...@@ -4820,14 +4795,13 @@ class TestEnableHttp2ByDefaultFalseSlave(SlaveHttpFrontendTestCase,
'site_url': 'http://enablehttp2default.example.com', 'site_url': 'http://enablehttp2default.example.com',
'secure_access': 'secure_access':
'https://enablehttp2default.example.com', 'https://enablehttp2default.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
def test_enable_http2_false(self): def test_enable_http2_false(self):
parameter_dict = self.parseSlaveParameterDict('enable-http2-false') parameter_dict = self.parseSlaveParameterDict('enable-http2-false')
...@@ -4841,14 +4815,13 @@ class TestEnableHttp2ByDefaultFalseSlave(SlaveHttpFrontendTestCase, ...@@ -4841,14 +4815,13 @@ class TestEnableHttp2ByDefaultFalseSlave(SlaveHttpFrontendTestCase,
'site_url': 'http://enablehttp2false.example.com', 'site_url': 'http://enablehttp2false.example.com',
'secure_access': 'secure_access':
'https://enablehttp2false.example.com', 'https://enablehttp2false.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
def test_enable_http2_true(self): def test_enable_http2_true(self):
parameter_dict = self.parseSlaveParameterDict('enable-http2-true') parameter_dict = self.parseSlaveParameterDict('enable-http2-true')
...@@ -4862,14 +4835,13 @@ class TestEnableHttp2ByDefaultFalseSlave(SlaveHttpFrontendTestCase, ...@@ -4862,14 +4835,13 @@ class TestEnableHttp2ByDefaultFalseSlave(SlaveHttpFrontendTestCase,
'site_url': 'http://enablehttp2true.example.com', 'site_url': 'http://enablehttp2true.example.com',
'secure_access': 'secure_access':
'https://enablehttp2true.example.com', 'https://enablehttp2true.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
self.assertTrue( self.assertTrue(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
class TestEnableHttp2ByDefaultDefaultSlave(SlaveHttpFrontendTestCase, class TestEnableHttp2ByDefaultDefaultSlave(SlaveHttpFrontendTestCase,
...@@ -4878,7 +4850,6 @@ class TestEnableHttp2ByDefaultDefaultSlave(SlaveHttpFrontendTestCase, ...@@ -4878,7 +4850,6 @@ class TestEnableHttp2ByDefaultDefaultSlave(SlaveHttpFrontendTestCase,
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'domain': 'example.com', 'domain': 'example.com',
'public-ipv4': cls._ipv4_address,
'port': HTTPS_PORT, 'port': HTTPS_PORT,
'plain_http_port': HTTP_PORT, 'plain_http_port': HTTP_PORT,
'kedifa_port': KEDIFA_PORT, 'kedifa_port': KEDIFA_PORT,
...@@ -4914,14 +4885,13 @@ class TestEnableHttp2ByDefaultDefaultSlave(SlaveHttpFrontendTestCase, ...@@ -4914,14 +4885,13 @@ class TestEnableHttp2ByDefaultDefaultSlave(SlaveHttpFrontendTestCase,
'site_url': 'http://enablehttp2default.example.com', 'site_url': 'http://enablehttp2default.example.com',
'secure_access': 'secure_access':
'https://enablehttp2default.example.com', 'https://enablehttp2default.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
self.assertTrue( self.assertTrue(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
def test_enable_http2_false(self): def test_enable_http2_false(self):
parameter_dict = self.parseSlaveParameterDict('enable-http2-false') parameter_dict = self.parseSlaveParameterDict('enable-http2-false')
...@@ -4935,14 +4905,13 @@ class TestEnableHttp2ByDefaultDefaultSlave(SlaveHttpFrontendTestCase, ...@@ -4935,14 +4905,13 @@ class TestEnableHttp2ByDefaultDefaultSlave(SlaveHttpFrontendTestCase,
'site_url': 'http://enablehttp2false.example.com', 'site_url': 'http://enablehttp2false.example.com',
'secure_access': 'secure_access':
'https://enablehttp2false.example.com', 'https://enablehttp2false.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
def test_enable_http2_true(self): def test_enable_http2_true(self):
parameter_dict = self.parseSlaveParameterDict('enable-http2-true') parameter_dict = self.parseSlaveParameterDict('enable-http2-true')
...@@ -4957,13 +4926,12 @@ class TestEnableHttp2ByDefaultDefaultSlave(SlaveHttpFrontendTestCase, ...@@ -4957,13 +4926,12 @@ class TestEnableHttp2ByDefaultDefaultSlave(SlaveHttpFrontendTestCase,
'site_url': 'http://enablehttp2true.example.com', 'site_url': 'http://enablehttp2true.example.com',
'secure_access': 'secure_access':
'https://enablehttp2true.example.com', 'https://enablehttp2true.example.com',
'public-ipv4': self._ipv4_address,
}, },
parameter_dict parameter_dict
) )
self.assertTrue( self.assertTrue(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
class TestRe6stVerificationUrlDefaultSlave(SlaveHttpFrontendTestCase, class TestRe6stVerificationUrlDefaultSlave(SlaveHttpFrontendTestCase,
...@@ -5002,7 +4970,6 @@ class TestRe6stVerificationUrlDefaultSlave(SlaveHttpFrontendTestCase, ...@@ -5002,7 +4970,6 @@ class TestRe6stVerificationUrlDefaultSlave(SlaveHttpFrontendTestCase,
'url': 'http://default.None', 'url': 'http://default.None',
'site_url': 'http://default.None', 'site_url': 'http://default.None',
'secure_access': 'https://default.None', 'secure_access': 'https://default.None',
'public-ipv4': 'None',
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
...@@ -5057,7 +5024,6 @@ class TestRe6stVerificationUrlSlave(SlaveHttpFrontendTestCase, ...@@ -5057,7 +5024,6 @@ class TestRe6stVerificationUrlSlave(SlaveHttpFrontendTestCase,
'url': 'http://default.None', 'url': 'http://default.None',
'site_url': 'http://default.None', 'site_url': 'http://default.None',
'secure_access': 'https://default.None', 'secure_access': 'https://default.None',
'public-ipv4': 'None',
}, },
parameter_dict parameter_dict
) )
...@@ -5115,7 +5081,7 @@ class TestDefaultMonitorHttpdPort(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -5115,7 +5081,7 @@ class TestDefaultMonitorHttpdPort(SlaveHttpFrontendTestCase, TestDataMixin):
'domain': 'test.None', 'replication_number': '1', 'domain': 'test.None', 'replication_number': '1',
'url': 'http://test.None', 'site_url': 'http://test.None', 'url': 'http://test.None', 'site_url': 'http://test.None',
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'secure_access': 'https://test.None', 'public-ipv4': 'None'}, 'secure_access': 'https://test.None'},
parameter_dict parameter_dict
) )
master_monitor_conf = open(os.path.join( master_monitor_conf = open(os.path.join(
...@@ -5151,14 +5117,13 @@ class TestSlaveGlobalDisableHttp2(TestSlave): ...@@ -5151,14 +5117,13 @@ class TestSlaveGlobalDisableHttp2(TestSlave):
'site_url': 'http://enablehttp2default.example.com', 'site_url': 'http://enablehttp2default.example.com',
'secure_access': 'secure_access':
'https://enablehttp2default.example.com', 'https://enablehttp2default.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -5186,7 +5151,7 @@ class TestSlaveGlobalDisableHttp2(TestSlave): ...@@ -5186,7 +5151,7 @@ class TestSlaveGlobalDisableHttp2(TestSlave):
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
class TestEnableHttp2ByDefaultFalseSlaveGlobalDisableHttp2( class TestEnableHttp2ByDefaultFalseSlaveGlobalDisableHttp2(
...@@ -5211,14 +5176,13 @@ class TestEnableHttp2ByDefaultFalseSlaveGlobalDisableHttp2( ...@@ -5211,14 +5176,13 @@ class TestEnableHttp2ByDefaultFalseSlaveGlobalDisableHttp2(
'site_url': 'http://enablehttp2true.example.com', 'site_url': 'http://enablehttp2true.example.com',
'secure_access': 'secure_access':
'https://enablehttp2true.example.com', 'https://enablehttp2true.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
class TestEnableHttp2ByDefaultDefaultSlaveGlobalDisableHttp2( class TestEnableHttp2ByDefaultDefaultSlaveGlobalDisableHttp2(
...@@ -5243,14 +5207,13 @@ class TestEnableHttp2ByDefaultDefaultSlaveGlobalDisableHttp2( ...@@ -5243,14 +5207,13 @@ class TestEnableHttp2ByDefaultDefaultSlaveGlobalDisableHttp2(
'site_url': 'http://enablehttp2true.example.com', 'site_url': 'http://enablehttp2true.example.com',
'secure_access': 'secure_access':
'https://enablehttp2true.example.com', 'https://enablehttp2true.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
def test_enable_http2_default(self): def test_enable_http2_default(self):
parameter_dict = self.parseSlaveParameterDict('enable-http2-default') parameter_dict = self.parseSlaveParameterDict('enable-http2-default')
...@@ -5264,14 +5227,13 @@ class TestEnableHttp2ByDefaultDefaultSlaveGlobalDisableHttp2( ...@@ -5264,14 +5227,13 @@ class TestEnableHttp2ByDefaultDefaultSlaveGlobalDisableHttp2(
'site_url': 'http://enablehttp2default.example.com', 'site_url': 'http://enablehttp2default.example.com',
'secure_access': 'secure_access':
'https://enablehttp2default.example.com', 'https://enablehttp2default.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
self.assertFalse( self.assertFalse(
isHTTP2(parameter_dict['domain'], parameter_dict['public-ipv4'])) isHTTP2(parameter_dict['domain']))
class TestSlaveSlapOSMasterCertificateCompatibilityOverrideMaster( class TestSlaveSlapOSMasterCertificateCompatibilityOverrideMaster(
...@@ -5294,7 +5256,6 @@ class TestSlaveSlapOSMasterCertificateCompatibilityOverrideMaster( ...@@ -5294,7 +5256,6 @@ class TestSlaveSlapOSMasterCertificateCompatibilityOverrideMaster(
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'domain': 'example.com', 'domain': 'example.com',
'public-ipv4': cls._ipv4_address,
'apache-certificate': cls.certificate_pem, 'apache-certificate': cls.certificate_pem,
'apache-key': cls.key_pem, 'apache-key': cls.key_pem,
'port': HTTPS_PORT, 'port': HTTPS_PORT,
...@@ -5326,14 +5287,13 @@ class TestSlaveSlapOSMasterCertificateCompatibilityOverrideMaster( ...@@ -5326,14 +5287,13 @@ class TestSlaveSlapOSMasterCertificateCompatibilityOverrideMaster(
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -5356,7 +5316,7 @@ class TestSlaveSlapOSMasterCertificateCompatibilityOverrideMaster( ...@@ -5356,7 +5316,7 @@ class TestSlaveSlapOSMasterCertificateCompatibilityOverrideMaster(
self.runKedifaUpdater() self.runKedifaUpdater()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
certificate_pem, certificate_pem,
...@@ -5433,7 +5393,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5433,7 +5393,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'domain': 'example.com', 'domain': 'example.com',
'public-ipv4': cls._ipv4_address,
'apache-certificate': cls.certificate_pem, 'apache-certificate': cls.certificate_pem,
'apache-key': cls.key_pem, 'apache-key': cls.key_pem,
'port': HTTPS_PORT, 'port': HTTPS_PORT,
...@@ -5599,14 +5558,13 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5599,14 +5558,13 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -5627,14 +5585,13 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5627,14 +5585,13 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -5661,7 +5618,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5661,7 +5618,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
self.runKedifaUpdater() self.runKedifaUpdater()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
certificate_pem, certificate_pem,
...@@ -5683,7 +5640,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5683,7 +5640,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'warning-list': [ 'warning-list': [
'ssl_crt is obsolete, please use key-upload-url', 'ssl_crt is obsolete, please use key-upload-url',
...@@ -5694,7 +5650,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5694,7 +5650,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.ssl_from_slave_certificate_pem, self.ssl_from_slave_certificate_pem,
...@@ -5716,7 +5672,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5716,7 +5672,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'warning-list': [ 'warning-list': [
'ssl_crt is obsolete, please use key-upload-url', 'ssl_crt is obsolete, please use key-upload-url',
...@@ -5727,7 +5682,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5727,7 +5682,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.ssl_from_slave_kedifa_overrides_certificate_pem, self.ssl_from_slave_kedifa_overrides_certificate_pem,
...@@ -5755,7 +5710,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5755,7 +5710,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
self.runKedifaUpdater() self.runKedifaUpdater()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
certificate_pem, certificate_pem,
...@@ -5776,14 +5731,13 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5776,14 +5731,13 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
HTTPS_PORT) HTTPS_PORT)
self.assertEqual( self.assertEqual(
...@@ -5805,14 +5759,13 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5805,14 +5759,13 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
HTTPS_PORT) HTTPS_PORT)
self.assertEqual( self.assertEqual(
...@@ -5841,7 +5794,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5841,7 +5794,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
self.runKedifaUpdater() self.runKedifaUpdater()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
HTTPS_PORT) HTTPS_PORT)
self.assertEqual( self.assertEqual(
...@@ -5863,7 +5816,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5863,7 +5816,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'warning-list': [ 'warning-list': [
'ssl_crt is obsolete, please use key-upload-url', 'ssl_crt is obsolete, please use key-upload-url',
...@@ -5874,7 +5826,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5874,7 +5826,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
HTTPS_PORT) HTTPS_PORT)
self.assertEqual( self.assertEqual(
...@@ -5896,7 +5848,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5896,7 +5848,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'warning-list': [ 'warning-list': [
'ssl_crt is obsolete, please use key-upload-url', 'ssl_crt is obsolete, please use key-upload-url',
...@@ -5907,7 +5858,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5907,7 +5858,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
HTTPS_PORT) HTTPS_PORT)
self.assertEqual( self.assertEqual(
...@@ -5936,7 +5887,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5936,7 +5887,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
self.runKedifaUpdater() self.runKedifaUpdater()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path', parameter_dict['domain'], 'test-path',
HTTPS_PORT) HTTPS_PORT)
self.assertEqual( self.assertEqual(
...@@ -5960,7 +5911,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5960,7 +5911,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'warning-list': ['ssl_key is obsolete, please use key-upload-url', 'warning-list': ['ssl_key is obsolete, please use key-upload-url',
'ssl_crt is obsolete, please use key-upload-url'] 'ssl_crt is obsolete, please use key-upload-url']
...@@ -5969,7 +5919,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5969,7 +5919,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.customdomain_certificate_pem, self.customdomain_certificate_pem,
...@@ -5990,7 +5940,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -5990,7 +5940,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'site_url': 'http://customdomainsslcrtsslkeysslcacrt.example.com', 'site_url': 'http://customdomainsslcrtsslkeysslcacrt.example.com',
'secure_access': 'secure_access':
'https://customdomainsslcrtsslkeysslcacrt.example.com', 'https://customdomainsslcrtsslkeysslcacrt.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'warning-list': [ 'warning-list': [
'ssl_ca_crt is obsolete, please use key-upload-url', 'ssl_ca_crt is obsolete, please use key-upload-url',
...@@ -6002,7 +5951,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -6002,7 +5951,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.customdomain_ca_certificate_pem, self.customdomain_ca_certificate_pem,
...@@ -6046,7 +5995,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -6046,7 +5995,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
self.slap.waitForInstance() self.slap.waitForInstance()
self.runKedifaUpdater() self.runKedifaUpdater()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
customdomain_ca_certificate_pem, customdomain_ca_certificate_pem,
...@@ -6079,7 +6028,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -6079,7 +6028,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'site_url': 'http://sslcacrtgarbage.example.com', 'site_url': 'http://sslcacrtgarbage.example.com',
'secure_access': 'secure_access':
'https://sslcacrtgarbage.example.com', 'https://sslcacrtgarbage.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'warning-list': [ 'warning-list': [
'ssl_ca_crt is obsolete, please use key-upload-url', 'ssl_ca_crt is obsolete, please use key-upload-url',
...@@ -6090,7 +6038,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -6090,7 +6038,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.sslcacrtgarbage_ca_certificate_pem, self.sslcacrtgarbage_ca_certificate_pem,
...@@ -6111,7 +6059,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -6111,7 +6059,6 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
'site_url': 'http://sslcacrtdoesnotmatch.example.com', 'site_url': 'http://sslcacrtdoesnotmatch.example.com',
'secure_access': 'secure_access':
'https://sslcacrtdoesnotmatch.example.com', 'https://sslcacrtdoesnotmatch.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
'warning-list': [ 'warning-list': [
'ssl_ca_crt is obsolete, please use key-upload-url', 'ssl_ca_crt is obsolete, please use key-upload-url',
...@@ -6123,7 +6070,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility( ...@@ -6123,7 +6070,7 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -6175,7 +6122,6 @@ class TestSlaveSlapOSMasterCertificateCompatibilityUpdate( ...@@ -6175,7 +6122,6 @@ class TestSlaveSlapOSMasterCertificateCompatibilityUpdate(
'apache-certificate': cls.certificate_pem, 'apache-certificate': cls.certificate_pem,
'apache-key': cls.key_pem, 'apache-key': cls.key_pem,
}) })
cls.instance_parameter_dict['public-ipv4'] = cls._ipv4_address
return cls.instance_parameter_dict return cls.instance_parameter_dict
@classmethod @classmethod
...@@ -6225,14 +6171,13 @@ class TestSlaveSlapOSMasterCertificateCompatibilityUpdate( ...@@ -6225,14 +6171,13 @@ class TestSlaveSlapOSMasterCertificateCompatibilityUpdate(
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -6257,7 +6202,7 @@ class TestSlaveSlapOSMasterCertificateCompatibilityUpdate( ...@@ -6257,7 +6202,7 @@ class TestSlaveSlapOSMasterCertificateCompatibilityUpdate(
self.runKedifaUpdater() self.runKedifaUpdater()
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
certificate_pem, certificate_pem,
...@@ -6271,7 +6216,6 @@ class TestSlaveCiphers(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -6271,7 +6216,6 @@ class TestSlaveCiphers(SlaveHttpFrontendTestCase, TestDataMixin):
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'domain': 'example.com', 'domain': 'example.com',
'public-ipv4': cls._ipv4_address,
'port': HTTPS_PORT, 'port': HTTPS_PORT,
'plain_http_port': HTTP_PORT, 'plain_http_port': HTTP_PORT,
'kedifa_port': KEDIFA_PORT, 'kedifa_port': KEDIFA_PORT,
...@@ -6320,7 +6264,7 @@ class TestSlaveCiphers(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -6320,7 +6264,7 @@ class TestSlaveCiphers(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('default_ciphers') parameter_dict = self.assertSlaveBase('default_ciphers')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -6329,7 +6273,7 @@ class TestSlaveCiphers(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -6329,7 +6273,7 @@ class TestSlaveCiphers(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqual(httplib.OK, result.status_code) self.assertEqual(httplib.OK, result.status_code)
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual(httplib.FOUND, result_http.status_code) self.assertEqual(httplib.FOUND, result_http.status_code)
configuration_file = glob.glob( configuration_file = glob.glob(
...@@ -6346,7 +6290,7 @@ class TestSlaveCiphers(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -6346,7 +6290,7 @@ class TestSlaveCiphers(SlaveHttpFrontendTestCase, TestDataMixin):
parameter_dict = self.assertSlaveBase('own_ciphers') parameter_dict = self.assertSlaveBase('own_ciphers')
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -6355,7 +6299,7 @@ class TestSlaveCiphers(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -6355,7 +6299,7 @@ class TestSlaveCiphers(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqual(httplib.OK, result.status_code) self.assertEqual(httplib.OK, result.status_code)
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual(httplib.FOUND, result_http.status_code) self.assertEqual(httplib.FOUND, result_http.status_code)
configuration_file = glob.glob( configuration_file = glob.glob(
...@@ -6379,7 +6323,6 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase): ...@@ -6379,7 +6323,6 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase):
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'domain': 'example.com', 'domain': 'example.com',
'public-ipv4': cls._ipv4_address,
'port': HTTPS_PORT, 'port': HTTPS_PORT,
'plain_http_port': HTTP_PORT, 'plain_http_port': HTTP_PORT,
'kedifa_port': KEDIFA_PORT, 'kedifa_port': KEDIFA_PORT,
...@@ -6663,14 +6606,13 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase): ...@@ -6663,14 +6606,13 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase):
'url': 'http://serveraliassame.example.com', 'url': 'http://serveraliassame.example.com',
'site_url': 'http://serveraliassame.example.com', 'site_url': 'http://serveraliassame.example.com',
'secure_access': 'https://serveraliassame.example.com', 'secure_access': 'https://serveraliassame.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -6747,14 +6689,13 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase): ...@@ -6747,14 +6689,13 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase):
'url': 'http://defaultpathunsafe.example.com', 'url': 'http://defaultpathunsafe.example.com',
'site_url': 'http://defaultpathunsafe.example.com', 'site_url': 'http://defaultpathunsafe.example.com',
'secure_access': 'https://defaultpathunsafe.example.com', 'secure_access': 'https://defaultpathunsafe.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], '') parameter_dict['domain'], '')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -6782,14 +6723,13 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase): ...@@ -6782,14 +6723,13 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase):
'url': 'http://monitoripv4testunsafe.example.com', 'url': 'http://monitoripv4testunsafe.example.com',
'site_url': 'http://monitoripv4testunsafe.example.com', 'site_url': 'http://monitoripv4testunsafe.example.com',
'secure_access': 'https://monitoripv4testunsafe.example.com', 'secure_access': 'https://monitoripv4testunsafe.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -6798,7 +6738,7 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase): ...@@ -6798,7 +6738,7 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase):
self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code) self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code)
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual(httplib.FOUND, result_http.status_code) self.assertEqual(httplib.FOUND, result_http.status_code)
monitor_file = glob.glob( monitor_file = glob.glob(
...@@ -6827,14 +6767,13 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase): ...@@ -6827,14 +6767,13 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase):
'url': 'http://monitoripv6testunsafe.example.com', 'url': 'http://monitoripv6testunsafe.example.com',
'site_url': 'http://monitoripv6testunsafe.example.com', 'site_url': 'http://monitoripv6testunsafe.example.com',
'secure_access': 'https://monitoripv6testunsafe.example.com', 'secure_access': 'https://monitoripv6testunsafe.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual( self.assertEqual(
self.certificate_pem, self.certificate_pem,
...@@ -6843,7 +6782,7 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase): ...@@ -6843,7 +6782,7 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase):
self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code) self.assertEqual(httplib.SERVICE_UNAVAILABLE, result.status_code)
result_http = fakeHTTPResult( result_http = fakeHTTPResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], 'test-path')
self.assertEqual(httplib.FOUND, result_http.status_code) self.assertEqual(httplib.FOUND, result_http.status_code)
monitor_file = glob.glob( monitor_file = glob.glob(
...@@ -6870,7 +6809,6 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase): ...@@ -6870,7 +6809,6 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase):
'url': 'http://duplicate.example.com', 'url': 'http://duplicate.example.com',
'site_url': 'http://duplicate.example.com', 'site_url': 'http://duplicate.example.com',
'secure_access': 'https://duplicate.example.com', 'secure_access': 'https://duplicate.example.com',
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict parameter_dict
...@@ -6957,7 +6895,6 @@ class TestSlaveHostHaproxyClash(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -6957,7 +6895,6 @@ class TestSlaveHostHaproxyClash(SlaveHttpFrontendTestCase, TestDataMixin):
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'domain': 'example.com', 'domain': 'example.com',
'public-ipv4': cls._ipv4_address,
'port': HTTPS_PORT, 'port': HTTPS_PORT,
'plain_http_port': HTTP_PORT, 'plain_http_port': HTTP_PORT,
'kedifa_port': KEDIFA_PORT, 'kedifa_port': KEDIFA_PORT,
...@@ -6996,7 +6933,6 @@ class TestSlaveHostHaproxyClash(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -6996,7 +6933,6 @@ class TestSlaveHostHaproxyClash(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict_wildcard parameter_dict_wildcard
...@@ -7012,14 +6948,13 @@ class TestSlaveHostHaproxyClash(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -7012,14 +6948,13 @@ class TestSlaveHostHaproxyClash(SlaveHttpFrontendTestCase, TestDataMixin):
'url': 'http://%s.example.com' % (hostname, ), 'url': 'http://%s.example.com' % (hostname, ),
'site_url': 'http://%s.example.com' % (hostname, ), 'site_url': 'http://%s.example.com' % (hostname, ),
'secure_access': 'https://%s.example.com' % (hostname, ), 'secure_access': 'https://%s.example.com' % (hostname, ),
'public-ipv4': self._ipv4_address,
'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address, 'backend-client-caucase-url': 'http://[%s]:8990' % self._ipv6_address,
}, },
parameter_dict_specific parameter_dict_specific
) )
result_wildcard = fakeHTTPSResult( result_wildcard = fakeHTTPSResult(
'other.alias1.example.com', parameter_dict_wildcard['public-ipv4'], 'other.alias1.example.com',
'test-path', 'test-path',
headers={ headers={
'Timeout': '10', # more than default backend-connect-timeout == 5 'Timeout': '10', # more than default backend-connect-timeout == 5
...@@ -7030,7 +6965,7 @@ class TestSlaveHostHaproxyClash(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -7030,7 +6965,7 @@ class TestSlaveHostHaproxyClash(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result_wildcard, 'Path', '/wildcard/test-path') self.assertEqualResultJson(result_wildcard, 'Path', '/wildcard/test-path')
result_specific = fakeHTTPSResult( result_specific = fakeHTTPSResult(
'zspecific.alias1.example.com', parameter_dict_specific['public-ipv4'], 'zspecific.alias1.example.com',
'test-path', 'test-path',
headers={ headers={
'Timeout': '10', # more than default backend-connect-timeout == 5 'Timeout': '10', # more than default backend-connect-timeout == 5
...@@ -7095,7 +7030,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase): ...@@ -7095,7 +7030,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
'enable-http2-by-default': True, 'enable-http2-by-default': True,
'global-disable-http2': True, 'global-disable-http2': True,
'mpm-graceful-shutdown-timeout': 2, 'mpm-graceful-shutdown-timeout': 2,
'public-ipv4': '255.255.255.255',
're6st-verification-url': 're6st-verification-url', 're6st-verification-url': 're6st-verification-url',
'backend-connect-timeout': 2, 'backend-connect-timeout': 2,
'backend-connect-retries': 1, 'backend-connect-retries': 1,
...@@ -7196,7 +7130,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase): ...@@ -7196,7 +7130,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
u'mpm-graceful-shutdown-timeout': u'2', u'mpm-graceful-shutdown-timeout': u'2',
u'plain_http_port': '11080', u'plain_http_port': '11080',
u'port': '11443', u'port': '11443',
u'public-ipv4': u'255.255.255.255',
u'ram-cache-size': u'512K', u'ram-cache-size': u'512K',
u're6st-verification-url': u're6st-verification-url', u're6st-verification-url': u're6st-verification-url',
u'request-timeout': u'100', u'request-timeout': u'100',
...@@ -7224,7 +7157,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase): ...@@ -7224,7 +7157,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
u'mpm-graceful-shutdown-timeout': u'2', u'mpm-graceful-shutdown-timeout': u'2',
u'plain_http_port': u'11080', u'plain_http_port': u'11080',
u'port': u'11443', u'port': u'11443',
u'public-ipv4': u'255.255.255.255',
u'ram-cache-size': u'256K', u'ram-cache-size': u'256K',
u're6st-verification-url': u're6st-verification-url', u're6st-verification-url': u're6st-verification-url',
u'request-timeout': u'100', u'request-timeout': u'100',
...@@ -7252,7 +7184,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase): ...@@ -7252,7 +7184,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
u'mpm-graceful-shutdown-timeout': u'2', u'mpm-graceful-shutdown-timeout': u'2',
u'plain_http_port': u'11080', u'plain_http_port': u'11080',
u'port': u'11443', u'port': u'11443',
u'public-ipv4': u'255.255.255.255',
u're6st-verification-url': u're6st-verification-url', u're6st-verification-url': u're6st-verification-url',
u'request-timeout': u'100', u'request-timeout': u'100',
u'slave-kedifa-information': u'{}' u'slave-kedifa-information': u'{}'
...@@ -7297,7 +7228,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase): ...@@ -7297,7 +7228,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
'mpm-graceful-shutdown-timeout': '2', 'mpm-graceful-shutdown-timeout': '2',
'plain_http_port': '11080', 'plain_http_port': '11080',
'port': '11443', 'port': '11443',
'public-ipv4': '255.255.255.255',
're6st-verification-url': 're6st-verification-url', 're6st-verification-url': 're6st-verification-url',
'request-timeout': '100', 'request-timeout': '100',
'root_instance_title': 'testing partition 0', 'root_instance_title': 'testing partition 0',
...@@ -7316,7 +7246,6 @@ class TestSlaveBackendActiveCheck(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -7316,7 +7246,6 @@ class TestSlaveBackendActiveCheck(SlaveHttpFrontendTestCase, TestDataMixin):
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'domain': 'example.com', 'domain': 'example.com',
'public-ipv4': cls._ipv4_address,
'port': HTTPS_PORT, 'port': HTTPS_PORT,
'plain_http_port': HTTP_PORT, 'plain_http_port': HTTP_PORT,
'kedifa_port': KEDIFA_PORT, 'kedifa_port': KEDIFA_PORT,
...@@ -7405,7 +7334,7 @@ backend _backend-active-check-default-http ...@@ -7405,7 +7334,7 @@ backend _backend-active-check-default-http
self._get_backend_haproxy_configuration() self._get_backend_haproxy_configuration()
) )
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], parameter_dict['domain'],
'test-path/deep/.././deeper', 'test-path/deep/.././deeper',
headers={ headers={
'Timeout': '10', # more than default backend-connect-timeout == 5 'Timeout': '10', # more than default backend-connect-timeout == 5
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment