Fix searchpath and module location for pg_rewind and ssl TAP tests
authorAndrew Dunstan
Thu, 7 Feb 2019 15:22:49 +0000 (10:22 -0500)
committerAndrew Dunstan
Thu, 7 Feb 2019 16:10:06 +0000 (11:10 -0500)
The modules RewindTest.pm and ServerSetup.pm are really only useful for
TAP tests, so they really belong in the TAP test directories. In
addition, ServerSetup.pm is renamed to SSLServer.pm.

The test scripts have their own directories added to the search path so
that the relocated modules will be found, regardless of where the tests
are run from, even on modern perl where "." is no longer in the
searchpath.

Discussion: https://postgr.es/m/e4b0f366-269c-73c3-9c90-d9cb0f4db1f9@2ndQuadrant.com

Backpatch as appropriate to 9.5

src/bin/pg_rewind/t/001_basic.pl
src/bin/pg_rewind/t/002_databases.pl
src/bin/pg_rewind/t/003_extrafiles.pl
src/bin/pg_rewind/t/004_pg_xlog_symlink.pl
src/bin/pg_rewind/t/005_same_timeline.pl
src/bin/pg_rewind/t/RewindTest.pm [moved from src/bin/pg_rewind/RewindTest.pm with 100% similarity]
src/test/ssl/t/001_ssltests.pl
src/test/ssl/t/SSLServer.pm [moved from src/test/ssl/ServerSetup.pm with 99% similarity]

index 1764b17c907a1c6591b0f2776ac4cd5518cdf9f7..0008717c3005fbd0e918c3a4791dcb6519cd7476 100644 (file)
@@ -3,6 +3,9 @@ use warnings;
 use TestLib;
 use Test::More tests => 8;
 
+use FindBin;
+use lib $FindBin::RealBin;
+
 use RewindTest;
 
 sub run_test
index 20bdb4ab59dfa0ee90ac8e0f213109f441c9f017..8e63e5b6b96dd783be997524933c080ad6006bfb 100644 (file)
@@ -3,6 +3,9 @@ use warnings;
 use TestLib;
 use Test::More tests => 4;
 
+use FindBin;
+use lib $FindBin::RealBin;
+
 use RewindTest;
 
 sub run_test
index cedde1409bc9c278264dcb85a298174997637221..2badab54fc3d64fe60d690a62f5ec97699aa8613 100644 (file)
@@ -7,6 +7,9 @@ use Test::More tests => 4;
 
 use File::Find;
 
+use FindBin;
+use lib $FindBin::RealBin;
+
 use RewindTest;
 
 
index 12950ea1ca60e0865edaeb278d66b9b03944917a..164d6f197ec8c4a09835c3f7ddd5b98de7f8f4c6 100644 (file)
@@ -17,6 +17,9 @@ else
    plan tests => 4;
 }
 
+use FindBin;
+use lib $FindBin::RealBin;
+
 use RewindTest;
 
 sub run_test
index 0e334ee191aa24f919d2202b8f06eee0c3724642..40dbc44caa3ac1077611ccb0944614ee84e1656d 100644 (file)
@@ -3,6 +3,9 @@ use warnings;
 use TestLib;
 use Test::More tests => 1;
 
+use FindBin;
+use lib $FindBin::RealBin;
+
 use RewindTest;
 
 # Test that running pg_rewind if the two clusters are on the same
index 32df27392956d40900e6c49069468c53093a7017..95e38efef303c1b115165f09f42d8b9aff66e778 100644 (file)
@@ -3,9 +3,14 @@ use warnings;
 use PostgresNode;
 use TestLib;
 use Test::More tests => 40;
-use ServerSetup;
+
 use File::Copy;
 
+use FindBin;
+use lib $FindBin::RealBin;
+
+use SSLServer;
+
 #### Some configuration
 
 # This is the hostname used to connect to the server. This cannot be a
similarity index 99%
rename from src/test/ssl/ServerSetup.pm
rename to src/test/ssl/t/SSLServer.pm
index f63c81cfc67bb9de9c016c583a88dcc4a2d12642..c2a50300d279aae54fee7bc22ba78d7364b9cc8d 100644 (file)
@@ -14,7 +14,7 @@
 # The server is configured to only accept connections from localhost. If you
 # want to run the client from another host, you'll have to configure that
 # manually.
-package ServerSetup;
+package SSLServer;
 
 use strict;
 use warnings;