Skip to content

Commit 88fed2b

Browse files
committed
tests: add suit of basic tests
1 parent 8514420 commit 88fed2b

17 files changed

+59
-149
lines changed

tests/Readme.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ Specify path to pg_probackup binary file. By default tests use <Path to Git repo
2424
export PGPROBACKUPBIN=<path to pg_probackup>
2525
2626
Remote backup depends on key authentithication to local machine via ssh as current user.
27-
PGPROBACKUP_SSH_REMOTE=ON
27+
export PGPROBACKUP_SSH_REMOTE=ON
28+
29+
Run suit of basic simple tests:
30+
export PG_PROBACKUP_TEST_BASIC=ON
31+
2832
2933
Usage:
3034
pip install testgres

tests/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import unittest
2+
import os
23

34
from . import init, merge, option, show, compatibility, \
45
backup, delete, delta, restore, validate, \
@@ -10,6 +11,10 @@
1011

1112
def load_tests(loader, tests, pattern):
1213
suite = unittest.TestSuite()
14+
15+
if os.environ['PG_PROBACKUP_TEST_BASIC'] == 'ON':
16+
loader.testMethodPrefix = 'test_basic'
17+
1318
# suite.addTests(loader.loadTestsFromModule(auth_test))
1419
suite.addTests(loader.loadTestsFromModule(archive))
1520
suite.addTests(loader.loadTestsFromModule(backup))

tests/archive.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def test_pgpro434_1(self):
2525
set_replication=True,
2626
initdb_params=['--data-checksums'],
2727
pg_options={
28-
'max_wal_senders': '2',
2928
'checkpoint_timeout': '30s'}
3029
)
3130
self.init_pb(backup_dir)
@@ -83,7 +82,6 @@ def test_pgpro434_2(self):
8382
set_replication=True,
8483
initdb_params=['--data-checksums'],
8584
pg_options={
86-
'max_wal_senders': '2',
8785
'checkpoint_timeout': '30s'}
8886
)
8987
self.init_pb(backup_dir)
@@ -232,7 +230,6 @@ def test_pgpro434_3(self):
232230
set_replication=True,
233231
initdb_params=['--data-checksums'],
234232
pg_options={
235-
'max_wal_senders': '2',
236233
'checkpoint_timeout': '30s'}
237234
)
238235
self.init_pb(backup_dir)
@@ -287,7 +284,6 @@ def test_arhive_push_file_exists(self):
287284
set_replication=True,
288285
initdb_params=['--data-checksums'],
289286
pg_options={
290-
'max_wal_senders': '2',
291287
'checkpoint_timeout': '30s'}
292288
)
293289
self.init_pb(backup_dir)
@@ -363,7 +359,6 @@ def test_arhive_push_file_exists_overwrite(self):
363359
set_replication=True,
364360
initdb_params=['--data-checksums'],
365361
pg_options={
366-
'max_wal_senders': '2',
367362
'checkpoint_timeout': '30s'}
368363
)
369364
self.init_pb(backup_dir)
@@ -639,7 +634,7 @@ def test_master_and_replica_parallel_archiving(self):
639634

