@@ -3606,3 +3606,36 @@ def test_regress_issue_585(self):
36063606
36073607output = self .restore_node (backup_dir ,'node' ,node )
36083608self .assertNotRegex (output ,r'WARNING: [^\n]* was stored as .* but looks like' )
3609+
3610+ def test_2_delta_backups (self ):
3611+ """https://github.com/postgrespro/pg_probackup/issues/596"""
3612+ node = self .make_simple_node ('node' ,
3613+ initdb_params = ['--data-checksums' ])
3614+
3615+ backup_dir = os .path .join (self .tmp_path ,self .module_name ,self .fname ,'backup' )
3616+
3617+ self .init_pb (backup_dir )
3618+ self .add_instance (backup_dir ,'node' ,node )
3619+ # self.set_archiving(backup_dir, 'node', node)
3620+ node .slow_start ()
3621+
3622+ # FULL
3623+ full_backup_id = self .backup_node (backup_dir ,'node' ,node ,options = ["--stream" ])
3624+
3625+ # delta backup mode
3626+ delta_backup_id1 = self .backup_node (
3627+ backup_dir ,'node' ,node ,backup_type = "delta" ,options = ["--stream" ])
3628+
3629+ delta_backup_id2 = self .backup_node (
3630+ backup_dir ,'node' ,node ,backup_type = "delta" ,options = ["--stream" ])
3631+
3632+ # postgresql.conf and pg_hba.conf shouldn't be copied
3633+ conf_file = os .path .join (backup_dir ,'backups' ,'node' ,delta_backup_id1 ,'database' ,'postgresql.conf' )
3634+ self .assertFalse (
3635+ os .path .exists (conf_file ),
3636+ "File should not exist: {0}" .format (conf_file ))
3637+ conf_file = os .path .join (backup_dir ,'backups' ,'node' ,delta_backup_id2 ,'database' ,'postgresql.conf' )
3638+ print (conf_file )
3639+ self .assertFalse (
3640+ os .path .exists (conf_file ),
3641+ "File should not exist: {0}" .format (conf_file ))