|
11 | 11 | use TestLib; |
12 | 12 |
|
13 | 13 | use Fcntl qw(:seek); |
14 | | -use Test::More tests => 69; |
| 14 | +use Test::More tests => 66; |
15 | 15 |
|
16 | 16 |
|
17 | 17 | # Utility routine to create and check a table with corrupted checksums |
@@ -181,34 +181,25 @@ sub check_relation_corruption |
181 | 181 |
|
182 | 182 | # Test postgres -C for an offline cluster. |
183 | 183 | # Run-time GUCs are safe to query here. Note that a lock file is created, |
184 | | -# then unlinked, leading to an extra LOG entry showing in stderr. |
185 | | -SKIP: |
186 | | -{ |
187 | | - skip "unstable output generated with Msys", 3 |
188 | | - if ($Config{osname} eq 'msys'); |
189 | | - command_checks_all( |
190 | | - [ 'postgres', '-D', $pgdata, '-C', 'data_checksums' ], |
191 | | - 0, |
192 | | - [qr/^on$/], |
193 | | - # LOG entry when unlinking lock file. |
194 | | - [qr/database system is shut down/], |
195 | | - 'data_checksums=on is reported on an offline cluster'); |
196 | | -} |
| 184 | +# then removed, leading to an extra LOG entry showing in stderr. This uses |
| 185 | +# log_min_messages=fatal to remove any noise. This test uses a startup |
| 186 | +# wrapped with pg_ctl to allow the case where this runs under a privileged |
| 187 | +# account on Windows. |
| 188 | +command_checks_all( |
| 189 | + [ |
| 190 | + 'pg_ctl', 'start', '-D', $pgdata, '-s', '-o', |
| 191 | + '-C data_checksums -c log_min_messages=fatal' |
| 192 | + ], |
| 193 | + 1, |
| 194 | + [qr/^on$/], |
| 195 | + [qr/could not start server/], |
| 196 | + 'data_checksums=on is reported on an offline cluster'); |
197 | 197 |
|
198 | 198 | # Checks cannot happen with an online cluster |
199 | 199 | $node->start; |
200 | 200 | command_fails([ 'pg_checksums', '--check', '-D', $pgdata ], |
201 | 201 | "fails with online cluster"); |
202 | 202 |
|
203 | | -# Test postgres -C on an online cluster. |
204 | | -command_fails_like( |
205 | | - [ 'postgres', '-D', $pgdata, '-C', 'data_checksums' ], |
206 | | - qr/lock file .* already exists/, |
207 | | - 'data_checksums is not reported on an online cluster'); |
208 | | -command_ok( |
209 | | - [ 'postgres', '-D', $pgdata, '-C', 'work_mem' ], |
210 | | - 'non-runtime parameter is reported on an online cluster'); |
211 | | - |
212 | 203 | # Check corruption of table on default tablespace. |
213 | 204 | check_relation_corruption($node, 'corrupt1', 'pg_default'); |
214 | 205 |
|
|
0 commit comments