]> 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:59 +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 d317f53186bf6362192f40febdd9be90babca104..a38bfc2b557c741bc1b3c2efba8502f48fd702a8 100644 (file)
@@ -7,6 +7,9 @@ use Test::More tests => 4;
 
 use File::Find;
 
+use FindBin;
+use lib $FindBin::RealBin;
+
 use RewindTest;
 
 
index c5f72e2e3cde4807c5f1e1d6df5974f6419a750b..2e4c092c19cdc05d678a1f400dd76b94f0f65adf 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 03a381f63600c4dc1bd167a32e0778c2a7b4a456..221c4bc1002710d599e1fbaa19ce062ed356a3d0 100644 (file)
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 use TestLib;
 use Test::More tests => 40;
-use ServerSetup;
+
 use File::Copy;
 
 # Like TestLib.pm, we use IPC::Run
@@ -18,6 +18,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 761c6f533bed8c2b269bc70b8831d88add47872f..6781fa049916bd32de178e4da3777248cf028faa 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;