640635
# @unittest.expectedFailure
641636
# @unittest.skip("skip")
642-
def test_master_and_replica_concurrent_archiving(self):
637+
def test_basic_master_and_replica_concurrent_archiving(self):
643638
"""
644639
make node 'master 'with archiving,
645640
take archive backup and turn it into replica,
@@ -736,7 +731,6 @@ def test_archive_pg_receivexlog(self):
736731
set_replication=True,
737732
initdb_params=['--data-checksums'],
738733
pg_options={
739-
'max_wal_senders': '2',
740734
'checkpoint_timeout': '30s'})
741735

742736
self.init_pb(backup_dir)
@@ -810,7 +804,6 @@ def test_archive_pg_receivexlog_compression_pg10(self):
810804
set_replication=True,
811805
initdb_params=['--data-checksums'],
812806
pg_options={
813-
'max_wal_senders': '2',
814807
'checkpoint_timeout': '30s'}
815808
)
816809
self.init_pb(backup_dir)

tests/backup.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,7 @@ def test_ptrack_threads_stream(self):
263263
set_replication=True,
264264
initdb_params=['--data-checksums'],
265265
pg_options={
266-
'ptrack_enable': 'on',
267-
'max_wal_senders': '2'})
266+
'ptrack_enable': 'on'})
268267

269268
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
270269
self.init_pb(backup_dir)
@@ -291,8 +290,7 @@ def test_page_corruption_heal_via_ptrack_1(self):
291290
node = self.make_simple_node(
292291
base_dir=os.path.join(module_name, fname, 'node'),
293292
set_replication=True,
294-
initdb_params=['--data-checksums'],
295-
pg_options={'max_wal_senders': '2'})
293+
initdb_params=['--data-checksums'])
296294

297295
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
298296

@@ -348,8 +346,7 @@ def test_page_corruption_heal_via_ptrack_2(self):
348346
node = self.make_simple_node(
349347
base_dir=os.path.join(module_name, fname, 'node'),
350348
set_replication=True,
351-
initdb_params=['--data-checksums'],
352-
pg_options={'max_wal_senders': '2'})
349+
initdb_params=['--data-checksums'])
353350

354351
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
355352

@@ -521,7 +518,7 @@ def test_tablespace_in_pgdata_pgpro_1376(self):
521518
self.del_test_dir(module_name, fname)
522519

523520
# @unittest.skip("skip")
524-
def test_tablespace_handling(self):
521+
def test_basic_tablespace_handling(self):
525522
"""
526523
make node, take full backup, check that restore with
527524
tablespace mapping will end with error, take page backup,
@@ -968,7 +965,7 @@ def test_persistent_slot_for_stream_backup(self):
968965
self.del_test_dir(module_name, fname)
969966

970967
# @unittest.skip("skip")
971-
def test_temp_slot_for_stream_backup(self):
968+
def test_basic_temp_slot_for_stream_backup(self):
972969
""""""
973970
fname = self.id().split('.')[3]
974971
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')

tests/checkdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def test_checkdb_amcheck_only_sanity(self):
212212
self.del_test_dir(module_name, fname)
213213

214214
# @unittest.skip("skip")
215-
def test_checkdb_amcheck_only_sanity_1(self):
215+
def test_basic_checkdb_amcheck_only_sanity(self):
216216
""""""
217217
fname = self.id().split('.')[3]
218218
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')

tests/compatibility.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def test_backward_compatibility_page(self):
2020
set_replication=True,
2121
initdb_params=['--data-checksums'],
2222
pg_options={
23-
'max_wal_senders': '2',
2423
'autovacuum': 'off'}
2524
)
2625
self.init_pb(backup_dir, old_binary=True)
@@ -123,7 +122,6 @@ def test_backward_compatibility_delta(self):
123122
set_replication=True,
124123
initdb_params=['--data-checksums'],
125124
pg_options={
126-
'max_wal_senders': '2',
127125
'autovacuum': 'off'}
128126
)
129127
self.init_pb(backup_dir, old_binary=True)
@@ -226,7 +224,6 @@ def test_backward_compatibility_ptrack(self):
226224
set_replication=True,
227225
initdb_params=['--data-checksums'],
228226
pg_options={
229-
'max_wal_senders': '2',
230227
'autovacuum': 'off'}
231228
)
232229
self.init_pb(backup_dir, old_binary=True)
@@ -329,7 +326,6 @@ def test_backward_compatibility_compression(self):
329326
set_replication=True,
330327
initdb_params=['--data-checksums'],
331328
pg_options={
332-
'max_wal_senders': '2',
333329
'autovacuum': 'off'})
334330

335331
self.init_pb(backup_dir, old_binary=True)
@@ -494,7 +490,6 @@ def test_backward_compatibility_merge(self):
494490
set_replication=True,
495491
initdb_params=['--data-checksums'],
496492
pg_options={
497-
'max_wal_senders': '2',
498493
'autovacuum': 'off'})
499494

500495
self.init_pb(backup_dir, old_binary=True)

tests/compression.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CompressionTest(ProbackupTest, unittest.TestCase):
1212

