@@ -10,10 +10,12 @@ class BackupTest(ProbackupTest, unittest.TestCase):
10
10
def __init__ (self ,* args ,** kwargs ):
11
11
super (BackupTest ,self ).__init__ (* args ,** kwargs )
12
12
13
- # @classmethod
14
- # def tearDownClass(cls):
15
- # stop_all()
16
- # @unittest.skip("123")
13
+ @classmethod
14
+ def tearDownClass (cls ):
15
+ stop_all ()
16
+
17
+ # @unittest.skip("skip")
18
+ # @unittest.expectedFailure
17
19
def test_backup_modes_archive (self ):
18
20
"""standart backup modes with ARCHIVE WAL method"""
19
21
fname = self .id ().split ('.' )[3 ]
@@ -26,8 +28,10 @@ def test_backup_modes_archive(self):
26
28
self .assertEqual (self .init_pb (node ),six .b ("" ))
27
29
28
30
# full backup mode
29
- with open (path .join (node .logs_dir ,"backup_full.log" ),"wb" )as backup_log :
30
- backup_log .write (self .backup_pb (node ,options = ["--verbose" ]))
31
+ #with open(path.join(node.logs_dir, "backup_full.log"), "wb") as backup_log:
32
+ # backup_log.write(self.backup_pb(node, options=["--verbose"]))
33
+
34
+ self .backup_pb (node )
31
35
32
36
show_backup = self .show_pb (node )[0 ]
33
37
full_backup_id = show_backup ['ID' ]
@@ -46,8 +50,7 @@ def test_backup_modes_archive(self):
46
50
self .assertEqual (excluded ,True )
47
51
48
52
# page backup mode
49
- with open (path .join (node .logs_dir ,"backup_page.log" ),"wb" )as backup_log :
50
- backup_log .write (self .backup_pb (node ,backup_type = "page" ,options = ["--verbose" ]))
53
+ self .backup_pb (node ,backup_type = "page" )
51
54
52
55
# print self.show_pb(node)
53
56
show_backup = self .show_pb (node )[1 ]
@@ -60,16 +63,14 @@ def test_backup_modes_archive(self):
60
63
self .show_pb (node ,id = show_backup ['ID' ])["parent-backup-id" ])
61
64
62
65
# ptrack backup mode
63
- with open (path .join (node .logs_dir ,"backup_ptrack.log" ),"wb" )as backup_log :
64
- backup_log .write (self .backup_pb (node ,backup_type = "ptrack" ,options = ["--verbose" ]))
66
+ self .backup_pb (node ,backup_type = "ptrack" )
65
67
66
68
show_backup = self .show_pb (node )[2 ]
67
69
self .assertEqual (show_backup ['Status' ],six .b ("OK" ))
68
70
self .assertEqual (show_backup ['Mode' ],six .b ("PTRACK" ))
69
71
70
72
node .stop ()
71
73
72
- # @unittest.skip("123")
73
74
def test_smooth_checkpoint (self ):
74
75
"""full backup with smooth checkpoint"""
75
76
fname = self .id ().split ('.' )[3 ]
@@ -81,14 +82,12 @@ def test_smooth_checkpoint(self):
81
82
node .start ()
82
83
self .assertEqual (self .init_pb (node ),six .b ("" ))
83
84
84
- with open (path .join (node .logs_dir ,"backup.log" ),"wb" )as backup_log :
85
- backup_log .write (self .backup_pb (node ,options = ["--verbose" ,"-C" ]))
85
+ self .backup_pb (node ,options = ["-C" ])
86
86
87
87
self .assertEqual (self .show_pb (node )[0 ]['Status' ],six .b ("OK" ))
88
88
89
89
node .stop ()
90
90
91
- # @unittest.skip("123")
92
91
def test_page_backup_without_full (self ):
93
92
"""page-level backup without validated full backup"""
94
93
fname = self .id ().split ('.' )[3 ]
@@ -101,14 +100,13 @@ def test_page_backup_without_full(self):
101
100
self .assertEqual (self .init_pb (node ),six .b ("" ))
102
101
103
102
try :
104
- self .backup_pb (node ,backup_type = "page" , options = [ "--verbose" ] )
103
+ self .backup_pb (node ,backup_type = "page" )
105
104
except ProbackupException ,e :
106
105
pass
107
106
self .assertEqual (self .show_pb (node )[0 ]['Status' ],six .b ("ERROR" ))
108
107
109
108
node .stop ()
110
109
111
- # @unittest.skip("123")
112
110
def test_ptrack_threads (self ):
113
111
"""ptrack multi thread backup mode"""
114
112
fname = self .id ().split ('.' )[3 ]
@@ -120,19 +118,17 @@ def test_ptrack_threads(self):
120
118
node .start ()
121
119
self .assertEqual (self .init_pb (node ),six .b ("" ))
122
120
123
- with open (path .join (node .logs_dir ,"backup_full.log" ),"wb" )as backup_log :
124
- backup_log .write (self .backup_pb (node ,backup_type = "full" ,options = ["--verbose" ,"-j" ,"4" ]))
121
+ self .backup_pb (node ,backup_type = "full" ,options = ["-j" ,"4" ])
125
122
126
123
self .assertEqual (self .show_pb (node )[0 ]['Status' ],six .b ("OK" ))
127
124
128
125
with open (path .join (node .logs_dir ,"backup_ptrack.log" ),"wb" )as backup_log :
129
- backup_log .write (self .backup_pb (node ,backup_type = "ptrack" ,options = ["--verbose" , "- j" ,"4" ]))
126
+ backup_log .write (self .backup_pb (node ,backup_type = "ptrack" ,options = ["-j" ,"4" ]))
130
127
131
128
self .assertEqual (self .show_pb (node )[0 ]['Status' ],six .b ("OK" ))
132
129
133
130
node .stop ()
134
131
135
- # @unittest.skip("123")
136
132
def test_ptrack_threads_stream (self ):
137
133
"""ptrack multi thread backup mode and stream"""
138
134
fname = self .id ().split ('.' )[3 ]
@@ -144,21 +140,11 @@ def test_ptrack_threads_stream(self):
144
140
node .start ()
145
141
self .assertEqual (self .init_pb (node ),six .b ("" ))
146
142
147
- with open (path .join (node .logs_dir ,"backup_full.log" ),"wb" )as backup_log :
148
- backup_log .write (self .backup_pb (
149
- node ,
150
- backup_type = "full" ,
151
- options = ["--verbose" ,"-j" ,"4" ,"--stream" ]
152
- ))
143
+ self .backup_pb (node ,backup_type = "full" ,options = ["-j" ,"4" ,"--stream" ])
153
144
154
145
self .assertEqual (self .show_pb (node )[0 ]['Status' ],six .b ("OK" ))
155
146
156
- with open (path .join (node .logs_dir ,"backup_ptrack.log" ),"wb" )as backup_log :
157
- backup_log .write (self .backup_pb (
158
- node ,
159
- backup_type = "ptrack" ,
160
- options = ["--verbose" ,"-j" ,"4" ,"--stream" ]
161
- ))
147
+ self .backup_pb (node ,backup_type = "ptrack" ,options = ["-j" ,"4" ,"--stream" ])
162
148
163
149
self .assertEqual (self .show_pb (node )[1 ]['Status' ],six .b ("OK" ))
164
150
node .stop ()