|
196 | 196 | [ 'pg_basebackup', '-D', "$tempdir/backup_foo", '-Fp', "-Tfoo" ],
|
197 | 197 | '-T with invalid format fails');
|
198 | 198 |
|
199 |
| -# Tar format doesn't support filenames longer than 100 bytes. |
200 | 199 | my $superlongname = "superlongname_" . ("x" x 100);
|
201 |
| -my $superlongpath = "$pgdata/$superlongname"; |
| 200 | +# Tar format doesn't support filenames longer than 100 bytes. |
| 201 | +SKIP: |
| 202 | +{ |
| 203 | + my $superlongpath = "$pgdata/$superlongname"; |
202 | 204 |
|
203 |
| -open my $file, '>', "$superlongpath" |
204 |
| - or die "unable to create file $superlongpath"; |
205 |
| -close $file; |
206 |
| -$node->command_fails( |
207 |
| - [ 'pg_basebackup', '-D', "$tempdir/tarbackup_l1", '-Ft' ], |
208 |
| - 'pg_basebackup tar with long name fails'); |
209 |
| -unlink "$pgdata/$superlongname"; |
| 205 | + skip "File path too long", 1 |
| 206 | + if $windows_os && length($superlongpath) > 255; |
| 207 | + |
| 208 | + open my $file, '>', "$superlongpath" |
| 209 | + or die "unable to create file $superlongpath"; |
| 210 | + close $file; |
| 211 | + $node->command_fails( |
| 212 | + [ 'pg_basebackup', '-D', "$tempdir/tarbackup_l1", '-Ft' ], |
| 213 | + 'pg_basebackup tar with long name fails'); |
| 214 | + unlink "$superlongpath"; |
| 215 | +} |
210 | 216 |
|
211 | 217 | # The following tests test symlinks. Windows doesn't have symlinks, so
|
212 | 218 | # skip on Windows.
|
|
0 commit comments