Thread: pgsql: Enable almost all TAP tests involving symlinks on Windows

pgsql: Enable almost all TAP tests involving symlinks on Windows

From
Andrew Dunstan
Date:
Enable almost all TAP tests involving symlinks on Windows

Windows has junction points which function as symbolic links for
directories. This patch introduces a new function TestLib::dir_symlink()
which creates a junction point on Windows and a standard Unix type
symbolic link elsewhere.

The function TestLib::perl2host is also modified, first to use cygpath
where it's available (e.g. msys2) and second to allow it to succeed if
the gandparent directory exists but the parent does not.

Given these changes the only symlink tests that need to be skipped on
Windows are those related to permissions or to use of readlink. The
relevant tests for pg_basebackup and pg_rewind are therefore adjusted
accordingly.

Andrew Dunstan, reviewed by Peter Eisentraut and Michael Paquier.

Discussion: https://postgr.es/m/c50a646c-d9bb-7c62-a4bf-8256ff6ff338@2ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d66b23b032d75614e1be47ca182020960d89206d

Modified Files
--------------
src/bin/pg_basebackup/t/010_pg_basebackup.pl | 280 ++++++++++++++-------------
src/bin/pg_dump/t/010_dump_connstr.pl        |   4 +-
src/bin/pg_rewind/t/004_pg_xlog_symlink.pl   |  13 +-
src/test/perl/TestLib.pm                     |  73 ++++++-
4 files changed, 218 insertions(+), 152 deletions(-)