aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2019-02-07 10:22:49 -0500
committerAndrew Dunstan <andrew@dunslane.net>2019-02-07 11:10:59 -0500
commit7b8c6ef1e05fede7123bed5a3af4b780da241b4e (patch)
treecebb56a2b6231d588c39c4633a8fc1d93b8aa703 /src
parent27293553f4c00fee0448b2c17bc7fc8099a8278e (diff)
downloadpostgresql-7b8c6ef1e05fede7123bed5a3af4b780da241b4e.tar.gz
postgresql-7b8c6ef1e05fede7123bed5a3af4b780da241b4e.zip
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/e4b0f366-269c-73c3-9c90-d9cb0f4db1f9@2ndQuadrant.com Backpatch as appropriate to 9.5
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_rewind/t/001_basic.pl3
-rw-r--r--src/bin/pg_rewind/t/002_databases.pl3
-rw-r--r--src/bin/pg_rewind/t/003_extrafiles.pl3
-rw-r--r--src/bin/pg_rewind/t/004_pg_xlog_symlink.pl3
-rw-r--r--src/bin/pg_rewind/t/005_same_timeline.pl3
-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.pl6
-rw-r--r--src/test/ssl/t/SSLServer.pm (renamed from src/test/ssl/ServerSetup.pm)2
8 files changed, 21 insertions, 2 deletions
diff --git a/src/bin/pg_rewind/t/001_basic.pl b/src/bin/pg_rewind/t/001_basic.pl
index 1764b17c907..0008717c300 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 => 8;
+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 20bdb4ab59d..8e63e5b6b96 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 => 4;
+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 d317f53186b..a38bfc2b557 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 c5f72e2e3cd..2e4c092c19c 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 0e334ee191a..40dbc44caa3 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 734adb72ec5..734adb72ec5 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 03a381f6360..221c4bc1002 100644
--- a/src/test/ssl/t/001_ssltests.pl
+++ b/src/test/ssl/t/001_ssltests.pl
@@ -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
diff --git a/src/test/ssl/ServerSetup.pm b/src/test/ssl/t/SSLServer.pm
index 761c6f533be..6781fa04991 100644
--- a/src/test/ssl/ServerSetup.pm
+++ b/src/test/ssl/t/SSLServer.pm
@@ -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;