DCCLIP-586: Updated test.

This commit is contained in:
Yifei Zhang 2023-09-18 17:21:43 +10:00
parent 4eceaf4610
commit c810617f56

View File

@ -306,7 +306,6 @@ def test_confluence_xml_postgres_all_set(docker_cli, image, run_user):
assert xml.findall('.//property[@name="hibernate.connection.provider_class"]')[0].text == "com.example.class"
def test_confluence_xml_postgres_c3p0(docker_cli, image, run_user):
environment = {
'CONFLUENCE_VERSION': '7.10.0',
@ -314,7 +313,6 @@ def test_confluence_xml_postgres_c3p0(docker_cli, image, run_user):
'ATL_JDBC_URL': 'atl_jdbc_url',
'ATL_JDBC_USER': 'atl_jdbc_user',
'ATL_JDBC_PASSWORD': 'atl_jdbc_password',
'ATL_JDBC_SECRET_CLASS': 'atl_jdbc_secret_class',
}
container = run_image(docker_cli, image, user=run_user, environment=environment)
_jvm = wait_for_proc(container, get_bootstrap_proc(container))
@ -323,7 +321,6 @@ def test_confluence_xml_postgres_c3p0(docker_cli, image, run_user):
assert xml.findall('.//property[@name="hibernate.connection.url"]')[0].text == "atl_jdbc_url"
assert xml.findall('.//property[@name="hibernate.connection.username"]')[0].text == "atl_jdbc_user"
assert xml.findall('.//property[@name="hibernate.connection.password"]')[0].text == "atl_jdbc_password"
assert xml.findall('.//property[@name="jdbc.password.decrypter.classname"]')[0].text == "atl_jdbc_secret_class"
assert xml.findall('.//property[@name="confluence.database.choice"]')[0].text == "postgresql"
assert xml.findall('.//property[@name="hibernate.dialect"]')[0].text == "com.atlassian.confluence.impl.hibernate.dialect.PostgreSQLDialect"
assert xml.findall('.//property[@name="hibernate.connection.driver_class"]')[0].text == "org.postgresql.Driver"
@ -370,6 +367,25 @@ def test_confluence_xml_postgres_all_set_c3p0(docker_cli, image, run_user):
assert xml.findall('.//property[@name="hibernate.c3p0.preferredTestQuery"]')[0].text == "xselect 1"
def test_confluence_xml_secretsmanager(docker_cli, image, run_user):
environment = {
'ATL_DB_TYPE': 'postgresql',
'ATL_JDBC_URL': 'atl_jdbc_url',
'ATL_JDBC_USER': 'atl_jdbc_user',
'ATL_JDBC_SECRET_CLASS': 'com.atlassian.secrets.store.aws.AwsSecretsManagerStore',
'ATL_JDBC_PASSWORD': '{"region": "us-east-1", "secretId": "mysecret"}',
}
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('.//property[@name="hibernate.connection.url"]')[0].text == "atl_jdbc_url"
assert xml.findall('.//property[@name="hibernate.connection.username"]')[0].text == "atl_jdbc_user"
assert xml.findall('.//property[@name="hibernate.connection.password"]')[0].text == '{"region": "us-east-1", "secretId": "mysecret"}'
assert xml.findall('.//property[@name="jdbc.password.decrypter.classname"]')[0].text == "com.atlassian.secrets.store.aws.AwsSecretsManagerStore"
assert xml.findall('.//property[@name="hibernate.connection.driver_class"]')[0].text == "org.postgresql.Driver"
def test_confluence_xml_cluster_aws(docker_cli, image, run_user):
environment = {
'ATL_CLUSTER_TYPE': 'aws',