|
310 | 310 | [ @pg_basebackup_defs, '-D', "$tempdir/backup_foo", '-Fp', "-Tfoo" ],
|
311 | 311 | '-T with invalid format fails');
|
312 | 312 |
|
313 |
| -# Tar format doesn't support filenames longer than 100 bytes. |
314 |
| -# Create the test file via a short name directory so it doesn't blow the |
315 |
| -# Windows path limit. |
316 |
| -my $lftmp = PostgreSQL::Test::Utils::tempdir_short; |
317 |
| -dir_symlink "$pgdata", "$lftmp/pgdata"; |
318 | 313 | my $superlongname = "superlongname_" . ("x" x 100);
|
319 |
| -my $superlongpath = "$lftmp/pgdata/$superlongname"; |
| 314 | +# Tar format doesn't support filenames longer than 100 bytes. |
| 315 | +SKIP: |
| 316 | +{ |
| 317 | + my $superlongpath = "$pgdata/$superlongname"; |
320 | 318 |
|
321 |
| -open my $file, '>', "$superlongpath" |
322 |
| - or die "unable to create file $superlongpath"; |
323 |
| -close $file; |
324 |
| -$node->command_fails( |
325 |
| - [ @pg_basebackup_defs, '-D', "$tempdir/tarbackup_l1", '-Ft' ], |
326 |
| - 'pg_basebackup tar with long name fails'); |
327 |
| -unlink "$superlongpath"; |
| 319 | + skip "File path too long", 1 |
| 320 | + if $windows_os && length($superlongpath) > 255; |
| 321 | + |
| 322 | + open my $file, '>', "$superlongpath" |
| 323 | + or die "unable to create file $superlongpath"; |
| 324 | + close $file; |
| 325 | + $node->command_fails( |
| 326 | + [ @pg_basebackup_defs, '-D', "$tempdir/tarbackup_l1", '-Ft' ], |
| 327 | + 'pg_basebackup tar with long name fails'); |
| 328 | + unlink "$superlongpath"; |
| 329 | +} |
328 | 330 |
|
329 | 331 | # The following tests are for symlinks.
|
330 | 332 |
|
|
0 commit comments