From 60b47ce49cb473d8c4ca1b215a5547ec4717df1f Mon Sep 17 00:00:00 2001 From: Adam Brokes Date: Mon, 4 Apr 2022 16:10:13 +1000 Subject: [PATCH 1/2] add snapshot properites --- config/confluence.cfg.xml.j2 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config/confluence.cfg.xml.j2 b/config/confluence.cfg.xml.j2 index 0173fde..8f31e32 100644 --- a/config/confluence.cfg.xml.j2 +++ b/config/confluence.cfg.xml.j2 @@ -2,9 +2,9 @@ - setupstart - custom - 0 + {{ atl_setup_step | default('setupstart') }} + {{ atl_setup_type | default('custom') }} + {{ atl_build_number | default('0') }} database-type-standard @@ -76,5 +76,9 @@ /{{ atl_tomcat_contextpath }} {% endif %} + {% if atl_snapshot_used is defined %} + true + {% endif %} + From cba1a9f2232b25e06e4f27cdced79159a90acd38 Mon Sep 17 00:00:00 2001 From: Adam Brokes Date: Wed, 6 Apr 2022 17:19:24 +1000 Subject: [PATCH 2/2] Add test --- tests/test_image.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_image.py b/tests/test_image.py index 5e3d838..1b8a784 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -426,3 +426,20 @@ def test_jvm_fallback_fonts(docker_cli, image): assert font.exists assert font.is_symlink + +def test_confluence_xml_snapshot_properties(docker_cli, image, run_user): + environment = { + 'ATL_SETUP_STEP': 'complete', + 'ATL_SETUP_TYPE': 'clustersetup', + 'ATL_BUILD_NUMBER': '8703', + 'ATL_SNAPSHOT_USED': 'true', + } + container = run_image(docker_cli, image, user=run_user, environment=environment) + _jvm = wait_for_proc(container, get_bootstrap_proc(container)) + + xml = parse_xml(container, f'{get_app_home(container)}/confluence.cfg.xml') + + assert xml.findall('.//setupStep')[0].text == "complete" + assert xml.findall('.//setupType')[0].text == "clustersetup" + assert xml.findall('.//buildNumber')[0].text == "8703" + assert xml.findall('.//property[@name="hibernate.setup"]')[0].text == "true"