|
13 | 13 |
|
14 | 14 | class BackupTest(ProbackupTest, unittest.TestCase): |
15 | 15 |
|
| 16 | + def test_basic_full_backup(self): |
| 17 | + """ |
| 18 | + Just test full backup with at least two segments |
| 19 | + """ |
| 20 | + fname = self.id().split('.')[3] |
| 21 | + node = self.make_simple_node( |
| 22 | + base_dir=os.path.join(module_name, fname, 'node'), |
| 23 | + initdb_params=['--data-checksums'], |
| 24 | + # we need to write a lot. Lets speedup a bit. |
| 25 | + pg_options={"fsync": "off", "synchronous_commit": "off"}) |
| 26 | + |
| 27 | + backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup') |
| 28 | + self.init_pb(backup_dir) |
| 29 | + self.add_instance(backup_dir, 'node', node) |
| 30 | + self.set_archiving(backup_dir, 'node', node) |
| 31 | + node.slow_start() |
| 32 | + |
| 33 | + # Fill with data |
| 34 | + # Have to use scale=100 to create second segment. |
| 35 | + node.pgbench_init(scale=100, no_vacuum=True) |
| 36 | + |
| 37 | + # FULL |
| 38 | + backup_id = self.backup_node(backup_dir, 'node', node) |
| 39 | + |
| 40 | + out = self.validate_pb(backup_dir, 'node', backup_id) |
| 41 | + self.assertIn( |
| 42 | + "INFO: Backup {0} is valid".format(backup_id), |
| 43 | + out) |
| 44 | + |
| 45 | + # Clean after yourself |
| 46 | + self.del_test_dir(module_name, fname) |
| 47 | + |
16 | 48 | # @unittest.skip("skip") |
17 | 49 | # @unittest.expectedFailure |
18 | 50 | # PGPRO-707 |
@@ -1497,7 +1529,7 @@ def test_backup_concurrent_drop_table(self): |
1497 | 1529 | def test_pg_11_adjusted_wal_segment_size(self): |
1498 | 1530 | """""" |
1499 | 1531 | if self.pg_config_version < self.version_to_num('11.0'): |
1500 | | - return unittest.skip('You need PostgreSQL >= 11 for this test') |
| 1532 | + self.skipTest('You need PostgreSQL >= 11 for this test') |
1501 | 1533 |
|
1502 | 1534 | fname = self.id().split('.')[3] |
1503 | 1535 | backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup') |
@@ -1740,7 +1772,7 @@ def test_drop_table(self): |
1740 | 1772 | def test_basic_missing_file_permissions(self): |
1741 | 1773 | """""" |
1742 | 1774 | if os.name == 'nt': |
1743 | | - return unittest.skip('Skipped because it is POSIX only test') |
| 1775 | + self.skipTest('Skipped because it is POSIX only test') |
1744 | 1776 |
|
1745 | 1777 | fname = self.id().split('.')[3] |
1746 | 1778 | backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup') |
@@ -1787,7 +1819,7 @@ def test_basic_missing_file_permissions(self): |
1787 | 1819 | def test_basic_missing_dir_permissions(self): |
1788 | 1820 | """""" |
1789 | 1821 | if os.name == 'nt': |
1790 | | - return unittest.skip('Skipped because it is POSIX only test') |
| 1822 | + self.skipTest('Skipped because it is POSIX only test') |
1791 | 1823 |
|
1792 | 1824 | fname = self.id().split('.')[3] |
1793 | 1825 | backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup') |
|
0 commit comments