13
13
14
14
class BackupTest (ProbackupTest , unittest .TestCase ):
15
15
16
- def test_basic_full_backup (self ):
16
+ def test_full_backup (self ):
17
17
"""
18
18
Just test full backup with at least two segments
19
19
"""
@@ -45,6 +45,38 @@ def test_basic_full_backup(self):
45
45
# Clean after yourself
46
46
self .del_test_dir (module_name , fname )
47
47
48
+ def test_full_backup_stream (self ):
49
+ """
50
+ Just test full backup with at least two segments in stream mode
51
+ """
52
+ fname = self .id ().split ('.' )[3 ]
53
+ node = self .make_simple_node (
54
+ base_dir = os .path .join (module_name , fname , 'node' ),
55
+ initdb_params = ['--data-checksums' ],
56
+ # we need to write a lot. Lets speedup a bit.
57
+ pg_options = {"fsync" : "off" , "synchronous_commit" : "off" })
58
+
59
+ backup_dir = os .path .join (self .tmp_path , module_name , fname , 'backup' )
60
+ self .init_pb (backup_dir )
61
+ self .add_instance (backup_dir , 'node' , node )
62
+ node .slow_start ()
63
+
64
+ # Fill with data
65
+ # Have to use scale=100 to create second segment.
66
+ node .pgbench_init (scale = 100 , no_vacuum = True )
67
+
68
+ # FULL
69
+ backup_id = self .backup_node (backup_dir , 'node' , node ,
70
+ options = ["--stream" ])
71
+
72
+ out = self .validate_pb (backup_dir , 'node' , backup_id )
73
+ self .assertIn (
74
+ "INFO: Backup {0} is valid" .format (backup_id ),
75
+ out )
76
+
77
+ # Clean after yourself
78
+ self .del_test_dir (module_name , fname )
79
+
48
80
# @unittest.skip("skip")
49
81
# @unittest.expectedFailure
50
82
# PGPRO-707
0 commit comments