@@ -127,10 +127,11 @@ def test_options_5(self):
127127 self .init_pb (backup_dir ))
128128 self .add_instance (backup_dir , 'node' , node )
129129
130- node .start ()
130+ node .slow_start ()
131131
132132 # 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 :
134135 conf .write (" = INFINITE\n " )
135136 try :
136137 self .backup_node (backup_dir , 'node' , node )
@@ -139,15 +140,15 @@ def test_options_5(self):
139140 repr (self .output ), self .cmd ))
140141 except ProbackupException as e :
141142 self .assertEqual (e .message ,
142- 'ERROR: syntax error in " = INFINITE"\n ' ,
143+ 'ERROR: Syntax error in " = INFINITE"\n ' ,
143144 '\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ), self .cmd ))
144145
145146 self .clean_pb (backup_dir )
146147 self .init_pb (backup_dir )
147148 self .add_instance (backup_dir , 'node' , node )
148149
149150 # 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 :
151152 conf .write ("BACKUP_MODE=\n " )
152153
153154 try :
@@ -157,15 +158,15 @@ def test_options_5(self):
157158 repr (self .output ), self .cmd ))
158159 except ProbackupException as e :
159160 self .assertEqual (e .message ,
160- 'ERROR: invalid backup-mode "" \n ' ,
161+ 'ERROR: Invalid option "BACKUP_MODE" in file "{0}" \n ' . format ( conf_file ) ,
161162 '\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ), self .cmd ))
162163
163164 self .clean_pb (backup_dir )
164165 self .init_pb (backup_dir )
165166 self .add_instance (backup_dir , 'node' , node )
166167
167168 # 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 :
169170 conf .write ("retention-redundancy=1\n " )
170171
171172 self .assertEqual (self .show_config (backup_dir , 'node' )['retention-redundancy' ], '1' )
@@ -178,11 +179,11 @@ def test_options_5(self):
178179 repr (self .output ), self .cmd ))
179180 except ProbackupException as e :
180181 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 ' ,
182183 '\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ), self .cmd ))
183184
184185 # 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 :
186187 conf .write ("SMOOTH_CHECKPOINT=FOO\n " )
187188
188189 try :
@@ -192,16 +193,15 @@ def test_options_5(self):
192193 repr (self .output ), self .cmd ))
193194 except ProbackupException as e :
194195 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 ) ,
196197 '\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ), self .cmd ))
197198
198199 self .clean_pb (backup_dir )
199200 self .init_pb (backup_dir )
200201 self .add_instance (backup_dir , 'node' , node )
201202
202203 # 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 :
205205 conf .write ("TIMELINEID=1\n " )
206206
207207 try :
@@ -211,7 +211,7 @@ def test_options_5(self):
211211 repr (self .output ), self .cmd ))
212212 except ProbackupException as e :
213213 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 ),
215215 '\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ), self .cmd ))
216216
217217 # Clean after yourself
0 commit comments