diff options
author | Andrew Dunstan | 2019-02-07 15:22:49 +0000 |
---|---|---|
committer | Andrew Dunstan | 2019-02-07 16:09:08 +0000 |
commit | 8ce641f99709669133c6cbb12aa3d516af7897aa (patch) | |
tree | f2a9227221de33c7ddfa0048a09baff6b05bbe4d | |
parent | 0c1f8f166cb6273ab9c06a5f3c2ebedbf36f93e9 (diff) |
Fix searchpath and module location for pg_rewind and ssl TAP tests
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/[email protected]
Backpatch as appropriate to 9.5
-rw-r--r-- | src/bin/pg_rewind/t/001_basic.pl | 3 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/002_databases.pl | 3 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/003_extrafiles.pl | 3 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/004_pg_xlog_symlink.pl | 3 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/005_same_timeline.pl | 3 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/RewindTest.pm (renamed from src/bin/pg_rewind/RewindTest.pm) | 0 | ||||
-rw-r--r-- | src/test/ssl/t/001_ssltests.pl | 7 | ||||
-rw-r--r-- | src/test/ssl/t/002_scram.pl | 7 | ||||
-rw-r--r-- | src/test/ssl/t/SSLServer.pm (renamed from src/test/ssl/ServerSetup.pm) | 2 |
9 files changed, 28 insertions, 3 deletions
diff --git a/src/bin/pg_rewind/t/001_basic.pl b/src/bin/pg_rewind/t/001_basic.pl index 53dbf45be2..115192170e 100644 --- a/src/bin/pg_rewind/t/001_basic.pl +++ b/src/bin/pg_rewind/t/001_basic.pl @@ -3,6 +3,9 @@ use warnings; use TestLib; use Test::More tests => 10; +use FindBin; +use lib $FindBin::RealBin; + use RewindTest; sub run_test diff --git a/src/bin/pg_rewind/t/002_databases.pl b/src/bin/pg_rewind/t/002_databases.pl index 2c9e427831..6dc05720a1 100644 --- a/src/bin/pg_rewind/t/002_databases.pl +++ b/src/bin/pg_rewind/t/002_databases.pl @@ -3,6 +3,9 @@ use warnings; use TestLib; use Test::More tests => 6; +use FindBin; +use lib $FindBin::RealBin; + use RewindTest; sub run_test diff --git a/src/bin/pg_rewind/t/003_extrafiles.pl b/src/bin/pg_rewind/t/003_extrafiles.pl index 496f38c457..c4040bd562 100644 --- a/src/bin/pg_rewind/t/003_extrafiles.pl +++ b/src/bin/pg_rewind/t/003_extrafiles.pl @@ -7,6 +7,9 @@ use Test::More tests => 4; use File::Find; +use FindBin; +use lib $FindBin::RealBin; + use RewindTest; diff --git a/src/bin/pg_rewind/t/004_pg_xlog_symlink.pl b/src/bin/pg_rewind/t/004_pg_xlog_symlink.pl index 280eceb992..ed1ddb6b60 100644 --- a/src/bin/pg_rewind/t/004_pg_xlog_symlink.pl +++ b/src/bin/pg_rewind/t/004_pg_xlog_symlink.pl @@ -17,6 +17,9 @@ else plan tests => 4; } +use FindBin; +use lib $FindBin::RealBin; + use RewindTest; sub run_test diff --git a/src/bin/pg_rewind/t/005_same_timeline.pl b/src/bin/pg_rewind/t/005_same_timeline.pl index 0e334ee191..40dbc44caa 100644 --- a/src/bin/pg_rewind/t/005_same_timeline.pl +++ b/src/bin/pg_rewind/t/005_same_timeline.pl @@ -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 diff --git a/src/bin/pg_rewind/RewindTest.pm b/src/bin/pg_rewind/t/RewindTest.pm index 85cae7e47b..85cae7e47b 100644 --- a/src/bin/pg_rewind/RewindTest.pm +++ b/src/bin/pg_rewind/t/RewindTest.pm diff --git a/src/test/ssl/t/001_ssltests.pl b/src/test/ssl/t/001_ssltests.pl index 915007805e..2f6dfad23c 100644 --- a/src/test/ssl/t/001_ssltests.pl +++ b/src/test/ssl/t/001_ssltests.pl @@ -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 => 71; diff --git a/src/test/ssl/t/002_scram.pl b/src/test/ssl/t/002_scram.pl index d45b9c5db3..e636efa54d 100644 --- a/src/test/ssl/t/002_scram.pl +++ b/src/test/ssl/t/002_scram.pl @@ -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'; diff --git a/src/test/ssl/ServerSetup.pm b/src/test/ssl/t/SSLServer.pm index 5acba52310..b1b5b7f0b3 100644 --- a/src/test/ssl/ServerSetup.pm +++ b/src/test/ssl/t/SSLServer.pm @@ -24,7 +24,7 @@ # explicitly because an invalid sslcert or sslrootcert, respectively, # causes those to be ignored.) -package ServerSetup; +package SSLServer; use strict; use warnings; |