@@ -176,7 +176,7 @@ def test_merge_compressed_backups_1(self):
176176# Initialize instance and backup directory
177177node = self .make_simple_node (
178178base_dir = os .path .join (module_name ,fname ,'node' ),
179- initdb_params = ["--data-checksums" ],
179+ set_replication = True , initdb_params = ["--data-checksums" ],
180180pg_options = {
181181'autovacuum' :'off'
182182 }
@@ -253,7 +253,7 @@ def test_merge_compressed_and_uncompressed_backups(self):
253253# Initialize instance and backup directory
254254node = self .make_simple_node (
255255base_dir = os .path .join (module_name ,fname ,'node' ),
256- initdb_params = ["--data-checksums" ],
256+ set_replication = True , initdb_params = ["--data-checksums" ],
257257pg_options = {
258258'autovacuum' :'off'
259259 }
@@ -329,7 +329,7 @@ def test_merge_compressed_and_uncompressed_backups_1(self):
329329# Initialize instance and backup directory
330330node = self .make_simple_node (
331331base_dir = os .path .join (module_name ,fname ,'node' ),
332- initdb_params = ["--data-checksums" ],
332+ set_replication = True , initdb_params = ["--data-checksums" ],
333333pg_options = {
334334'autovacuum' :'off'
335335 }
@@ -406,7 +406,7 @@ def test_merge_compressed_and_uncompressed_backups_2(self):
406406# Initialize instance and backup directory
407407node = self .make_simple_node (
408408base_dir = os .path .join (module_name ,fname ,'node' ),
409- initdb_params = ["--data-checksums" ],
409+ set_replication = True , initdb_params = ["--data-checksums" ],
410410pg_options = {
411411'autovacuum' :'off'
412412 }
@@ -1734,14 +1734,22 @@ def test_failed_merge_after_delete(self):
17341734backup_dir ,'backups' ,'node' ,
17351735full_id ,'database' ,'base' ,dboid )
17361736
1737- self .merge_backup (
1738- backup_dir ,'node' ,page_id_2 ,
1739- options = ['--log-level-console=verbose' ])
1740-
1741- #self.assertFalse(
1742- # os.path.isdir(db_path),
1743- # 'Directory {0} should not exist'.format(
1744- # db_path, full_id))
1737+ try :
1738+ self .merge_backup (
1739+ backup_dir ,'node' ,page_id_2 ,
1740+ options = ['--log-level-console=verbose' ])
1741+ self .assertEqual (
1742+ 1 ,0 ,
1743+ "Expecting Error because of missing parent.\n "
1744+ "Output: {0}\n CMD: {1}" .format (
1745+ repr (self .output ),self .cmd ))
1746+ except ProbackupException as e :
1747+ self .assertTrue (
1748+ "ERROR: Parent full backup for the given "
1749+ "backup {0} was not found" .format (
1750+ page_id_2 )in e .message ,
1751+ '\n Unexpected Error Message: {0}\n CMD: {1}' .format (
1752+ repr (e .message ),self .cmd ))
17451753
17461754self .del_test_dir (module_name ,fname )
17471755
@@ -1798,22 +1806,26 @@ def test_failed_merge_after_delete_1(self):
17981806
17991807gdb .set_breakpoint ('pgFileDelete' )
18001808gdb .continue_execution_until_break (30 )
1801-
18021809gdb ._execute ('signal SIGKILL' )
18031810
1804- # backup half-merged
1805- #self.assertEqual(
1806- # 'MERGING', self.show_pb(backup_dir, 'node')[0]['status'])
1807-
18081811self .assertEqual (
18091812full_id ,self .show_pb (backup_dir ,'node' )[0 ]['id' ])
18101813
18111814# restore
18121815node .cleanup ()
1813- self .restore_node (backup_dir ,'node' ,node )
1814-
1815- pgdata_restored = self .pgdata_content (node .data_dir )
1816- self .compare_pgdata (pgdata ,pgdata_restored )
1816+ try :
1817+ self .restore_node (backup_dir ,'node' ,node )
1818+ self .assertEqual (
1819+ 1 ,0 ,
1820+ "Expecting Error because of orphan status.\n "
1821+ "Output: {0}\n CMD: {1}" .format (
1822+ repr (self .output ),self .cmd ))
1823+ except ProbackupException as e :
1824+ self .assertIn (
1825+ "ERROR: Backup {0} is orphan" .format (page_1 ),
1826+ e .message ,
1827+ '\n Unexpected Error Message: {0}\n CMD: {1}' .format (
1828+ repr (e .message ),self .cmd ))
18171829
18181830self .del_test_dir (module_name ,fname )
18191831