aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2021-10-24 10:28:19 -0400
committerAndrew Dunstan <andrew@dunslane.net>2021-10-24 10:28:19 -0400
commitb3b4d8e68ae83f432f43f035c7eb481ef93e1583 (patch)
treeff4e73500b61f2235bd4e3822d8e1a1af3a37523 /src/bin/scripts
parent3cd9c3b921977272e6650a5efbeade4203c4bca2 (diff)
downloadpostgresql-b3b4d8e68ae83f432f43f035c7eb481ef93e1583.tar.gz
postgresql-b3b4d8e68ae83f432f43f035c7eb481ef93e1583.zip
Move Perl test modules to a better namespace
The five modules in our TAP test framework all had names in the top level namespace. This is unwise because, even though we're not exporting them to CPAN, the names can leak, for example if they are exported by the RPM build process. We therefore move the modules to the PostgreSQL::Test namespace. In the process PostgresNode is renamed to Cluster, and TestLib is renamed to Utils. PostgresVersion becomes simply PostgreSQL::Version, to avoid possible confusion about what it's the version of. Discussion: https://postgr.es/m/aede93a4-7d92-ef26-398f-5094944c2504@dunslane.net Reviewed by Erik Rijkers and Michael Paquier
Diffstat (limited to 'src/bin/scripts')
-rw-r--r--src/bin/scripts/t/010_clusterdb.pl6
-rw-r--r--src/bin/scripts/t/011_clusterdb_all.pl6
-rw-r--r--src/bin/scripts/t/020_createdb.pl6
-rw-r--r--src/bin/scripts/t/040_createuser.pl6
-rw-r--r--src/bin/scripts/t/050_dropdb.pl6
-rw-r--r--src/bin/scripts/t/070_dropuser.pl6
-rw-r--r--src/bin/scripts/t/080_pg_isready.pl6
-rw-r--r--src/bin/scripts/t/090_reindexdb.pl8
-rw-r--r--src/bin/scripts/t/091_reindexdb_all.pl4
-rw-r--r--src/bin/scripts/t/100_vacuumdb.pl6
-rw-r--r--src/bin/scripts/t/101_vacuumdb_all.pl4
-rw-r--r--src/bin/scripts/t/102_vacuumdb_stages.pl4
-rw-r--r--src/bin/scripts/t/200_connstr.pl6
13 files changed, 37 insertions, 37 deletions
diff --git a/src/bin/scripts/t/010_clusterdb.pl b/src/bin/scripts/t/010_clusterdb.pl
index aae5ea985b7..0ba4aa4876e 100644
--- a/src/bin/scripts/t/010_clusterdb.pl
+++ b/src/bin/scripts/t/010_clusterdb.pl
@@ -4,15 +4,15 @@
use strict;
use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
use Test::More tests => 14;
program_help_ok('clusterdb');
program_version_ok('clusterdb');
program_options_handling_ok('clusterdb');
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
diff --git a/src/bin/scripts/t/011_clusterdb_all.pl b/src/bin/scripts/t/011_clusterdb_all.pl
index 6ba71780de3..d040b95cfbf 100644
--- a/src/bin/scripts/t/011_clusterdb_all.pl
+++ b/src/bin/scripts/t/011_clusterdb_all.pl
@@ -4,11 +4,11 @@
use strict;
use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
use Test::More tests => 2;
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
diff --git a/src/bin/scripts/t/020_createdb.pl b/src/bin/scripts/t/020_createdb.pl
index 3db2f13ae21..cb8e26c7731 100644
--- a/src/bin/scripts/t/020_createdb.pl
+++ b/src/bin/scripts/t/020_createdb.pl
@@ -4,15 +4,15 @@
use strict;
use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
use Test::More tests => 22;
program_help_ok('createdb');
program_version_ok('createdb');
program_options_handling_ok('createdb');
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
diff --git a/src/bin/scripts/t/040_createuser.pl b/src/bin/scripts/t/040_createuser.pl
index 3da8b7ae755..a865c01f5a7 100644
--- a/src/bin/scripts/t/040_createuser.pl
+++ b/src/bin/scripts/t/040_createuser.pl
@@ -4,15 +4,15 @@
use strict;
use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
use Test::More tests => 17;
program_help_ok('createuser');
program_version_ok('createuser');
program_options_handling_ok('createuser');
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
diff --git a/src/bin/scripts/t/050_dropdb.pl b/src/bin/scripts/t/050_dropdb.pl
index b9f0592bcaa..5c9342f290d 100644
--- a/src/bin/scripts/t/050_dropdb.pl
+++ b/src/bin/scripts/t/050_dropdb.pl
@@ -4,15 +4,15 @@
use strict;
use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
use Test::More tests => 13;
program_help_ok('dropdb');
program_version_ok('dropdb');
program_options_handling_ok('dropdb');
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
diff --git a/src/bin/scripts/t/070_dropuser.pl b/src/bin/scripts/t/070_dropuser.pl
index 26dadaf4a5f..5d6e75c9033 100644
--- a/src/bin/scripts/t/070_dropuser.pl
+++ b/src/bin/scripts/t/070_dropuser.pl
@@ -4,15 +4,15 @@
use strict;
use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
use Test::More tests => 11;
program_help_ok('dropuser');
program_version_ok('dropuser');
program_options_handling_ok('dropuser');
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
diff --git a/src/bin/scripts/t/080_pg_isready.pl b/src/bin/scripts/t/080_pg_isready.pl
index 4f1184953ed..42be32decc3 100644
--- a/src/bin/scripts/t/080_pg_isready.pl
+++ b/src/bin/scripts/t/080_pg_isready.pl
@@ -4,8 +4,8 @@
use strict;
use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
use Test::More tests => 10;
program_help_ok('pg_isready');
@@ -14,7 +14,7 @@ program_options_handling_ok('pg_isready');
command_fails(['pg_isready'], 'fails with no server running');
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
diff --git a/src/bin/scripts/t/090_reindexdb.pl b/src/bin/scripts/t/090_reindexdb.pl
index 541504d8f01..5384b74ccdb 100644
--- a/src/bin/scripts/t/090_reindexdb.pl
+++ b/src/bin/scripts/t/090_reindexdb.pl
@@ -4,15 +4,15 @@
use strict;
use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
use Test::More tests => 58;
program_help_ok('reindexdb');
program_version_ok('reindexdb');
program_options_handling_ok('reindexdb');
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
@@ -21,7 +21,7 @@ $ENV{PGOPTIONS} = '--client-min-messages=WARNING';
# Create a tablespace for testing.
my $tbspace_path = $node->basedir . '/regress_reindex_tbspace';
mkdir $tbspace_path or die "cannot create directory $tbspace_path";
-$tbspace_path = TestLib::perl2host($tbspace_path);
+$tbspace_path = PostgreSQL::Test::Utils::perl2host($tbspace_path);
my $tbspace_name = 'reindex_tbspace';
$node->safe_psql('postgres',
"CREATE TABLESPACE $tbspace_name LOCATION '$tbspace_path';");
diff --git a/src/bin/scripts/t/091_reindexdb_all.pl b/src/bin/scripts/t/091_reindexdb_all.pl
index 34174e4d71a..acb24189765 100644
--- a/src/bin/scripts/t/091_reindexdb_all.pl
+++ b/src/bin/scripts/t/091_reindexdb_all.pl
@@ -4,10 +4,10 @@
use strict;
use warnings;
-use PostgresNode;
+use PostgreSQL::Test::Cluster;
use Test::More tests => 2;
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
diff --git a/src/bin/scripts/t/100_vacuumdb.pl b/src/bin/scripts/t/100_vacuumdb.pl
index 0f1e5bb2788..6937a35bc4a 100644
--- a/src/bin/scripts/t/100_vacuumdb.pl
+++ b/src/bin/scripts/t/100_vacuumdb.pl
@@ -4,15 +4,15 @@
use strict;
use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
use Test::More tests => 58;
program_help_ok('vacuumdb');
program_version_ok('vacuumdb');
program_options_handling_ok('vacuumdb');
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
diff --git a/src/bin/scripts/t/101_vacuumdb_all.pl b/src/bin/scripts/t/101_vacuumdb_all.pl
index a60fc79aae7..3dfbfbfdb28 100644
--- a/src/bin/scripts/t/101_vacuumdb_all.pl
+++ b/src/bin/scripts/t/101_vacuumdb_all.pl
@@ -4,10 +4,10 @@
use strict;
use warnings;
-use PostgresNode;
+use PostgreSQL::Test::Cluster;
use Test::More tests => 2;
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
diff --git a/src/bin/scripts/t/102_vacuumdb_stages.pl b/src/bin/scripts/t/102_vacuumdb_stages.pl
index c15057a763e..f7bd45ba922 100644
--- a/src/bin/scripts/t/102_vacuumdb_stages.pl
+++ b/src/bin/scripts/t/102_vacuumdb_stages.pl
@@ -4,10 +4,10 @@
use strict;
use warnings;
-use PostgresNode;
+use PostgreSQL::Test::Cluster;
use Test::More tests => 4;
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->start;
diff --git a/src/bin/scripts/t/200_connstr.pl b/src/bin/scripts/t/200_connstr.pl
index f702e32f00e..b2fa50a1c6d 100644
--- a/src/bin/scripts/t/200_connstr.pl
+++ b/src/bin/scripts/t/200_connstr.pl
@@ -4,8 +4,8 @@
use strict;
use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
use Test::More tests => 3;
# Tests to check connection string handling in utilities
@@ -23,7 +23,7 @@ my $dbname2 =
my $dbname3 = generate_ascii_string(130, 192);
my $dbname4 = generate_ascii_string(193, 255);
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
$node->init(extra => [ '--locale=C', '--encoding=LATIN1' ]);
$node->start;