diff --git a/templates/pgbackrest.conf.j2 b/templates/pgbackrest.conf.j2 index 922998d7b9f..addfa79529b 100644 --- a/templates/pgbackrest.conf.j2 +++ b/templates/pgbackrest.conf.j2 @@ -2,6 +2,7 @@ backup-standby=y compress-type=zst lock-path=/tmp +log-level-stderr=warn log-path={{ log_path }} repo1-retention-full-type=time repo1-retention-full={{ retention_full }} diff --git a/tests/unit/test_backups.py b/tests/unit/test_backups.py index 93aec4c95d4..ba5b8456efd 100644 --- a/tests/unit/test_backups.py +++ b/tests/unit/test_backups.py @@ -1870,6 +1870,13 @@ def test_render_pgbackrest_conf_file(harness, tls_ca_chain_filename): # Check the template is opened read-only in the call to open. assert mock.call_args_list[0][0] == ("templates/pgbackrest.conf.j2",) + rendered_pgbackrest_conf = next( + call_args[0][1] + for call_args in _render_file.call_args_list + if call_args[0][0] + == "/var/snap/charmed-postgresql/current/etc/pgbackrest/pgbackrest.conf" + ) + assert "log-level-stderr=warn" in rendered_pgbackrest_conf # Get the expected content from a file. with open("templates/pgbackrest.conf.j2") as file: