From 0381cb86882348270eba2950c14d1578d0ab18a2 Mon Sep 17 00:00:00 2001 From: Gravelord Date: Tue, 19 May 2026 23:49:21 +0300 Subject: [PATCH 1/5] feat: new test --- tests/robot/Lib/pgsLibrary.py | 59 ++++++++++ .../check_pgbackrest_restore.robot | 102 ++++++++++++++++++ 2 files changed, 161 insertions(+) create mode 100644 tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot diff --git a/tests/robot/Lib/pgsLibrary.py b/tests/robot/Lib/pgsLibrary.py index 7f82f7d1..b576936c 100644 --- a/tests/robot/Lib/pgsLibrary.py +++ b/tests/robot/Lib/pgsLibrary.py @@ -781,6 +781,65 @@ def check_last_backup_id(self): last_backup_id = health_json["storage"]["lastSuccessful"]["id"] return last_backup_id + def pgbackrest_backup_exists(self, backup_id): + response = requests.get(f"{self._scheme}://postgres-backup-daemon:8081/list", verify=False, timeout=10) + response.raise_for_status() + backups = response.json() + logging.info("Backup daemon backup list: {}".format(backups)) + return backup_id in backups + + def restore_pgbackrest_backup(self, backup_id): + pod = self.get_pod(label='app:postgres-backup-daemon', status='Running') + command = "cd /maintenance/recovery && SET={} python3 pg_back_rest_recovery.py".format(backup_id) + logging.info("Start PgBackRest restore from backup daemon pod {} with backup id {}".format( + pod.metadata.name, backup_id)) + output, errors = self.execute_in_pod(pod.metadata.name, command) + logging.info("PgBackRest restore output: {}".format(output)) + if errors: + logging.info("PgBackRest restore stderr: {}".format(errors)) + return output + + def get_backup_daemon_restart_count(self): + pod = self.get_pod(label='app:postgres-backup-daemon', status='Running') + restart_count = 0 + for container_status in pod.status.container_statuses or []: + restart_count += container_status.restart_count + logging.info("Backup daemon pod {} restart count: {}".format(pod.metadata.name, restart_count)) + return restart_count + + def get_pgbackrest_prerequisite_status(self): + status = { + "storage_type": None, + "backup_daemon_pod": None, + "pgbackrest_configmap_exists": False, + "pgbackrest_sidecar_pods": [], + "missing": [] + } + + backup_daemon = self.get_pod(label='app:postgres-backup-daemon', status='Running') + status["backup_daemon_pod"] = backup_daemon.metadata.name + status["storage_type"] = self.get_env_for_pod(backup_daemon, "STORAGE_TYPE") + if status["storage_type"] != "pgbackrest": + status["missing"].append("backup daemon STORAGE_TYPE is not pgbackrest") + + try: + self.pl_lib.get_config_map("pgbackrest-conf", self._namespace) + status["pgbackrest_configmap_exists"] = True + except Exception: + status["missing"].append("pgbackrest-conf config map is absent") + + pg_cluster_name = os.getenv("PG_CLUSTER_NAME", "patroni") + for pod in self.get_pods(label="pgcluster:{}".format(pg_cluster_name), status="Running"): + for container in pod.spec.containers: + if container.name == "pgbackrest-sidecar": + status["pgbackrest_sidecar_pods"].append(pod.metadata.name) + break + if not status["pgbackrest_sidecar_pods"]: + status["missing"].append("pgbackrest-sidecar container is absent in running patroni pods") + + logging.info("PgBackRest prerequisite status: {}".format(status)) + return status + def schedule_evict(self, last_backup_id): health_json = requests.delete(f"{self._scheme}://postgres-backup-daemon:8081/evict?id={last_backup_id}", verify=False).json() return health_json diff --git a/tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot b/tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot new file mode 100644 index 00000000..6249e743 --- /dev/null +++ b/tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot @@ -0,0 +1,102 @@ +*** Settings *** +Documentation Check positive full restore cycle with PgBackRest storage +Library Collections +Library OperatingSystem +Library String +Resource ../Lib/lib.robot + +*** Variables *** +${OPERATION_RETRY_COUNT} 60 +${OPERATION_RETRY_INTERVAL} 5s + +*** Test Cases *** +Check PgBackRest Full Backup Restore + [Tags] pgbackrest pgbackrest_restore + [Documentation] + ... Positive PgBackRest cycle: + ... 1. Verify backup daemon uses PgBackRest storage. + ... 2. Create database and seed data. + ... 3. Create full backup through backup daemon. + ... 4. Add data after backup. + ... 5. Restore Patroni cluster from the created PgBackRest backup. + ... 6. Verify cluster is healthy and data state matches the backup. + ${pg_cluster_name}= Get Environment Variable PG_CLUSTER_NAME default=patroni + ${postfix}= Generate Random String 5 [LOWER] + ${db_name}= Set Variable pgbackrest_restore_${postfix} + Set Test Variable \${db_name} ${db_name} + Log To Console \n[pgbackrest-debug] cluster=${pg_cluster_name}, database=${db_name} + Skip Test If PgBackRest Is Not Configured + Log To Console [pgbackrest-debug] creating database ${db_name} + Create Database ${db_name} + Wait Until Keyword Succeeds ${OPERATION_RETRY_COUNT} ${OPERATION_RETRY_INTERVAL} + ... Check Database Exists ${pg_cluster_name} ${db_name} + Log To Console [pgbackrest-debug] inserting data before backup into ${db_name} + ${rid_before} ${expected_before}= Insert Test Record database=${db_name} + Log To Console [pgbackrest-debug] record before backup: id=${rid_before}, expected=${expected_before} + ${restart_count_before}= Get Backup Daemon Restart Count + Log To Console [pgbackrest-debug] backup daemon restart count before restore: ${restart_count_before} + Log To Console [pgbackrest-debug] requesting full pgBackRest backup through backup daemon + ${backup_id}= Create PgBackRest Full Backup + Log To Console [pgbackrest-debug] created pgBackRest backup_id=${backup_id} + Log To Console [pgbackrest-debug] inserting data after backup into ${db_name} + ${rid_after} ${expected_after}= Insert Test Record database=${db_name} + Log To Console [pgbackrest-debug] record after backup: id=${rid_after}, expected=${expected_after} + Log To Console [pgbackrest-debug] starting restore for backup_id=${backup_id} + ${restore_output}= Restore Pgbackrest Backup ${backup_id} + Log ${restore_output} + Log To Console [pgbackrest-debug] restore command output: ${restore_output} + Log To Console [pgbackrest-debug] waiting for Patroni cluster to become ready after restore + Wait Until Keyword Succeeds 20 min 10 sec Patroni Ready + Log To Console [pgbackrest-debug] checking that pre-backup record exists after restore + Check Test Record pg-${pg_cluster_name} ${rid_before} ${expected_before} ${db_name} + Log To Console [pgbackrest-debug] checking that post-backup record is absent after restore + Check Test Record Is Absent pg-${pg_cluster_name} ${rid_after} ${expected_after} ${db_name} + ${restart_count_after}= Get Backup Daemon Restart Count + Log To Console [pgbackrest-debug] backup daemon restart count after restore: ${restart_count_after} + Should Be Equal As Integers ${restart_count_after} ${restart_count_before} + [Teardown] Delete Database ${db_name} + +*** Keywords *** +Skip Test If PgBackRest Is Not Configured + ${status}= Get Pgbackrest Prerequisite Status + Log To Console [pgbackrest-debug] prerequisites: ${status} + Log PgBackRest prerequisites: ${status} + ${missing}= Get From Dictionary ${status} missing + ${missing_count}= Get Length ${missing} + Run Keyword If ${missing_count} > 0 Pass Execution PgBackRest is not configured for this environment: ${missing} + +Check Database Exists + [Arguments] ${pg_cluster_name} ${db_name} + Log To Console [pgbackrest-debug] checking database existence: cluster=${pg_cluster_name}, database=${db_name} + ${databases}= Execute Query pg-${pg_cluster_name} SELECT datname FROM pg_database + Log To Console [pgbackrest-debug] databases query result: ${databases} + Should Contain str(${databases}) ${db_name} + +Create PgBackRest Full Backup + ${pod}= Get Pod label=app:postgres-backup-daemon status=Running + Log To Console [pgbackrest-debug] backup daemon pod=${pod.metadata.name} + ${dump_count}= Get Backup Count + Log To Console [pgbackrest-debug] dump count before backup=${dump_count} + ${schedule_response}= Schedule Backup + Log To Console [pgbackrest-debug] schedule response=${schedule_response} + Dictionary Should Contain Key ${schedule_response} backup_id + ${backup_id}= Get From Dictionary ${schedule_response} backup_id + Log To Console [pgbackrest-debug] waiting backup completion: backup_id=${backup_id}, previous_dump_count=${dump_count} + Wait For Backup To Complete ${pod.metadata.name} ${dump_count} + Log To Console [pgbackrest-debug] backup daemon reports backup completed: backup_id=${backup_id} + Wait Until Keyword Succeeds 10 min 10 sec Check PgBackRest Backup Exists ${backup_id} + [Return] ${backup_id} + +Check PgBackRest Backup Exists + [Arguments] ${backup_id} + Log To Console [pgbackrest-debug] checking backup in daemon list: backup_id=${backup_id} + ${exists}= Pgbackrest Backup Exists ${backup_id} + Log To Console [pgbackrest-debug] backup exists=${exists} + Should Be True ${exists} msg=PgBackRest backup ${backup_id} was not found in backrest list + +Check Test Record Is Absent + [Arguments] ${pod_name} ${rid} ${expected} ${database} + Log To Console [pgbackrest-debug] checking absent record: host=${pod_name}, database=${database}, id=${rid} + ${res}= Execute Query ${pod_name} select * from test_insert_robot where id=${rid} dbname=${database} + Log To Console [pgbackrest-debug] absent record query result: ${res} + Should Not Be True """${expected}""" in """${res}""" msg=Record added after backup is still present after restore: ${res} From dfe12758c1ff587f71bd22ef850c51cd73fff349 Mon Sep 17 00:00:00 2001 From: Gravelord Date: Thu, 21 May 2026 02:09:33 +0300 Subject: [PATCH 2/5] feat: fix errors --- tests/robot/Lib/pgsLibrary.py | 6 +++++- .../check_pgbackrest_restore.robot | 13 ++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/robot/Lib/pgsLibrary.py b/tests/robot/Lib/pgsLibrary.py index b576936c..eeea374b 100644 --- a/tests/robot/Lib/pgsLibrary.py +++ b/tests/robot/Lib/pgsLibrary.py @@ -782,11 +782,15 @@ def check_last_backup_id(self): return last_backup_id def pgbackrest_backup_exists(self, backup_id): + backups = self.get_pgbackrest_backup_list() + return backup_id in backups + + def get_pgbackrest_backup_list(self): response = requests.get(f"{self._scheme}://postgres-backup-daemon:8081/list", verify=False, timeout=10) response.raise_for_status() backups = response.json() logging.info("Backup daemon backup list: {}".format(backups)) - return backup_id in backups + return backups def restore_pgbackrest_backup(self, backup_id): pod = self.get_pod(label='app:postgres-backup-daemon', status='Running') diff --git a/tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot b/tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot index 6249e743..5e052a63 100644 --- a/tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot +++ b/tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot @@ -81,15 +81,18 @@ Create PgBackRest Full Backup Log To Console [pgbackrest-debug] schedule response=${schedule_response} Dictionary Should Contain Key ${schedule_response} backup_id ${backup_id}= Get From Dictionary ${schedule_response} backup_id - Log To Console [pgbackrest-debug] waiting backup completion: backup_id=${backup_id}, previous_dump_count=${dump_count} - Wait For Backup To Complete ${pod.metadata.name} ${dump_count} - Log To Console [pgbackrest-debug] backup daemon reports backup completed: backup_id=${backup_id} - Wait Until Keyword Succeeds 10 min 10 sec Check PgBackRest Backup Exists ${backup_id} - [Return] ${backup_id} + Log To Console [pgbackrest-debug] waiting pgBackRest backup in daemon list: backup_id=${backup_id}, previous_dump_count=${dump_count} + Wait Until Keyword Succeeds 30 min 15 sec Check PgBackRest Backup Exists ${backup_id} + ${dump_count_after}= Get Backup Count + Log To Console [pgbackrest-debug] pgBackRest backup is listed: backup_id=${backup_id}, dump_count_after=${dump_count_after} + RETURN ${backup_id} Check PgBackRest Backup Exists [Arguments] ${backup_id} Log To Console [pgbackrest-debug] checking backup in daemon list: backup_id=${backup_id} + ${backups}= Get Pgbackrest Backup List + @{backup_keys}= Get Dictionary Keys ${backups} + Log To Console [pgbackrest-debug] current daemon backup list keys: ${backup_keys} ${exists}= Pgbackrest Backup Exists ${backup_id} Log To Console [pgbackrest-debug] backup exists=${exists} Should Be True ${exists} msg=PgBackRest backup ${backup_id} was not found in backrest list From c490c83d7daa5088b905d3c9c007be936738a1f7 Mon Sep 17 00:00:00 2001 From: Gravelord Date: Fri, 22 May 2026 12:36:44 +0300 Subject: [PATCH 3/5] feat: fix tracking --- tests/robot/Lib/pgsLibrary.py | 70 ++++++++++++++++++- .../check_pgbackrest_restore.robot | 37 ++-------- 2 files changed, 75 insertions(+), 32 deletions(-) diff --git a/tests/robot/Lib/pgsLibrary.py b/tests/robot/Lib/pgsLibrary.py index eeea374b..dcb12966 100644 --- a/tests/robot/Lib/pgsLibrary.py +++ b/tests/robot/Lib/pgsLibrary.py @@ -782,8 +782,25 @@ def check_last_backup_id(self): return last_backup_id def pgbackrest_backup_exists(self, backup_id): - backups = self.get_pgbackrest_backup_list() - return backup_id in backups + try: + backups = self.get_pgbackrest_backup_list() + if backup_id in backups: + logging.info("PgBackRest backup %s found through backup daemon /list", backup_id) + return True + except Exception as e: + logging.info("Cannot check backup daemon list for PgBackRest backup %s: %s", backup_id, e) + + status = self.get_pgbackrest_sidecar_backup_status(backup_id) + if self._pgbackrest_backup_matches(backup_id, status): + logging.info("PgBackRest backup %s found through backrest /status", backup_id) + return True + + backups = self.get_pgbackrest_sidecar_backup_list() + if self._pgbackrest_backup_found_in_list(backup_id, backups): + logging.info("PgBackRest backup %s found through backrest /list", backup_id) + return True + + return False def get_pgbackrest_backup_list(self): response = requests.get(f"{self._scheme}://postgres-backup-daemon:8081/list", verify=False, timeout=10) @@ -792,6 +809,55 @@ def get_pgbackrest_backup_list(self): logging.info("Backup daemon backup list: {}".format(backups)) return backups + def get_pgbackrest_sidecar_backup_status(self, backup_id): + for service in ["backrest", "backrest-headless"]: + try: + response = requests.get( + "http://{}:3000/status?timestamp={}".format(service, backup_id), + timeout=10 + ) + response.raise_for_status() + status = response.json() + logging.info("PgBackRest status from %s for %s: %s", service, backup_id, status) + if self._pgbackrest_backup_matches(backup_id, status): + return status + except Exception as e: + logging.info("Cannot get PgBackRest status from %s for %s: %s", service, backup_id, e) + return {} + + def get_pgbackrest_sidecar_backup_list(self): + errors = {} + for service in ["backrest", "backrest-headless"]: + try: + response = requests.get("http://{}:3000/list".format(service), timeout=10) + response.raise_for_status() + backups = response.json() + logging.info("PgBackRest list from %s: %s", service, backups) + return backups + except Exception as e: + errors[service] = str(e) + logging.info("Cannot get PgBackRest list from %s: %s", service, e) + logging.info("Cannot get PgBackRest list from sidecar services: %s", errors) + return [] + + def _pgbackrest_backup_matches(self, backup_id, backup): + if not isinstance(backup, dict): + return False + annotation = backup.get("annotation") or {} + return annotation.get("timestamp") == backup_id and not backup.get("error", False) + + def _pgbackrest_backup_found_in_list(self, backup_id, backups): + if isinstance(backups, dict): + if backup_id in backups: + return True + backups = backups.values() + if not isinstance(backups, list): + return False + for backup in backups: + if self._pgbackrest_backup_matches(backup_id, backup): + return True + return False + def restore_pgbackrest_backup(self, backup_id): pod = self.get_pod(label='app:postgres-backup-daemon', status='Running') command = "cd /maintenance/recovery && SET={} python3 pg_back_rest_recovery.py".format(backup_id) diff --git a/tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot b/tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot index 5e052a63..79a969ef 100644 --- a/tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot +++ b/tests/robot/check_pgbackrest_restore/check_pgbackrest_restore.robot @@ -24,42 +24,30 @@ Check PgBackRest Full Backup Restore ${postfix}= Generate Random String 5 [LOWER] ${db_name}= Set Variable pgbackrest_restore_${postfix} Set Test Variable \${db_name} ${db_name} - Log To Console \n[pgbackrest-debug] cluster=${pg_cluster_name}, database=${db_name} + Log To Console \n[pgbackrest] cluster=${pg_cluster_name}, database=${db_name} Skip Test If PgBackRest Is Not Configured - Log To Console [pgbackrest-debug] creating database ${db_name} Create Database ${db_name} Wait Until Keyword Succeeds ${OPERATION_RETRY_COUNT} ${OPERATION_RETRY_INTERVAL} ... Check Database Exists ${pg_cluster_name} ${db_name} - Log To Console [pgbackrest-debug] inserting data before backup into ${db_name} ${rid_before} ${expected_before}= Insert Test Record database=${db_name} - Log To Console [pgbackrest-debug] record before backup: id=${rid_before}, expected=${expected_before} ${restart_count_before}= Get Backup Daemon Restart Count - Log To Console [pgbackrest-debug] backup daemon restart count before restore: ${restart_count_before} - Log To Console [pgbackrest-debug] requesting full pgBackRest backup through backup daemon ${backup_id}= Create PgBackRest Full Backup - Log To Console [pgbackrest-debug] created pgBackRest backup_id=${backup_id} - Log To Console [pgbackrest-debug] inserting data after backup into ${db_name} + Log To Console [pgbackrest] backup_id=${backup_id}, restart_count_before=${restart_count_before} ${rid_after} ${expected_after}= Insert Test Record database=${db_name} - Log To Console [pgbackrest-debug] record after backup: id=${rid_after}, expected=${expected_after} - Log To Console [pgbackrest-debug] starting restore for backup_id=${backup_id} ${restore_output}= Restore Pgbackrest Backup ${backup_id} Log ${restore_output} - Log To Console [pgbackrest-debug] restore command output: ${restore_output} - Log To Console [pgbackrest-debug] waiting for Patroni cluster to become ready after restore + Log To Console [pgbackrest] restore started for backup_id=${backup_id} Wait Until Keyword Succeeds 20 min 10 sec Patroni Ready - Log To Console [pgbackrest-debug] checking that pre-backup record exists after restore Check Test Record pg-${pg_cluster_name} ${rid_before} ${expected_before} ${db_name} - Log To Console [pgbackrest-debug] checking that post-backup record is absent after restore Check Test Record Is Absent pg-${pg_cluster_name} ${rid_after} ${expected_after} ${db_name} ${restart_count_after}= Get Backup Daemon Restart Count - Log To Console [pgbackrest-debug] backup daemon restart count after restore: ${restart_count_after} + Log To Console [pgbackrest] restart_count_after=${restart_count_after} Should Be Equal As Integers ${restart_count_after} ${restart_count_before} [Teardown] Delete Database ${db_name} *** Keywords *** Skip Test If PgBackRest Is Not Configured ${status}= Get Pgbackrest Prerequisite Status - Log To Console [pgbackrest-debug] prerequisites: ${status} Log PgBackRest prerequisites: ${status} ${missing}= Get From Dictionary ${status} missing ${missing_count}= Get Length ${missing} @@ -67,39 +55,28 @@ Skip Test If PgBackRest Is Not Configured Check Database Exists [Arguments] ${pg_cluster_name} ${db_name} - Log To Console [pgbackrest-debug] checking database existence: cluster=${pg_cluster_name}, database=${db_name} ${databases}= Execute Query pg-${pg_cluster_name} SELECT datname FROM pg_database - Log To Console [pgbackrest-debug] databases query result: ${databases} Should Contain str(${databases}) ${db_name} Create PgBackRest Full Backup ${pod}= Get Pod label=app:postgres-backup-daemon status=Running - Log To Console [pgbackrest-debug] backup daemon pod=${pod.metadata.name} ${dump_count}= Get Backup Count - Log To Console [pgbackrest-debug] dump count before backup=${dump_count} ${schedule_response}= Schedule Backup - Log To Console [pgbackrest-debug] schedule response=${schedule_response} + Log PgBackRest backup schedule response: ${schedule_response} Dictionary Should Contain Key ${schedule_response} backup_id ${backup_id}= Get From Dictionary ${schedule_response} backup_id - Log To Console [pgbackrest-debug] waiting pgBackRest backup in daemon list: backup_id=${backup_id}, previous_dump_count=${dump_count} + Log To Console [pgbackrest] waiting backup_id=${backup_id} Wait Until Keyword Succeeds 30 min 15 sec Check PgBackRest Backup Exists ${backup_id} ${dump_count_after}= Get Backup Count - Log To Console [pgbackrest-debug] pgBackRest backup is listed: backup_id=${backup_id}, dump_count_after=${dump_count_after} + Log PgBackRest backup ${backup_id} is listed, dump_count_before=${dump_count}, dump_count_after=${dump_count_after} RETURN ${backup_id} Check PgBackRest Backup Exists [Arguments] ${backup_id} - Log To Console [pgbackrest-debug] checking backup in daemon list: backup_id=${backup_id} - ${backups}= Get Pgbackrest Backup List - @{backup_keys}= Get Dictionary Keys ${backups} - Log To Console [pgbackrest-debug] current daemon backup list keys: ${backup_keys} ${exists}= Pgbackrest Backup Exists ${backup_id} - Log To Console [pgbackrest-debug] backup exists=${exists} Should Be True ${exists} msg=PgBackRest backup ${backup_id} was not found in backrest list Check Test Record Is Absent [Arguments] ${pod_name} ${rid} ${expected} ${database} - Log To Console [pgbackrest-debug] checking absent record: host=${pod_name}, database=${database}, id=${rid} ${res}= Execute Query ${pod_name} select * from test_insert_robot where id=${rid} dbname=${database} - Log To Console [pgbackrest-debug] absent record query result: ${res} Should Not Be True """${expected}""" in """${res}""" msg=Record added after backup is still present after restore: ${res} From 1f169073471d730960736593d028d15a51250dce Mon Sep 17 00:00:00 2001 From: Gravelord Date: Fri, 29 May 2026 00:53:50 +0300 Subject: [PATCH 4/5] fix: fix deprecated keywords and errors --- tests/robot/Lib/lib.robot | 2 +- .../check_crud_user/check_crud_user.robot | 8 ++++---- .../check_dbaas_adapter_backup_api.robot | 4 ++-- .../check_dbaas_adapter_api/keywords.robot | 2 +- ...check_granular_backups_list_auth_api.robot | 2 +- ...heck_granular_delete_backup_auth_api.robot | 4 ++-- ...eck_granular_restore_backup_auth_api.robot | 8 ++++---- ...r_restore_backup_with_new_names_auth.robot | 12 ++++++------ ...nular_restore_backup_with_roles_auth.robot | 19 ++++++++++--------- ...eck_granular_restore_status_auth_api.robot | 4 ++-- ...eck_granular_restore_with_owner_auth.robot | 8 ++++---- .../check_scale_down_backup_daemon.robot | 4 ++-- .../check_scale_down_master.robot | 2 +- .../check_terminate_backup_api/keywords.robot | 2 +- 14 files changed, 41 insertions(+), 40 deletions(-) diff --git a/tests/robot/Lib/lib.robot b/tests/robot/Lib/lib.robot index 5eb07ec4..079c4298 100644 --- a/tests/robot/Lib/lib.robot +++ b/tests/robot/Lib/lib.robot @@ -103,7 +103,7 @@ Insert Test Record ${res}= Execute Query ${MASTERHOST} select * from test_insert_robot where id=${RID} dbname=${database} Should Be True """${EXPECTED}""" in """${res}""" msg=[insert test record] Expected string ${EXPECTED} not found on ${MASTERHOST} : res: ${res} Log To Console Test records found on ${MASTERHOST} - [Return] ${RID} ${EXPECTED} + RETURN ${RID} ${EXPECTED} Check Test Record [Arguments] ${pod_name} ${RID} ${EXPECTED} ${database}=postgres diff --git a/tests/robot/check_crud_user/check_crud_user.robot b/tests/robot/check_crud_user/check_crud_user.robot index e31dc6fe..9e7709c9 100644 --- a/tests/robot/check_crud_user/check_crud_user.robot +++ b/tests/robot/check_crud_user/check_crud_user.robot @@ -20,7 +20,7 @@ Check User Creation Execute Query pg-${PG_CLUSTER_NAME} CREATE USER ${user_name}; ${res}= Execute Query pg-${PG_CLUSTER_NAME} SELECT usename FROM pg_user; Should Be True """${user_name}""" in """${res}""" msg=[creating user] Expected user ${user_name} is not created in pg-${PG_CLUSTER_NAME}: res: ${res} - [Teardown] Execute Query pg-${PG_CLUSTER_NAME} DROP USER ${user_name}; + [Teardown] Execute Query pg-${PG_CLUSTER_NAME} DROP USER IF EXISTS ${user_name}; Check User Creation With Password [Tags] patroni simple check_user @@ -29,7 +29,7 @@ Check User Creation With Password Should Be True """${user_name}""" in """${res}""" msg=[creating user] Expected user ${user_name} is not created in pg-${PG_CLUSTER_NAME}: res: ${res} ${pass}= Execute Query pg-${PG_CLUSTER_NAME} SELECT passwd from pg_shadow where usename='${user_name}'; Should Not Be Empty ${pass} - [Teardown] Execute Query pg-${PG_CLUSTER_NAME} DROP USER ${user_name}; + [Teardown] Execute Query pg-${PG_CLUSTER_NAME} DROP USER IF EXISTS ${user_name}; Check Update User [Tags] patroni simple check_user @@ -42,13 +42,13 @@ Check Update User Should Be True """${user_name}""" in """${res}""" msg=[updating user] Expected user ${user_name} is not exist after alter in pg-${PG_CLUSTER_NAME}: res: ${res} ${current_pass}= Execute Query pg-${PG_CLUSTER_NAME} SELECT passwd from pg_shadow where usename='${user_name}'; Should Not Be Equal ${previous_pass} ${current_pass} - [Teardown] Execute Query pg-${PG_CLUSTER_NAME} DROP USER ${user_name}; + [Teardown] Execute Query pg-${PG_CLUSTER_NAME} DROP USER IF EXISTS ${user_name}; Check Deletion Of User [Tags] patroni simple check_user Execute Query pg-${PG_CLUSTER_NAME} CREATE USER ${user_name} WITH PASSWORD '${user_pass}'; ${res}= Execute Query pg-${PG_CLUSTER_NAME} SELECT usename FROM pg_user; Should Be True """${user_name}""" in """${res}""" msg=[creating user] Expected user ${user_name} is not created in pg-${PG_CLUSTER_NAME}: res: ${res} - Execute Query pg-${PG_CLUSTER_NAME} DROP USER ${user_name}; + Execute Query pg-${PG_CLUSTER_NAME} DROP USER IF EXISTS ${user_name}; ${res}= Execute Query pg-${PG_CLUSTER_NAME} SELECT usename FROM pg_user; Should Not Be True """${user_name}""" in """${res}""" msg=[deleting user] User ${user_name} is not deleted from pg-${PG_CLUSTER_NAME}: res: ${res} diff --git a/tests/robot/check_dbaas_adapter_api/check_dbaas_adapter_backup_api.robot b/tests/robot/check_dbaas_adapter_api/check_dbaas_adapter_backup_api.robot index 163b320d..c658cdf0 100644 --- a/tests/robot/check_dbaas_adapter_api/check_dbaas_adapter_backup_api.robot +++ b/tests/robot/check_dbaas_adapter_api/check_dbaas_adapter_backup_api.robot @@ -11,7 +11,7 @@ Backup Database By Dbaas Adapter Should Be Equal As Strings ${resp.status_code} 202 Dictionary Should Contain Key ${resp.json()} trackId ${trackId}= Get From Dictionary ${resp.json()} trackId - [Return] ${trackId} + RETURN ${trackId} Check Backup Status By Dbaas Adapter [Arguments] ${trackId} @@ -26,7 +26,7 @@ Restore Database By Dbaas Adapter Should Be Equal As Strings ${resp.status_code} 202 Dictionary Should Contain Key ${resp.json()} trackId ${trackId}= Get From Dictionary ${resp.json()} trackId - [Return] ${trackId} + RETURN ${trackId} Check Restore Status By Dbaas Adapter [Arguments] ${trackId} diff --git a/tests/robot/check_dbaas_adapter_api/keywords.robot b/tests/robot/check_dbaas_adapter_api/keywords.robot index 287ca172..6a0c7aac 100644 --- a/tests/robot/check_dbaas_adapter_api/keywords.robot +++ b/tests/robot/check_dbaas_adapter_api/keywords.robot @@ -51,4 +51,4 @@ Check Database Creating By Dbaas Adapter Delete User And Database [Arguments] ${db_name} ${user_name} Delete Test DB ${db_name} - Execute Query pg-${PG_CLUSTER_NAME} DROP USER ${user_name} + Execute Query pg-${PG_CLUSTER_NAME} DROP USER IF EXISTS ${user_name} diff --git a/tests/robot/check_granular_api/check_granular_backups_list_auth_api.robot b/tests/robot/check_granular_api/check_granular_backups_list_auth_api.robot index ed0fc8d8..7a5b155e 100644 --- a/tests/robot/check_granular_api/check_granular_backups_list_auth_api.robot +++ b/tests/robot/check_granular_api/check_granular_backups_list_auth_api.robot @@ -39,7 +39,7 @@ Set Backups ${result}= Get From Dictionary ${resp.json()} ${name_space} Set Test Variable ${backups_in_namespace} ${result} Log ${result} - [Return] ${result} + RETURN ${result} *** Test Cases *** Check Backup Requests Status Endpoint diff --git a/tests/robot/check_granular_api/check_granular_delete_backup_auth_api.robot b/tests/robot/check_granular_api/check_granular_delete_backup_auth_api.robot index 1e89cac7..c6c216e2 100644 --- a/tests/robot/check_granular_api/check_granular_delete_backup_auth_api.robot +++ b/tests/robot/check_granular_api/check_granular_delete_backup_auth_api.robot @@ -6,8 +6,8 @@ Resource ../Lib/lib.robot *** Keywords *** Backup Not Exist - ${resp}= Get Request postgres_backup_daemon /backup/status/${backup_id}?namespace=${name_space} - Should Be True '${resp.status_code}'!=' ${200}' + ${resp}= GET On Session postgres_backup_daemon /backup/status/${backup_id}?namespace=${name_space} expected_status=any + Should Not Be Equal As Integers ${resp.status_code} 200 *** Test Cases *** Check Backup Requests Status Endpoint diff --git a/tests/robot/check_granular_api/check_granular_restore_backup_auth_api.robot b/tests/robot/check_granular_api/check_granular_restore_backup_auth_api.robot index 474398ee..bc6cc865 100644 --- a/tests/robot/check_granular_api/check_granular_restore_backup_auth_api.robot +++ b/tests/robot/check_granular_api/check_granular_restore_backup_auth_api.robot @@ -57,7 +57,7 @@ Check Disabled Auth Regular Backup Run Keyword If '${status}' == 'In progress' Sleep 1s Run Keyword If '${status}' == 'Successful' Exit For Loop END - Execute Query pg-${PG_CLUSTER_NAME} DROP DATABASE ${db_name} + Delete Database ${db_name} ${databases}= Execute Query pg-${PG_CLUSTER_NAME} SELECT datname FROM pg_database List Should Not Contain Value ${databases} ${db_name} msg="failed to delete the test database before restore from backup" Set To Dictionary ${data} backupId ${backup_id} @@ -79,7 +79,7 @@ Check Disabled Auth Regular Backup ${resp}= Get On Session postgres_backup_daemon url=/restore/status/${restore_id} Should Be Equal ${resp.status_code} ${200} #delete backup and drop database after test - Execute Query pg-${PG_CLUSTER_NAME} DROP DATABASE IF EXISTS ${db_name} + Delete Database ${db_name} ${resp}= Get On Session postgres_backup_daemon url=/delete/${backup_id}?namespace=${name_space} Should Be Equal ${resp.status_code} ${200} @@ -110,7 +110,7 @@ Check Enabled Auth Regular Backup Run Keyword If '${status}' == 'In progress' Sleep 1s Run Keyword If '${status}' == 'Successful' Exit For Loop END - Execute Query pg-${PG_CLUSTER_NAME} DROP DATABASE ${db_name} + Delete Database ${db_name} ${databases}= Execute Query pg-${PG_CLUSTER_NAME} SELECT datname FROM pg_database List Should Not Contain Value ${databases} ${db_name} msg="failed to delete the test database before restore from backup" Set To Dictionary ${data} backupId ${backup_id} @@ -132,7 +132,7 @@ Check Enabled Auth Regular Backup ${res}= Execute Query pg-${PG_CLUSTER_NAME} select * from test_insert_robot where id=${RID} dbname=${db_name} Should Be True """${EXPECTED}""" in """${res}""" msg=[insert test record] Expected string ${EXPECTED} not found after restore database: ${db_name}. res: ${res} #delete backup and drop database after test - Execute Query pg-${PG_CLUSTER_NAME} DROP DATABASE ${db_name} + Delete Database ${db_name} ${resp}= Get On Session postgres_backup_daemon url=/delete/${backup_id}?namespace=${name_space} Should Be Equal ${resp.status_code} ${200} diff --git a/tests/robot/check_granular_api/check_granular_restore_backup_with_new_names_auth.robot b/tests/robot/check_granular_api/check_granular_restore_backup_with_new_names_auth.robot index 995a7a19..92987158 100644 --- a/tests/robot/check_granular_api/check_granular_restore_backup_with_new_names_auth.robot +++ b/tests/robot/check_granular_api/check_granular_restore_backup_with_new_names_auth.robot @@ -74,9 +74,9 @@ Check Disabled Auth With Db Name Change END ${output}= Execute Query pg-${PG_CLUSTER_NAME} SELECT datname FROM pg_catalog.pg_database WHERE datname = 'TaRgEt_TeSt_Bd' Should Be True """TaRgEt_TeSt_Bd""" in """${output}""" - Execute Query pg-${PG_CLUSTER_NAME} DROP IF EXISTS DATABASE DATABASE test_db - Execute Query pg-${PG_CLUSTER_NAME} DROP IF EXISTS DATABASE DATABASE TaRgEt_TeSt_Bd - Execute Query pg-${PG_CLUSTER_NAME} DROP IF EXISTS DATABASE DATABASE target_test_bd + Delete Database test_db + Delete Database TaRgEt_TeSt_Bd + Delete Database target_test_bd ${resp}= Get On Session postgres_backup_daemon url=/delete/${backup_id}?namespace=${name_space} Should Be Equal ${resp.status_code} ${200} @@ -138,9 +138,9 @@ Check Enabled Auth With Db Name Change END ${output}= Execute Query pg-${PG_CLUSTER_NAME} SELECT datname FROM pg_catalog.pg_database WHERE datname = 'TaRgEt_TeSt_Bd' Should Be True """TaRgEt_TeSt_Bd""" in """${output}""" - Execute Query pg-${PG_CLUSTER_NAME} DROP IF EXISTS DATABASE DATABASE test_db - Execute Query pg-${PG_CLUSTER_NAME} DROP IF EXISTS DATABASE DATABASE TaRgEt_TeSt_Bd - Execute Query pg-${PG_CLUSTER_NAME} DROP IF EXISTS DATABASE DATABASE target_test_bd + Delete Database test_db + Delete Database TaRgEt_TeSt_Bd + Delete Database target_test_bd #delete backup after test ${resp}= Get On Session postgres_backup_daemon url=/delete/${backup_id}?namespace=${name_space} Should Be Equal ${resp.status_code} ${200} diff --git a/tests/robot/check_granular_api/check_granular_restore_backup_with_roles_auth.robot b/tests/robot/check_granular_api/check_granular_restore_backup_with_roles_auth.robot index 8c8f2a7c..1634761f 100644 --- a/tests/robot/check_granular_api/check_granular_restore_backup_with_roles_auth.robot +++ b/tests/robot/check_granular_api/check_granular_restore_backup_with_roles_auth.robot @@ -29,7 +29,7 @@ Check Disabled Auth With Roles Create New Role ${db_role} Create Database With Owner ${db_name} ${db_role} ${RID} ${EXPECTED}= Insert Test Record database=${db_name} - Execute Query pg-${PG_CLUSTER_NAME} ALTER TABLE test_gb_table OWNER TO ${db_name} dbname=${db_name} + Execute Query pg-${PG_CLUSTER_NAME} ALTER TABLE test_insert_robot OWNER TO ${db_role} dbname=${db_name} ${PGSSLMODE}= Get Environment Variable PGSSLMODE ${scheme}= Set Variable If '${PGSSLMODE}' == 'require' https http Create Session postgres_backup_daemon ${scheme}://postgres-backup-daemon:9000 @@ -47,7 +47,7 @@ Check Disabled Auth With Roles Run Keyword If '${status}' == 'Successful' Exit For Loop Run Keyword If '${status}' == 'In progress' Sleep 1s END - Execute Query pg-${PG_CLUSTER_NAME} DROP DATABASE ${db_name} + Delete Database ${db_name} ${databases}= Execute Query pg-${PG_CLUSTER_NAME} SELECT datname FROM pg_database List Should Not Contain Value ${databases} ${db_name} msg="failed to delete the test database before restore from backup" Set To Dictionary ${data} backupId=${backup_id} @@ -68,8 +68,8 @@ Check Disabled Auth With Roles ${res}= Execute Query pg-${PG_CLUSTER_NAME} select * from test_insert_robot where id=${RID} dbname=${db_name} Should Be True """${EXPECTED}""" in """${res}""" msg=[insert test record] Expected string ${EXPECTED} not found after restore database: ${db_name}. res: ${res} #delete backup and database after test - Execute Query pg-${PG_CLUSTER_NAME} drop database if exists ${db_name} - Execute Query pg-${PG_CLUSTER_NAME} DROP ROLE ${db_role} + Delete Database ${db_name} + Execute Query pg-${PG_CLUSTER_NAME} DROP ROLE IF EXISTS ${db_role} ${resp}= Get On Session postgres_backup_daemon url=/delete/${backup_id}?namespace=${name_space} Should Be Equal ${resp.status_code} ${200} @@ -88,7 +88,7 @@ Check Enabled Auth With Roles Create New Role ${db_role} Create Database With Owner ${db_name} ${db_role} ${RID} ${EXPECTED}= Insert Test Record database=${db_name} - Execute Query pg-${PG_CLUSTER_NAME} ALTER TABLE test_gb_table OWNER TO ${db_name} dbname=${db_name} + Execute Query pg-${PG_CLUSTER_NAME} ALTER TABLE test_insert_robot OWNER TO ${db_role} dbname=${db_name} Create Session postgres_backup_daemon ${scheme}://postgres-backup-daemon:9000 auth=${auth} ${name_space}= Get Current Date result_format=%Y%m%d%H%M ${array_db_name}= Create List ${db_name} @@ -97,14 +97,14 @@ Check Enabled Auth With Roles &{headers}= Create Dictionary Content-Type=application/json ${resp}= POST On Session postgres_backup_daemon /backup/request data=${json_data} headers=${headers} Should Be Equal ${resp.status_code} ${202} - ${restore_id}= Get From Dictionary ${resp.json()} backupId + ${backup_id}= Get From Dictionary ${resp.json()} backupId FOR ${INDEX} IN RANGE 60 - ${resp}= GET On Session postgres_backup_daemon url=/backup/status/${restore_id}?namespace=${name_space} + ${resp}= GET On Session postgres_backup_daemon url=/backup/status/${backup_id}?namespace=${name_space} ${status}= Get From Dictionary ${resp.json()} status Run Keyword If '${status}' == 'In progress' Sleep 1s Run Keyword If '${status}' == 'Successful' Exit For Loop END - Execute Query pg-${PG_CLUSTER_NAME} DROP DATABASE ${db_name} + Delete Database ${db_name} ${databases}= Execute Query pg-${PG_CLUSTER_NAME} SELECT datname FROM pg_database List Should Not Contain Value ${databases} ${db_name} msg="failed to delete the test database before restore from backup" Set To Dictionary ${data} backupId=${backup_id} @@ -125,6 +125,7 @@ Check Enabled Auth With Roles ${res}= Execute Query pg-${PG_CLUSTER_NAME} select * from test_insert_robot where id=${RID} dbname=${db_name} Should Be True """${EXPECTED}""" in """${res}""" msg=[insert test record] Expected string ${EXPECTED} not found after restore database: ${db_name}. res: ${res} #delete backup after test - Execute Query pg-${PG_CLUSTER_NAME} drop database if exists ${db_name} + Delete Database ${db_name} + Execute Query pg-${PG_CLUSTER_NAME} DROP ROLE IF EXISTS ${db_role} ${resp}= GET On Session postgres_backup_daemon url=/delete/${backup_id}?namespace=${name_space} Should Be Equal ${resp.status_code} ${200} diff --git a/tests/robot/check_granular_api/check_granular_restore_status_auth_api.robot b/tests/robot/check_granular_api/check_granular_restore_status_auth_api.robot index b43ec26c..d181affc 100644 --- a/tests/robot/check_granular_api/check_granular_restore_status_auth_api.robot +++ b/tests/robot/check_granular_api/check_granular_restore_status_auth_api.robot @@ -81,7 +81,7 @@ Check Disabled Auth Restore Endpoint Create Session postgres_backup_daemon ${scheme}://postgres-backup-daemon:9000 ${resp}= Get On Session postgres_backup_daemon url=/restore/status/${restore_id} Should Be Equal ${resp.status_code} ${200} - execute query pg-${PG_CLUSTER_NAME} drop database if exists ${db_name} + Delete Database ${db_name} #delete backup after test ${resp}= Get On Session postgres_backup_daemon url=/delete/${backup_id} @@ -142,7 +142,7 @@ Check Enabled Auth restore endpoint Create Session postgres_backup_daemon ${scheme}://postgres-backup-daemon:9000 auth=${auth} ${resp}= Get On Session postgres_backup_daemon url=/restore/status/${restore_id} Should Be Equal ${resp.status_code} ${200} - execute query pg-${PG_CLUSTER_NAME} drop database if exists ${db_name} + Delete Database ${db_name} #delete backup after test ${resp}= Get On Session postgres_backup_daemon url=/delete/${backup_id} diff --git a/tests/robot/check_granular_api/check_granular_restore_with_owner_auth.robot b/tests/robot/check_granular_api/check_granular_restore_with_owner_auth.robot index 74df7f7f..0633dfae 100644 --- a/tests/robot/check_granular_api/check_granular_restore_with_owner_auth.robot +++ b/tests/robot/check_granular_api/check_granular_restore_with_owner_auth.robot @@ -34,13 +34,13 @@ Prepare Database Set Global Variable ${db_role} Create New Role ${db_role} Create Database With Owner ${db_name} ${db_role} - Execute Query pg-${PG_CLUSTER_NAME} CREATE TABLE test_gb_table (ID BIGINT PRIMARY KEY NOT NULL, VALUE TEXT NOT NULL) dbname=${db_name} + Execute Query pg-${PG_CLUSTER_NAME} CREATE TABLE IF NOT EXISTS test_gb_table (ID BIGINT PRIMARY KEY NOT NULL, VALUE TEXT NOT NULL) dbname=${db_name} Execute Query pg-${PG_CLUSTER_NAME} ALTER TABLE test_gb_table OWNER TO smoketest_gb_role dbname=${db_name} - Execute Query pg-${PG_CLUSTER_NAME} INSERT INTO test_gb_table VALUES (42, '42') dbname=${db_name} + Execute Query pg-${PG_CLUSTER_NAME} INSERT INTO test_gb_table VALUES (42, '42') ON CONFLICT (ID) DO NOTHING dbname=${db_name} Teardown Database - Execute Query pg-${PG_CLUSTER_NAME} DROP ROLE ${db_role} - Execute Query pg-${PG_CLUSTER_NAME} drop database if exists ${db_name} + Delete Database ${db_name} + Execute Query pg-${PG_CLUSTER_NAME} DROP ROLE IF EXISTS ${db_role} Check That Role Exists ${output}= Execute Query pg-${PG_CLUSTER_NAME} SELECT rolname FROM pg_roles where rolname = '${db_role}' diff --git a/tests/robot/check_scale_down_backup_daemon/check_scale_down_backup_daemon.robot b/tests/robot/check_scale_down_backup_daemon/check_scale_down_backup_daemon.robot index 9edcd05a..e88689b0 100644 --- a/tests/robot/check_scale_down_backup_daemon/check_scale_down_backup_daemon.robot +++ b/tests/robot/check_scale_down_backup_daemon/check_scale_down_backup_daemon.robot @@ -30,13 +30,13 @@ Make Backup And Return ID Should Be Equal ${resp.status_code} ${202} Dictionary Should Contain Key ${resp.json()} backupId ${backup_id}= Get From Dictionary ${resp.json()} backupId - [Return] ${backup_id} + RETURN ${backup_id} Check Existence Backup Files [Arguments] ${last_backup_id} ${backup_pod}= Get Pod Daemon ${files}= Get Backup Files ${backup_pod} ${last_backup_id} - [Return] ${files} + RETURN ${files} *** Test Cases *** Check Scale Down Backup Daemon diff --git a/tests/robot/check_scale_down_master/check_scale_down_master.robot b/tests/robot/check_scale_down_master/check_scale_down_master.robot index db28c576..58a5325a 100644 --- a/tests/robot/check_scale_down_master/check_scale_down_master.robot +++ b/tests/robot/check_scale_down_master/check_scale_down_master.robot @@ -11,7 +11,7 @@ Check Master Reelection ${new_master}= Get Master Pod Id Should Be True '${new_master}' != '${None}' Should Be True '${new_master}' != '${MASTER_POD_NAME}' - [Return] ${new_master} + RETURN ${new_master} *** Test Cases *** diff --git a/tests/robot/check_terminate_backup_api/keywords.robot b/tests/robot/check_terminate_backup_api/keywords.robot index e3a7fd4f..3a073c0b 100644 --- a/tests/robot/check_terminate_backup_api/keywords.robot +++ b/tests/robot/check_terminate_backup_api/keywords.robot @@ -37,4 +37,4 @@ Prepare Auth ${POSTGRES_USER}= Get Environment Variable POSTGRES_USER default=postgres ${PG_ROOT_PASSWORD}= Get Environment Variable PG_ROOT_PASSWORD ${auth}= Create List ${POSTGRES_USER} ${PG_ROOT_PASSWORD} - [Return] ${auth} + RETURN ${auth} From c1f7653160ca1a61084b8abddea718b07ad3a5f5 Mon Sep 17 00:00:00 2001 From: Gravelord Date: Thu, 4 Jun 2026 00:19:29 +0300 Subject: [PATCH 5/5] fix: test new get --- tests/robot/Lib/pgsLibrary.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/robot/Lib/pgsLibrary.py b/tests/robot/Lib/pgsLibrary.py index dcb12966..e4c00653 100644 --- a/tests/robot/Lib/pgsLibrary.py +++ b/tests/robot/Lib/pgsLibrary.py @@ -783,12 +783,22 @@ def check_last_backup_id(self): def pgbackrest_backup_exists(self, backup_id): try: - backups = self.get_pgbackrest_backup_list() - if backup_id in backups: - logging.info("PgBackRest backup %s found through backup daemon /list", backup_id) + response = requests.get( + f"{self._scheme}://postgres-backup-daemon:8080/backup/status/{backup_id}", + verify=False, + timeout=10 + ) + if response.status_code == 404: + logging.info("PgBackRest backup %s was not found through backup daemon /backup/status", backup_id) + return False + response.raise_for_status() + status = response.text.strip() + if status == "Backup Done": + logging.info("PgBackRest backup %s found through backup daemon /backup/status", backup_id) return True + logging.info("PgBackRest backup %s is not ready yet. Backup daemon status: %s", backup_id, status) except Exception as e: - logging.info("Cannot check backup daemon list for PgBackRest backup %s: %s", backup_id, e) + logging.info("Cannot check backup daemon status for PgBackRest backup %s: %s", backup_id, e) status = self.get_pgbackrest_sidecar_backup_status(backup_id) if self._pgbackrest_backup_matches(backup_id, status):