aboutsummaryrefslogtreecommitdiff
path: root/src/test/modules
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2021-07-29 05:58:08 -0400
committerAndrew Dunstan <andrew@dunslane.net>2021-07-29 05:58:08 -0400
commit201a76183e2056c2217129e12d68c25ec9c559c8 (patch)
treef25c8d8146f9a3970f776e4ac01f63af4f462184 /src/test/modules
parentdbfe6e4b1766369654e20113b0cab79bd939d544 (diff)
downloadpostgresql-201a76183e2056c2217129e12d68c25ec9c559c8.tar.gz
postgresql-201a76183e2056c2217129e12d68c25ec9c559c8.zip
Unify PostgresNode's new() and get_new_node() methods
There is only one constructor now for PostgresNode, with the idiomatic name 'new'. The method is not exported by the class, and must be called as "PostgresNode->new('name',[args])". All the TAP tests that use PostgresNode are modified accordingly. Third party scripts will need adjusting, which is a fairly mechanical process (I just used a sed script).
Diffstat (limited to 'src/test/modules')
-rw-r--r--src/test/modules/brin/t/01_workitems.pl2
-rw-r--r--src/test/modules/commit_ts/t/001_base.pl2
-rw-r--r--src/test/modules/commit_ts/t/002_standby.pl4
-rw-r--r--src/test/modules/commit_ts/t/003_standby_2.pl4
-rw-r--r--src/test/modules/commit_ts/t/004_restart.pl2
-rw-r--r--src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl2
-rw-r--r--src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl2
-rw-r--r--src/test/modules/test_misc/t/001_constraint_validation.pl2
-rw-r--r--src/test/modules/test_pg_dump/t/001_base.pl2
9 files changed, 11 insertions, 11 deletions
diff --git a/src/test/modules/brin/t/01_workitems.pl b/src/test/modules/brin/t/01_workitems.pl
index a4f603a9d54..ea2e2944a15 100644
--- a/src/test/modules/brin/t/01_workitems.pl
+++ b/src/test/modules/brin/t/01_workitems.pl
@@ -10,7 +10,7 @@ use TestLib;
use Test::More tests => 2;
use PostgresNode;
-my $node = get_new_node('tango');
+my $node = PostgresNode->new('tango');
$node->init;
$node->append_conf('postgresql.conf', 'autovacuum_naptime=1s');
$node->start;
diff --git a/src/test/modules/commit_ts/t/001_base.pl b/src/test/modules/commit_ts/t/001_base.pl
index dd41936658d..0c504421d44 100644
--- a/src/test/modules/commit_ts/t/001_base.pl
+++ b/src/test/modules/commit_ts/t/001_base.pl
@@ -10,7 +10,7 @@ use TestLib;
use Test::More tests => 2;
use PostgresNode;
-my $node = get_new_node('foxtrot');
+my $node = PostgresNode->new('foxtrot');
$node->init;
$node->append_conf('postgresql.conf', 'track_commit_timestamp = on');
$node->start;
diff --git a/src/test/modules/commit_ts/t/002_standby.pl b/src/test/modules/commit_ts/t/002_standby.pl
index 2664b177ec2..227eddeda26 100644
--- a/src/test/modules/commit_ts/t/002_standby.pl
+++ b/src/test/modules/commit_ts/t/002_standby.pl
@@ -11,7 +11,7 @@ use Test::More tests => 4;
use PostgresNode;
my $bkplabel = 'backup';
-my $primary = get_new_node('primary');
+my $primary = PostgresNode->new('primary');
$primary->init(allows_streaming => 1);
$primary->append_conf(
@@ -22,7 +22,7 @@ $primary->append_conf(
$primary->start;
$primary->backup($bkplabel);
-my $standby = get_new_node('standby');
+my $standby = PostgresNode->new('standby');
$standby->init_from_backup($primary, $bkplabel, has_streaming => 1);
$standby->start;
diff --git a/src/test/modules/commit_ts/t/003_standby_2.pl b/src/test/modules/commit_ts/t/003_standby_2.pl
index 57ab9b1d463..27c5bfbfb73 100644
--- a/src/test/modules/commit_ts/t/003_standby_2.pl
+++ b/src/test/modules/commit_ts/t/003_standby_2.pl
@@ -11,7 +11,7 @@ use Test::More tests => 4;
use PostgresNode;
my $bkplabel = 'backup';
-my $primary = get_new_node('primary');
+my $primary = PostgresNode->new('primary');
$primary->init(allows_streaming => 1);
$primary->append_conf(
'postgresql.conf', qq{
@@ -21,7 +21,7 @@ $primary->append_conf(
$primary->start;
$primary->backup($bkplabel);
-my $standby = get_new_node('standby');
+my $standby = PostgresNode->new('standby');
$standby->init_from_backup($primary, $bkplabel, has_streaming => 1);
$standby->start;
diff --git a/src/test/modules/commit_ts/t/004_restart.pl b/src/test/modules/commit_ts/t/004_restart.pl
index bc9931944f3..5d92c5a2e6d 100644
--- a/src/test/modules/commit_ts/t/004_restart.pl
+++ b/src/test/modules/commit_ts/t/004_restart.pl
@@ -8,7 +8,7 @@ use PostgresNode;
use TestLib;
use Test::More tests => 16;
-my $node_primary = get_new_node('primary');
+my $node_primary = PostgresNode->new('primary');
$node_primary->init(allows_streaming => 1);
$node_primary->append_conf('postgresql.conf', 'track_commit_timestamp = on');
$node_primary->start;
diff --git a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
index 4101ef950ee..49f211c8270 100644
--- a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
+++ b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
@@ -9,7 +9,7 @@ use PostgresNode;
use TestLib;
use Test::More;
-my $node = get_new_node('main');
+my $node = PostgresNode->new('main');
$node->init;
$node->start;
diff --git a/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl b/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl
index 1e2455e82f3..0a45fc1b75e 100644
--- a/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl
+++ b/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl
@@ -20,7 +20,7 @@ my $rot13pass = "SbbOnE1";
# see the Makefile for how the certificate and key have been generated
-my $node = get_new_node('main');
+my $node = PostgresNode->new('main');
$node->init;
$node->append_conf('postgresql.conf',
"ssl_passphrase.passphrase = '$rot13pass'");
diff --git a/src/test/modules/test_misc/t/001_constraint_validation.pl b/src/test/modules/test_misc/t/001_constraint_validation.pl
index 3729906c1ac..7c1929f8053 100644
--- a/src/test/modules/test_misc/t/001_constraint_validation.pl
+++ b/src/test/modules/test_misc/t/001_constraint_validation.pl
@@ -10,7 +10,7 @@ use TestLib;
use Test::More tests => 42;
# Initialize a test cluster
-my $node = get_new_node('primary');
+my $node = PostgresNode->new('primary');
$node->init();
# Turn message level up to DEBUG1 so that we get the messages we want to see
$node->append_conf('postgresql.conf', 'client_min_messages = DEBUG1');
diff --git a/src/test/modules/test_pg_dump/t/001_base.pl b/src/test/modules/test_pg_dump/t/001_base.pl
index 8511da5169b..ea7739d7254 100644
--- a/src/test/modules/test_pg_dump/t/001_base.pl
+++ b/src/test/modules/test_pg_dump/t/001_base.pl
@@ -713,7 +713,7 @@ my %tests = (
#########################################
# Create a PG instance to test actually dumping from
-my $node = get_new_node('main');
+my $node = PostgresNode->new('main');
$node->init;
$node->start;