1313
# @unittest.skip("skip")
1414
# @unittest.expectedFailure
15-
def test_compression_stream_zlib(self):
15+
def test_basic_compression_stream_zlib(self):
1616
"""
1717
make archive node, make full and page stream backups,
1818
check data correctness in restored instance
@@ -25,7 +25,6 @@ def test_compression_stream_zlib(self):
2525
set_replication=True,
2626
initdb_params=['--data-checksums'],
2727
pg_options={
28-
'max_wal_senders': '2',
2928
'checkpoint_timeout': '30s',
3029
'ptrack_enable': 'on'}
3130
)
@@ -245,7 +244,6 @@ def test_compression_stream_pglz(self):
245244
set_replication=True,
246245
initdb_params=['--data-checksums'],
247246
pg_options={
248-
'max_wal_senders': '2',
249247
'checkpoint_timeout': '30s',
250248
'ptrack_enable': 'on'}
251249
)
@@ -355,7 +353,6 @@ def test_compression_archive_pglz(self):
355353
set_replication=True,
356354
initdb_params=['--data-checksums'],
357355
pg_options={
358-
'max_wal_senders': '2',
359356
'checkpoint_timeout': '30s',
360357
'ptrack_enable': 'on'}
361358
)
@@ -465,7 +462,6 @@ def test_compression_wrong_algorithm(self):
465462
set_replication=True,
466463
initdb_params=['--data-checksums'],
467464
pg_options={
468-
'max_wal_senders': '2',
469465
'checkpoint_timeout': '30s',
470466
'ptrack_enable': 'on'}
471467
)

tests/delta.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class DeltaTest(ProbackupTest, unittest.TestCase):
1414

1515
# @unittest.skip("skip")
16-
def test_delta_vacuum_truncate_1(self):
16+
def test_basic_delta_vacuum_truncate(self):
1717
"""
1818
make node, create table, take full backup,
1919
delete last 3 pages, vacuum relation,
@@ -27,7 +27,6 @@ def test_delta_vacuum_truncate_1(self):
2727
set_replication=True,
2828
initdb_params=['--data-checksums'],
2929
pg_options={
30-
'max_wal_senders': '2',
3130
'checkpoint_timeout': '300s',
3231
'autovacuum': 'off'})
3332

@@ -92,7 +91,7 @@ def test_delta_vacuum_truncate_1(self):
9291
self.del_test_dir(module_name, fname)
9392

