Fixed unit tests

This commit is contained in:
nghazalibeiklar 2022-01-17 12:38:23 +11:00
parent 1c882c2745
commit c1f5a896b1
No known key found for this signature in database
GPG Key ID: 900C605B850D1965
2 changed files with 4 additions and 4 deletions

View File

@ -42,7 +42,7 @@
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve"
threshold="60"/>
{% if ((atl_tomcat_access_log == 'true') or
(atl_tomcat_access_log is none and (confluence_version.split('.') | map('int') | list) >= ('7.11.0'.split('.') | map('int') | list)) ) %}
(confluence_version.split('.') | map('int') | list) >= ('7.11.0'.split('.') | map('int') | list)) %}
<Valve className="org.apache.catalina.valves.AccessLogValve"
requestAttributesEnabled="true"
directory="logs"

View File

@ -179,7 +179,7 @@ def test_server_xml_access_log_default_4_confluence_before_7_11(docker_cli, imag
environment = {
#'ATL_TOMCAT_ACCESS_LOG': Not defined,
'ATL_TOMCAT_PROXY_INTERNAL_IPS': '192.168.1.1',
'CONFLUENCE_VERSION': "7.10.0"
'CONFLUENCE_VERSION': "7.10.0",
}
container = run_image(docker_cli, image, environment=environment)
@ -193,7 +193,7 @@ def test_server_xml_access_log_default_4_confluence_after_7_11(docker_cli, image
environment = {
#'ATL_TOMCAT_ACCESS_LOG': Not defined,
'ATL_TOMCAT_PROXY_INTERNAL_IPS': '192.168.1.1',
'CONFLUENCE_VERSION': "7.12.0"
'CONFLUENCE_VERSION': '7.12.0',
}
container = run_image(docker_cli, image, environment=environment)
@ -201,13 +201,13 @@ def test_server_xml_access_log_default_4_confluence_after_7_11(docker_cli, image
xml = parse_xml(container, f'{get_app_install_dir(container)}/conf/server.xml')
value = xml.find('.//Context/Valve[@className="org.apache.catalina.valves.RemoteIpValve"]')
assert '7.12.0' == environment.get('ATL_TOMCAT_PROXY_INTERNAL_IPS')
assert value.get('internalProxies') == environment.get('ATL_TOMCAT_PROXY_INTERNAL_IPS')
def test_server_xml_access_log_disabled(docker_cli, image):
environment = {
'ATL_TOMCAT_ACCESS_LOG': 'false',
'ATL_TOMCAT_PROXY_INTERNAL_IPS': '192.168.1.1',
'CONFLUENCE_VERSION': "7.11.1"
}
container = run_image(docker_cli, image, environment=environment)