diff --git a/tests/Readme.md b/tests/Readme.md index 31571048..61d000fc 100644 --- a/tests/Readme.md +++ b/tests/Readme.md @@ -1,7 +1,11 @@ [см wiki](https://confluence.postgrespro.ru/display/DEV/pg_probackup) ``` -Note: For now there are tests only for Linix +Note: For now these are works on Linix and "kinda" works on Windows +``` + +``` +Windows Note: For tablespaceses tests to work on Windows, you should explicitly(!) grant current user full access to tmp_dirs ``` diff --git a/tests/__init__.py b/tests/__init__.py index 5e006f41..dd4ebc3b 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,6 @@ import unittest -from . import init_test, merge, option_test, show_test, compatibility, \ +from . import init, merge, option, show, compatibility, \ backup_test, delete, delta, restore, validate, \ retention, pgpro560, pgpro589, pgpro2068, false_positive, replica, \ compression, page, ptrack, archive, exclude, cfs_backup, cfs_restore, \ @@ -19,40 +19,36 @@ def load_tests(loader, tests, pattern): # suite.addTests(loader.loadTestsFromModule(cfs_backup)) # suite.addTests(loader.loadTestsFromModule(cfs_restore)) # suite.addTests(loader.loadTestsFromModule(cfs_validate_backup)) - suite.addTests(loader.loadTestsFromModule(logging)) 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_test)) + suite.addTests(loader.loadTestsFromModule(init)) suite.addTests(loader.loadTestsFromModule(locking)) suite.addTests(loader.loadTestsFromModule(logging)) suite.addTests(loader.loadTestsFromModule(merge)) - suite.addTests(loader.loadTestsFromModule(option_test)) + suite.addTests(loader.loadTestsFromModule(option)) suite.addTests(loader.loadTestsFromModule(page)) # suite.addTests(loader.loadTestsFromModule(ptrack)) + 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(show_test)) + suite.addTests(loader.loadTestsFromModule(show)) suite.addTests(loader.loadTestsFromModule(snapfs)) - suite.addTests(loader.loadTestsFromModule(validate)) - suite.addTests(loader.loadTestsFromModule(pgpro560)) - suite.addTests(loader.loadTestsFromModule(pgpro589)) - suite.addTests(loader.loadTestsFromModule(pgpro2068)) suite.addTests(loader.loadTestsFromModule(time_stamp)) - suite.addTests(loader.loadTestsFromModule(external)) + suite.addTests(loader.loadTestsFromModule(validate)) return suite # test_pgpro434_2 unexpected success # ToDo: -# archive: -# discrepancy of instance`s SYSTEMID and node`s SYSTEMID should lead to archive-push refusal to work # logging: -# https://jira.postgrespro.ru/browse/PGPRO-584 # https://jira.postgrespro.ru/secure/attachment/20420/20420_doc_logging.md # archive: # immediate recovery and full recovery diff --git a/tests/exclude.py b/tests/exclude.py index 21272bca..5e641bad 100644 --- a/tests/exclude.py +++ b/tests/exclude.py @@ -112,9 +112,8 @@ class ExcludeTest(ProbackupTest, unittest.TestCase): set_replication=True, initdb_params=['--data-checksums'], pg_options={ - 'max_wal_senders': '2', + 'autovacuum': 'off', "shared_buffers": "10MB", - "fsync": "off", 'ptrack_enable': 'on'}) self.init_pb(backup_dir) diff --git a/tests/logging.py b/tests/logging.py index c47d68dc..c905695b 100644 --- a/tests/logging.py +++ b/tests/logging.py @@ -256,7 +256,7 @@ class LogTest(ProbackupTest, unittest.TestCase): self.assertTrue(os.path.isfile(rotation_file_path)) # mangle .rotation file - with open(rotation_file_path, "wtb", 0) as f: + with open(rotation_file_path, "wt", 0) as f: f.write(b"blah") f.flush() f.close @@ -274,8 +274,11 @@ class LogTest(ProbackupTest, unittest.TestCase): log_file_size) self.assertIn( - 'WARNING: rotation file "{0}" has wrong ' - 'creation timestamp'.format(rotation_file_path), + 'WARNING: rotation file', + output) + + self.assertIn( + 'has wrong creation timestamp', output) self.assertTrue(os.path.isfile(rotation_file_path)) diff --git a/tests/merge.py b/tests/merge.py index 4ae8c0ba..c06e1506 100644 --- a/tests/merge.py +++ b/tests/merge.py @@ -1224,7 +1224,8 @@ class MergeTest(ProbackupTest, unittest.TestCase): gdb = self.merge_backup(backup_dir, "node", backup_id, gdb=True) - gdb.set_breakpoint('fio_unlink') + gdb.set_breakpoint('pgFileDelete') + gdb.run_until_break() gdb.continue_execution_until_break(20)