1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-25 09:01:48 +02:00
pg_probackup/tests/__init__.py
Daniel Shelepanov 68b77a06bc
[PBCKP-150] Reading buffer is flushed each time we verify the checksum. (#487)
The race condition is covered with a unit-test, the buffer is flushed
now so each of 300 reads requests the data from the disc.
2022-05-25 14:45:25 +03:00

75 lines
3.4 KiB
Python

import unittest
import os
from . import init, merge, option, show, compatibility, \
backup, delete, delta, restore, validate, \
retention, pgpro560, pgpro589, pgpro2068, false_positive, replica, \
compression, page, ptrack, archive, exclude, cfs_backup, cfs_restore, \
cfs_validate_backup, auth_test, time_stamp, logging, \
locking, remote, external, config, checkdb, set_backup, incr_restore, \
catchup, CVE_2018_1058, time_consuming
def load_tests(loader, tests, pattern):
suite = unittest.TestSuite()
if 'PG_PROBACKUP_TEST_BASIC' in os.environ:
if os.environ['PG_PROBACKUP_TEST_BASIC'] == 'ON':
loader.testMethodPrefix = 'test_basic'
if 'PG_PROBACKUP_PTRACK' in os.environ:
if os.environ['PG_PROBACKUP_PTRACK'] == 'ON':
suite.addTests(loader.loadTestsFromModule(ptrack))
# PG_PROBACKUP_LONG section for tests that are long
# by design e.g. they contain loops, sleeps and so on
if 'PG_PROBACKUP_LONG' in os.environ:
if os.environ['PG_PROBACKUP_LONG'] == 'ON':
suite.addTests(loader.loadTestsFromModule(time_consuming))
# suite.addTests(loader.loadTestsFromModule(auth_test))
suite.addTests(loader.loadTestsFromModule(archive))
suite.addTests(loader.loadTestsFromModule(backup))
suite.addTests(loader.loadTestsFromModule(catchup))
if 'PGPROBACKUPBIN_OLD' in os.environ and os.environ['PGPROBACKUPBIN_OLD']:
suite.addTests(loader.loadTestsFromModule(compatibility))
suite.addTests(loader.loadTestsFromModule(checkdb))
suite.addTests(loader.loadTestsFromModule(config))
# suite.addTests(loader.loadTestsFromModule(cfs_backup))
# suite.addTests(loader.loadTestsFromModule(cfs_restore))
# suite.addTests(loader.loadTestsFromModule(cfs_validate_backup))
suite.addTests(loader.loadTestsFromModule(compression))
suite.addTests(loader.loadTestsFromModule(delete))
suite.addTests(loader.loadTestsFromModule(delta))
suite.addTests(loader.loadTestsFromModule(exclude))
suite.addTests(loader.loadTestsFromModule(external))
suite.addTests(loader.loadTestsFromModule(false_positive))
suite.addTests(loader.loadTestsFromModule(init))
suite.addTests(loader.loadTestsFromModule(incr_restore))
suite.addTests(loader.loadTestsFromModule(locking))
suite.addTests(loader.loadTestsFromModule(logging))
suite.addTests(loader.loadTestsFromModule(merge))
suite.addTests(loader.loadTestsFromModule(option))
suite.addTests(loader.loadTestsFromModule(page))
suite.addTests(loader.loadTestsFromModule(pgpro560))
suite.addTests(loader.loadTestsFromModule(pgpro589))
suite.addTests(loader.loadTestsFromModule(pgpro2068))
suite.addTests(loader.loadTestsFromModule(remote))
suite.addTests(loader.loadTestsFromModule(replica))
suite.addTests(loader.loadTestsFromModule(restore))
suite.addTests(loader.loadTestsFromModule(retention))
suite.addTests(loader.loadTestsFromModule(set_backup))
suite.addTests(loader.loadTestsFromModule(show))
suite.addTests(loader.loadTestsFromModule(time_stamp))
suite.addTests(loader.loadTestsFromModule(validate))
suite.addTests(loader.loadTestsFromModule(CVE_2018_1058))
return suite
# test_pgpro434_2 unexpected success
# ToDo:
# logging:
# https://jira.postgrespro.ru/secure/attachment/20420/20420_doc_logging.md
# archive:
# immediate recovery and full recovery