From 9e2928ea4ef6a17e5cbb1401164194d631b44f1a Mon Sep 17 00:00:00 2001
From: "e.garbuz" <e.garbuz@postgrespro.ru>
Date: Mon, 20 Jan 2025 05:48:22 +0300
Subject: [PATCH] Add check backup-source for testing pg_probackup3

---
 testgres/plugins/pg_probackup2/pg_probackup2/init_helpers.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/testgres/plugins/pg_probackup2/pg_probackup2/init_helpers.py b/testgres/plugins/pg_probackup2/pg_probackup2/init_helpers.py
index b7174a7c..078fdbab 100644
--- a/testgres/plugins/pg_probackup2/pg_probackup2/init_helpers.py
+++ b/testgres/plugins/pg_probackup2/pg_probackup2/init_helpers.py
@@ -172,6 +172,10 @@ def __init__(self):
         self.ptrack = test_env.get('PG_PROBACKUP_PTRACK', None) == 'ON' and self.pg_config_version >= 110000
         self.wal_tree_enabled = test_env.get('PG_PROBACKUP_WAL_TREE_ENABLED', None) == 'ON'
 
+        self.bckp_source = test_env.get('PG_PROBACKUP_SOURCE', 'pro').lower()
+        if self.bckp_source not in ('base', 'direct', 'pro'):
+            raise Exception("Wrong PG_PROBACKUP_SOURCE value. Available options: base|direct|pro")
+
         self.paranoia = test_env.get('PG_PROBACKUP_PARANOIA', None) == 'ON'
         env_compress = test_env.get('ARCHIVE_COMPRESSION', None)
         if env_compress: