@@ -127,10 +127,11 @@ def test_options_5(self):
127
127
self .init_pb (backup_dir ))
128
128
self .add_instance (backup_dir , 'node' , node )
129
129
130
- node .start ()
130
+ node .slow_start ()
131
131
132
132
# syntax error in pg_probackup.conf
133
- with open (os .path .join (backup_dir , "backups" , "node" , "pg_probackup.conf" ), "a" ) as conf :
133
+ conf_file = os .path .join (backup_dir , "backups" , "node" , "pg_probackup.conf" )
134
+ with open (conf_file , "a" ) as conf :
134
135
conf .write (" = INFINITE\n " )
135
136
try :
136
137
self .backup_node (backup_dir , 'node' , node )
@@ -139,15 +140,15 @@ def test_options_5(self):
139
140
repr (self .output ), self .cmd ))
140
141
except ProbackupException as e :
141
142
self .assertEqual (e .message ,
142
- 'ERROR: syntax error in " = INFINITE"\n ' ,
143
+ 'ERROR: Syntax error in " = INFINITE"\n ' ,
143
144
'\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ), self .cmd ))
144
145
145
146
self .clean_pb (backup_dir )
146
147
self .init_pb (backup_dir )
147
148
self .add_instance (backup_dir , 'node' , node )
148
149
149
150
# invalid value in pg_probackup.conf
150
- with open (os . path . join ( backup_dir , "backups" , "node" , "pg_probackup.conf" ) , "a" ) as conf :
151
+ with open (conf_file , "a" ) as conf :
151
152
conf .write ("BACKUP_MODE=\n " )
152
153
153
154
try :
@@ -157,15 +158,15 @@ def test_options_5(self):
157
158
repr (self .output ), self .cmd ))
158
159
except ProbackupException as e :
159
160
self .assertEqual (e .message ,
160
- 'ERROR: invalid backup-mode "" \n ' ,
161
+ 'ERROR: Invalid option "BACKUP_MODE" in file "{0}" \n ' . format ( conf_file ) ,
161
162
'\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ), self .cmd ))
162
163
163
164
self .clean_pb (backup_dir )
164
165
self .init_pb (backup_dir )
165
166
self .add_instance (backup_dir , 'node' , node )
166
167
167
168
# Command line parameters should override file values
168
- with open (os . path . join ( backup_dir , "backups" , "node" , "pg_probackup.conf" ) , "a" ) as conf :
169
+ with open (conf_file , "a" ) as conf :
169
170
conf .write ("retention-redundancy=1\n " )
170
171
171
172
self .assertEqual (self .show_config (backup_dir , 'node' )['retention-redundancy' ], '1' )
@@ -178,11 +179,11 @@ def test_options_5(self):
178
179
repr (self .output ), self .cmd ))
179
180
except ProbackupException as e :
180
181
self .assertEqual (e .message ,
181
- 'ERROR: option system-identifier cannot be specified in command line\n ' ,
182
+ 'ERROR: Option system-identifier cannot be specified in command line\n ' ,
182
183
'\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ), self .cmd ))
183
184
184
185
# invalid value in pg_probackup.conf
185
- with open (os . path . join ( backup_dir , "backups" , "node" , "pg_probackup.conf" ) , "a" ) as conf :
186
+ with open (conf_file , "a" ) as conf :
186
187
conf .write ("SMOOTH_CHECKPOINT=FOO\n " )
187
188
188
189
try :
@@ -192,16 +193,15 @@ def test_options_5(self):
192
193
repr (self .output ), self .cmd ))
193
194
except ProbackupException as e :
194
195
self .assertEqual (e .message ,
195
- " ERROR: option -C, --smooth-checkpoint should be a boolean: 'FOO' \n " ,
196
+ ' ERROR: Invalid option "SMOOTH_CHECKPOINT" in file "{0}" \n ' . format ( conf_file ) ,
196
197
'\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ), self .cmd ))
197
198
198
199
self .clean_pb (backup_dir )
199
200
self .init_pb (backup_dir )
200
201
self .add_instance (backup_dir , 'node' , node )
201
202
202
203
# invalid option in pg_probackup.conf
203
- pbconf_path = os .path .join (backup_dir , "backups" , "node" , "pg_probackup.conf" )
204
- with open (pbconf_path , "a" ) as conf :
204
+ with open (conf_file , "a" ) as conf :
205
205
conf .write ("TIMELINEID=1\n " )
206
206
207
207
try :
@@ -211,7 +211,7 @@ def test_options_5(self):
211
211
repr (self .output ), self .cmd ))
212
212
except ProbackupException as e :
213
213
self .assertEqual (e .message ,
214
- 'ERROR: invalid option "TIMELINEID" in file "{0}"\n ' .format (pbconf_path ),
214
+ 'ERROR: Invalid option "TIMELINEID" in file "{0}"\n ' .format (conf_file ),
215
215
'\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ), self .cmd ))
216
216
217
217
# Clean after yourself
0 commit comments