9493
# @unittest.skip("skip")
95-
def test_delta_vacuum_truncate_2(self):
94+
def test_delta_vacuum_truncate_1(self):
9695
"""
9796
make node, create table, take full backup,
9897
delete last 3 pages, vacuum relation,
@@ -106,7 +105,6 @@ def test_delta_vacuum_truncate_2(self):
106105
set_replication=True,
107106
initdb_params=['--data-checksums'],
108107
pg_options={
109-
'max_wal_senders': '2',
110108
'checkpoint_timeout': '300s',
111109
'autovacuum': 'off'
112110
}
@@ -182,7 +180,7 @@ def test_delta_vacuum_truncate_2(self):
182180
self.del_test_dir(module_name, fname)
183181

184182
# @unittest.skip("skip")
185-
def test_delta_vacuum_truncate_3(self):
183+
def test_delta_vacuum_truncate_2(self):
186184
"""
187185
make node, create table, take full backup,
188186
delete last 3 pages, vacuum relation,
@@ -196,7 +194,6 @@ def test_delta_vacuum_truncate_3(self):
196194
set_replication=True,
197195
initdb_params=['--data-checksums'],
198196
pg_options={
199-
'max_wal_senders': '2',
200197
'checkpoint_timeout': '300s',
201198
'autovacuum': 'off'
202199
}
@@ -265,7 +262,6 @@ def test_delta_stream(self):
265262
set_replication=True,
266263
initdb_params=['--data-checksums'],
267264
pg_options={
268-
'max_wal_senders': '2',
269265
'checkpoint_timeout': '30s'
270266
}
271267
)
@@ -424,7 +420,6 @@ def test_delta_multiple_segments(self):
424420
set_replication=True,
425421
initdb_params=['--data-checksums'],
426422
pg_options={
427-
'max_wal_senders': '2',
428423
'fsync': 'off',
429424
'shared_buffers': '1GB',
430425
'maintenance_work_mem': '1GB',
@@ -506,7 +501,6 @@ def test_delta_vacuum_full(self):
506501
set_replication=True,
507502
initdb_params=['--data-checksums'],
508503
pg_options={
509-
'max_wal_senders': '2',
510504
'checkpoint_timeout': '300s'
511505
}
512506
)
@@ -598,7 +592,6 @@ def test_create_db(self):
598592
initdb_params=['--data-checksums'],
599593
pg_options={
600594
'max_wal_size': '10GB',
601-
'max_wal_senders': '2',
602595
'checkpoint_timeout': '5min',
603596
'autovacuum': 'off'
604597
}
@@ -728,7 +721,6 @@ def test_exists_in_previous_backup(self):
728721
initdb_params=['--data-checksums'],
729722
pg_options={
730723
'max_wal_size': '10GB',
731-
'max_wal_senders': '2',
732724
'checkpoint_timeout': '5min',
733725
'autovacuum': 'off'
734726
}
@@ -835,7 +827,6 @@ def test_alter_table_set_tablespace_delta(self):
835827
base_dir=os.path.join(module_name, fname, 'node'),
836828
set_replication=True, initdb_params=['--data-checksums'],
837829
pg_options={
838-
'max_wal_senders': '2',
839830
'checkpoint_timeout': '30s',
840831
'autovacuum': 'off'
841832
}
@@ -1019,7 +1010,6 @@ def test_delta_delete(self):
10191010
base_dir=os.path.join(module_name, fname, 'node'),
10201011
set_replication=True, initdb_params=['--data-checksums'],
10211012
pg_options={
1022-
'max_wal_senders': '2',
10231013
'checkpoint_timeout': '30s',
10241014
'autovacuum': 'off'
10251015
}
@@ -1099,8 +1089,7 @@ def test_delta_corruption_heal_via_ptrack_1(self):
10991089
node = self.make_simple_node(
11001090
base_dir=os.path.join(module_name, fname, 'node'),
11011091
set_replication=True,
1102-
initdb_params=['--data-checksums'],
1103-
pg_options={'max_wal_senders': '2'})
1092+
initdb_params=['--data-checksums'])
11041093

11051094
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
11061095

@@ -1158,8 +1147,7 @@ def test_page_corruption_heal_via_ptrack_2(self):
11581147
node = self.make_simple_node(
11591148
base_dir=os.path.join(module_name, fname, 'node'),
11601149
set_replication=True,
1161-
initdb_params=['--data-checksums'],
1162-
pg_options={'max_wal_senders': '2'})
1150+
initdb_params=['--data-checksums'])
11631151

11641152
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
11651153

tests/external.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ExternalTest(ProbackupTest, unittest.TestCase):
1313

1414
# @unittest.skip("skip")
1515
# @unittest.expectedFailure
16-
def test_external_simple(self):
16+
def test_basic_external(self):
1717
"""
1818
make node, create external directory, take backup
1919
with external directory, restore backup, check that

tests/false_positive.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ def test_validate_wal_lost_segment(self):
2020
node = self.make_simple_node(
2121
base_dir=os.path.join(module_name, fname, 'node'),
2222
set_replication=True,
23-
initdb_params=['--data-checksums'],
24-
pg_options={
25-
'max_wal_senders': '2'})
23+
initdb_params=['--data-checksums'])
2624

2725
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
2826
self.init_pb(backup_dir)
@@ -123,7 +121,6 @@ def test_ptrack_concurrent_get_and_clear_1(self):
123121
set_replication=True,
124122
initdb_params=['--data-checksums'],
125123
pg_options={
126-
'max_wal_senders': '2',
127124
'checkpoint_timeout': '300s',
128125
'ptrack_enable': 'on'
129126
}
@@ -205,7 +202,6 @@ def test_ptrack_concurrent_get_and_clear_2(self):
205202
set_replication=True,
206203
initdb_params=['--data-checksums'],
207204
pg_options={
208-
'max_wal_senders': '2',
209205
'checkpoint_timeout': '300s',
210206
'ptrack_enable': 'on'
211207
}

0 commit comments

Comments
 (0)