|
261 | 261 | # for the tablespace directories, which hopefully won't run afoul of
|
262 | 262 | # the 99 character length limit.
|
263 | 263 | my$sys_tempdir = PostgreSQL::Test::Utils::tempdir_short;
|
264 |
| -my$real_sys_tempdir = PostgreSQL::Test::Utils::perl2host($sys_tempdir) ."/tempdir"; |
265 |
| -my$shorter_tempdir =$sys_tempdir ."/tempdir"; |
266 |
| -dir_symlink"$tempdir",$shorter_tempdir; |
| 264 | +my$real_sys_tempdir ="$sys_tempdir/tempdir"; |
| 265 | +dir_symlink"$tempdir",$real_sys_tempdir; |
267 | 266 |
|
268 | 267 | mkdir"$tempdir/tblspc1";
|
269 | 268 | my$realTsDir ="$real_sys_tempdir/tblspc1";
|
270 |
| -my$real_tempdir = PostgreSQL::Test::Utils::perl2host($tempdir); |
271 | 269 | $node->safe_psql('postgres',
|
272 | 270 | "CREATE TABLESPACE tblspc1 LOCATION '$realTsDir';");
|
273 | 271 | $node->safe_psql('postgres',
|
|
346 | 344 | foreachmy$filename (@tempRelationFiles)
|
347 | 345 | {
|
348 | 346 | append_to_file(
|
349 |
| -"$shorter_tempdir/tblspc1/$tblSpc1Id/$postgresOid/$filename", |
| 347 | +"$real_sys_tempdir/tblspc1/$tblSpc1Id/$postgresOid/$filename", |
350 | 348 | 'TEMP_RELATION');
|
351 | 349 | }
|
352 | 350 |
|
|
358 | 356 | [
|
359 | 357 | @pg_basebackup_defs,'-D',
|
360 | 358 | "$tempdir/backup1",'-Fp',
|
361 |
| -"-T$realTsDir=$real_tempdir/tbackup/tblspc1", |
| 359 | +"-T$realTsDir=$tempdir/tbackup/tblspc1", |
362 | 360 | ],
|
363 | 361 | 'plain format with tablespaces succeeds with tablespace mapping');
|
364 | 362 | ok(-d"$tempdir/tbackup/tblspc1",'tablespace was relocated');
|
|
406 | 404 |
|
407 | 405 | # Also remove temp relation files or tablespace drop will fail.
|
408 | 406 | my$filepath =
|
409 |
| -"$shorter_tempdir/tblspc1/$tblSpc1Id/$postgresOid/$filename"; |
| 407 | +"$real_sys_tempdir/tblspc1/$tblSpc1Id/$postgresOid/$filename"; |
410 | 408 |
|
411 | 409 | unlink($filepath)
|
412 | 410 | or BAIL_OUT("unable to unlink$filepath");
|
|
428 | 426 | [
|
429 | 427 | @pg_basebackup_defs,'-D',
|
430 | 428 | "$tempdir/backup3",'-Fp',
|
431 |
| -"-T$realTsDir=$real_tempdir/tbackup/tbl\\=spc2", |
| 429 | +"-T$realTsDir=$tempdir/tbackup/tbl\\=spc2", |
432 | 430 | ],
|
433 | 431 | 'mapping tablespace with = sign in path');
|
434 | 432 | ok(-d"$tempdir/tbackup/tbl=spc2",'tablespace with = sign was relocated');
|
|
517 | 515 | [@pg_basebackup_defs,'--target','blackhole','-X','none' ],
|
518 | 516 | 'backup target blackhole');
|
519 | 517 | $node->command_ok(
|
520 |
| -[@pg_basebackup_defs,'--target',"server:$real_tempdir/backuponserver",'-X','none' ], |
| 518 | +[@pg_basebackup_defs,'--target',"server:$tempdir/backuponserver",'-X','none' ], |
521 | 519 | 'backup target server');
|
522 | 520 | ok(-f"$tempdir/backuponserver/base.tar",'backup tar was created');
|
523 | 521 | rmtree("$tempdir/backuponserver");
|
|
526 | 524 | [qw(createuser --replication --role=pg_write_server_files backupuser)],
|
527 | 525 | 'create backup user');
|
528 | 526 | $node->command_ok(
|
529 |
| -[@pg_basebackup_defs,'-U','backupuser','--target',"server:$real_tempdir/backuponserver",'-X','none' ], |
| 527 | +[@pg_basebackup_defs,'-U','backupuser','--target',"server:$tempdir/backuponserver",'-X','none' ], |
530 | 528 | 'backup target server');
|
531 | 529 | ok(-f"$tempdir/backuponserver/base.tar",'backup tar was created as non-superuser');
|
532 | 530 | rmtree("$tempdir/backuponserver");
|
|