]> granicus.if.org Git - postgresql/commitdiff
Fix searchpath and module location for pg_rewind and ssl TAP tests
authorAndrew Dunstan <andrew@dunslane.net>
Thu, 7 Feb 2019 15:22:49 +0000 (10:22 -0500)
committerAndrew Dunstan <andrew@dunslane.net>
Thu, 7 Feb 2019 16:10:34 +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 bdcab5688b9b7c3b825a208bdc3be6d635c7fe8d..1dfff3c8d2391a29e1d39638ffac5bf2f1655e96 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 598a5fe07acea0f11d16185df78baa5768cfefc1..a9568b2bf645ace3e254ec899c2d0a6b5d2192c1 100644 (file)
@@ -3,7 +3,7 @@ use warnings;
 use PostgresNode;
 use TestLib;
 use Test::More tests => 40;
-use ServerSetup;
+
 use File::Copy;
 
 # Like TestLib.pm, we use IPC::Run
@@ -19,6 +19,10 @@ BEGIN
          }
 }
 
+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 08b686215b3b254898c79bb03875b49fdf92b54d..f4a7730e94e51abafd5948311976695ff047075b 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;