Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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:09:41 +0000 (11:09 -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/002_scram.pl
src/test/ssl/t/SSLServer.pm [moved from src/test/ssl/ServerSetup.pm with 99% similarity]

index 53dbf45be29d394e53e4bd78710e72f70f257058..115192170e56819ad777053f65c0f45d227d8c17 100644 (file)
@@ -3,6 +3,9 @@ use warnings;
 use TestLib;
 use Test::More tests => 10;
 
+use FindBin;
+use lib $FindBin::RealBin;
+
 use RewindTest;
 
 sub run_test
index 2c9e427831139ac4cc7235298fcb76965bb80bd2..6dc05720a1e55fe5c337c2b2bc4d7de76b496006 100644 (file)
@@ -3,6 +3,9 @@ use warnings;
 use TestLib;
 use Test::More tests => 6;
 
+use FindBin;
+use lib $FindBin::RealBin;
+
 use RewindTest;
 
 sub run_test
index 496f38c4570c52eef1d5db41d86f420cab18b7fb..c4040bd5620d5eabb2eceaef9157a5fc64ec2032 100644 (file)
@@ -7,6 +7,9 @@ use Test::More tests => 4;
 
 use File::Find;
 
+use FindBin;
+use lib $FindBin::RealBin;
+
 use RewindTest;
 
 
index 280eceb9929f41791453c47b095921d9bd96e96c..ed1ddb6b60cb4ca19819ca3a321166432b667bfc 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 e550207454daaf180b2419ce9c242e0c11399f0d..39ede38c992822da5391b213a46dbdeb5b2da0f5 100644 (file)
@@ -3,9 +3,14 @@ use warnings;
 use PostgresNode;
 use TestLib;
 use Test::More;
-use ServerSetup;
+
 use File::Copy;
 
+use FindBin;
+use lib $FindBin::RealBin;
+
+use SSLServer;
+
 if ($ENV{with_openssl} eq 'yes')
 {
    plan tests => 64;
index b460a7fa8ae5aa4f314c702fa376696819a797d1..3ebb3db4b6531ee6ced2d6e5c3ef77a28c74f536 100644 (file)
@@ -5,9 +5,14 @@ use warnings;
 use PostgresNode;
 use TestLib;
 use Test::More;
-use ServerSetup;
+
 use File::Copy;
 
+use FindBin;
+use lib $FindBin::RealBin;
+
+use SSLServer;
+
 if ($ENV{with_openssl} ne 'yes')
 {
    plan skip_all => 'SSL not supported by this build';
similarity index 99%
rename from src/test/ssl/ServerSetup.pm
rename to src/test/ssl/t/SSLServer.pm
index 5ffc0b5385dc769ea6122d28ae0f6c80f1436780..b58277bd8caf358930a2d2f3c35fe5aa6a92a982 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;