Move Perl test modules to a better namespace
authorAndrew Dunstan <[email protected]>
Sun, 24 Oct 2021 14:28:19 +0000 (10:28 -0400)
committerAndrew Dunstan <[email protected]>
Sun, 24 Oct 2021 14:28:19 +0000 (10:28 -0400)
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

144 files changed:
contrib/amcheck/t/001_verify_heapam.pl
contrib/amcheck/t/002_cic.pl
contrib/amcheck/t/003_cic_2pc.pl
contrib/auto_explain/t/001_auto_explain.pl
contrib/bloom/t/001_wal.pl
contrib/oid2name/t/001_basic.pl
contrib/test_decoding/t/001_repl_stats.pl
contrib/vacuumlo/t/001_basic.pl
src/bin/initdb/t/001_initdb.pl
src/bin/pg_amcheck/t/001_basic.pl
src/bin/pg_amcheck/t/002_nonesuch.pl
src/bin/pg_amcheck/t/003_check.pl
src/bin/pg_amcheck/t/004_verify_heapam.pl
src/bin/pg_amcheck/t/005_opclass_damage.pl
src/bin/pg_archivecleanup/t/010_pg_archivecleanup.pl
src/bin/pg_basebackup/t/010_pg_basebackup.pl
src/bin/pg_basebackup/t/020_pg_receivewal.pl
src/bin/pg_basebackup/t/030_pg_recvlogical.pl
src/bin/pg_checksums/t/001_basic.pl
src/bin/pg_checksums/t/002_actions.pl
src/bin/pg_config/t/001_pg_config.pl
src/bin/pg_controldata/t/001_pg_controldata.pl
src/bin/pg_ctl/t/001_start_stop.pl
src/bin/pg_ctl/t/002_status.pl
src/bin/pg_ctl/t/003_promote.pl
src/bin/pg_ctl/t/004_logrotate.pl
src/bin/pg_dump/t/001_basic.pl
src/bin/pg_dump/t/002_pg_dump.pl
src/bin/pg_dump/t/003_pg_dump_with_server.pl
src/bin/pg_dump/t/010_dump_connstr.pl
src/bin/pg_resetwal/t/001_basic.pl
src/bin/pg_resetwal/t/002_corrupted.pl
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/006_options.pl
src/bin/pg_rewind/t/007_standby_source.pl
src/bin/pg_rewind/t/008_min_recovery_point.pl
src/bin/pg_rewind/t/RewindTest.pm
src/bin/pg_test_fsync/t/001_basic.pl
src/bin/pg_test_timing/t/001_basic.pl
src/bin/pg_verifybackup/t/001_basic.pl
src/bin/pg_verifybackup/t/002_algorithm.pl
src/bin/pg_verifybackup/t/003_corruption.pl
src/bin/pg_verifybackup/t/004_options.pl
src/bin/pg_verifybackup/t/005_bad_manifest.pl
src/bin/pg_verifybackup/t/006_encoding.pl
src/bin/pg_verifybackup/t/007_wal.pl
src/bin/pg_waldump/t/001_basic.pl
src/bin/pgbench/t/001_pgbench_with_server.pl
src/bin/pgbench/t/002_pgbench_no_server.pl
src/bin/psql/t/001_basic.pl
src/bin/psql/t/010_tab_completion.pl
src/bin/psql/t/020_cancel.pl
src/bin/scripts/t/010_clusterdb.pl
src/bin/scripts/t/011_clusterdb_all.pl
src/bin/scripts/t/020_createdb.pl
src/bin/scripts/t/040_createuser.pl
src/bin/scripts/t/050_dropdb.pl
src/bin/scripts/t/070_dropuser.pl
src/bin/scripts/t/080_pg_isready.pl
src/bin/scripts/t/090_reindexdb.pl
src/bin/scripts/t/091_reindexdb_all.pl
src/bin/scripts/t/100_vacuumdb.pl
src/bin/scripts/t/101_vacuumdb_all.pl
src/bin/scripts/t/102_vacuumdb_stages.pl
src/bin/scripts/t/200_connstr.pl
src/test/authentication/t/001_password.pl
src/test/authentication/t/002_saslprep.pl
src/test/kerberos/t/001_auth.pl
src/test/ldap/t/001_auth.pl
src/test/modules/brin/t/01_workitems.pl
src/test/modules/commit_ts/t/001_base.pl
src/test/modules/commit_ts/t/002_standby.pl
src/test/modules/commit_ts/t/003_standby_2.pl
src/test/modules/commit_ts/t/004_restart.pl
src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl
src/test/modules/test_misc/t/001_constraint_validation.pl
src/test/modules/test_pg_dump/t/001_base.pl
src/test/perl/Makefile
src/test/perl/PostgreSQL/Test/Cluster.pm [moved from src/test/perl/PostgresNode.pm with 92% similarity]
src/test/perl/PostgreSQL/Test/RecursiveCopy.pm [moved from src/test/perl/RecursiveCopy.pm with 91% similarity]
src/test/perl/PostgreSQL/Test/SimpleTee.pm [moved from src/test/perl/SimpleTee.pm with 94% similarity]
src/test/perl/PostgreSQL/Test/Utils.pm [moved from src/test/perl/TestLib.pm with 96% similarity]
src/test/perl/PostgreSQL/Version.pm [moved from src/test/perl/PostgresVersion.pm with 87% similarity]
src/test/perl/README
src/test/recovery/t/001_stream_rep.pl
src/test/recovery/t/002_archiving.pl
src/test/recovery/t/003_recovery_targets.pl
src/test/recovery/t/004_timeline_switch.pl
src/test/recovery/t/005_replay_delay.pl
src/test/recovery/t/006_logical_decoding.pl
src/test/recovery/t/007_sync_rep.pl
src/test/recovery/t/008_fsm_truncation.pl
src/test/recovery/t/009_twophase.pl
src/test/recovery/t/010_logical_decoding_timelines.pl
src/test/recovery/t/011_crash_recovery.pl
src/test/recovery/t/012_subtransactions.pl
src/test/recovery/t/013_crash_restart.pl
src/test/recovery/t/014_unlogged_reinit.pl
src/test/recovery/t/015_promotion_pages.pl
src/test/recovery/t/016_min_consistency.pl
src/test/recovery/t/017_shm.pl
src/test/recovery/t/018_wal_optimize.pl
src/test/recovery/t/019_replslot_limit.pl
src/test/recovery/t/020_archive_status.pl
src/test/recovery/t/021_row_visibility.pl
src/test/recovery/t/022_crash_temp_files.pl
src/test/recovery/t/023_pitr_prepared_xact.pl
src/test/recovery/t/024_archive_recovery.pl
src/test/recovery/t/025_stuck_on_old_timeline.pl
src/test/recovery/t/026_overwrite_contrecord.pl
src/test/regress/pg_regress.c
src/test/ssl/t/001_ssltests.pl
src/test/ssl/t/002_scram.pl
src/test/ssl/t/SSLServer.pm
src/test/subscription/t/001_rep_changes.pl
src/test/subscription/t/002_types.pl
src/test/subscription/t/003_constraints.pl
src/test/subscription/t/004_sync.pl
src/test/subscription/t/005_encoding.pl
src/test/subscription/t/006_rewrite.pl
src/test/subscription/t/007_ddl.pl
src/test/subscription/t/008_diff_schema.pl
src/test/subscription/t/009_matviews.pl
src/test/subscription/t/010_truncate.pl
src/test/subscription/t/011_generated.pl
src/test/subscription/t/012_collation.pl
src/test/subscription/t/013_partition.pl
src/test/subscription/t/014_binary.pl
src/test/subscription/t/015_stream.pl
src/test/subscription/t/016_stream_subxact.pl
src/test/subscription/t/017_stream_ddl.pl
src/test/subscription/t/018_stream_subxact_abort.pl
src/test/subscription/t/019_stream_subxact_ddl_abort.pl
src/test/subscription/t/020_messages.pl
src/test/subscription/t/021_twophase.pl
src/test/subscription/t/022_twophase_cascade.pl
src/test/subscription/t/023_twophase_stream.pl
src/test/subscription/t/024_add_drop_pub.pl
src/test/subscription/t/100_bugs.pl

index 8e02a8db2a38f50eb98fadfebe3fd29ee35bb2b2..606235fcc17204032204f45218c354c69193f481 100644 (file)
@@ -4,8 +4,8 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 
 use Fcntl qw(:seek);
 use Test::More tests => 272;
@@ -15,7 +15,7 @@ my ($node, $result);
 #
 # Test set-up
 #
-$node = PostgresNode->new('test');
+$node = PostgreSQL::Test::Cluster->new('test');
 $node->init;
 $node->append_conf('postgresql.conf', 'autovacuum=off');
 $node->start;
index fd2dbc33664b03df515b756e6ac494feadac4443..0b14e66270cb5f42bf0e2cd16f73bdda2bac1c50 100644 (file)
@@ -6,8 +6,8 @@ use strict;
 use warnings;
 
 use Config;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 
 use Test::More tests => 4;
 
@@ -16,7 +16,7 @@ my ($node, $result);
 #
 # Test set-up
 #
-$node = PostgresNode->new('CIC_test');
+$node = PostgreSQL::Test::Cluster->new('CIC_test');
 $node->init;
 $node->append_conf('postgresql.conf', 'lock_timeout = 180000');
 $node->start;
index 803b99a73884bde925721cbbd2e682af2947e118..f4255c1fb84605e534a88eabc8c8dbac34c77172 100644 (file)
@@ -6,8 +6,8 @@ use strict;
 use warnings;
 
 use Config;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 
 use Test::More tests => 6;
 
@@ -16,7 +16,7 @@ my ($node, $result);
 #
 # Test set-up
 #
-$node = PostgresNode->new('CIC_2PC_test');
+$node = PostgreSQL::Test::Cluster->new('CIC_2PC_test');
 $node->init;
 $node->append_conf('postgresql.conf', 'max_prepared_transactions = 10');
 $node->append_conf('postgresql.conf', 'lock_timeout = 180000');
index 1773a379993584e2498c8924413c8de870f89eb0..23d566fc11ddebe4fce7ee3fbf6758a480bb6806 100644 (file)
@@ -4,11 +4,11 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 4;
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 $node->append_conf('postgresql.conf',
        "shared_preload_libraries = 'auto_explain'");
index be8916a8ebf9d9347ad28f732fd30a8242479bce..f1184028bcf5b86e691f493c77dcdf358907e0cc 100644 (file)
@@ -4,8 +4,8 @@
 # Test generic xlog record work for bloom index replication.
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 31;
 
 my $node_primary;
@@ -41,7 +41,7 @@ SELECT * FROM tst WHERE i = 7 AND t = 'e';
 }
 
 # Initialize primary node
-$node_primary = PostgresNode->new('primary');
+$node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(allows_streaming => 1);
 $node_primary->start;
 my $backup_name = 'my_backup';
@@ -50,7 +50,7 @@ my $backup_name = 'my_backup';
 $node_primary->backup($backup_name);
 
 # Create streaming standby linking to primary
-$node_standby = PostgresNode->new('standby');
+$node_standby = PostgreSQL::Test::Cluster->new('standby');
 $node_standby->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
 $node_standby->start;
index 8f0d4349a077cf246e5bdb6cca9d88b492bf0295..efedba0aa1acec3b97e533acc62a5ad526b6bbad 100644 (file)
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 8;
 
 #########################################
index e8644e1cbcd005d5ad38b32873113c9b004ee2bb..7f91fa3ad410b96cce3c3e70a71040d63e7993f9 100644 (file)
@@ -6,12 +6,12 @@
 use strict;
 use warnings;
 use File::Path qw(rmtree);
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 2;
 
 # Test set-up
-my $node = PostgresNode->new('test');
+my $node = PostgreSQL::Test::Cluster->new('test');
 $node->init(allows_streaming => 'logical');
 $node->append_conf('postgresql.conf', 'synchronous_commit = on');
 $node->start;
index 2121f454e026a306aedc9f5170c8b33ec0615b9d..951dad0d473ce8988ea05049150596f781d06eba 100644 (file)
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 8;
 
 program_help_ok('vacuumlo');
index 635ff79b475d0dbb6f1f044d9c0c5b625b899dfb..6796d8520edb23c38e5e7d0a01b935760d4e9279 100644 (file)
@@ -9,11 +9,11 @@ use strict;
 use warnings;
 use Fcntl ':mode';
 use File::stat qw{lstat};
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 22;
 
-my $tempdir = TestLib::tempdir;
+my $tempdir = PostgreSQL::Test::Utils::tempdir;
 my $xlogdir = "$tempdir/pgxlog";
 my $datadir = "$tempdir/data";
 
index 6f60e3ec1f509748202fb4c10f938238bd4338bf..d44fe60a4ca1feae3581abc33864a9f11044ff05 100644 (file)
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 8;
 
 program_help_ok('pg_amcheck');
index e30c1cc5464b5652454f17ed4a67d12983bbbe85..513a18d6718ca106b2723c00d5a5b4729e7e5244 100644 (file)
@@ -4,13 +4,13 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 76;
 
 # Test set-up
 my ($node, $port);
-$node = PostgresNode->new('test');
+$node = PostgreSQL::Test::Cluster->new('test');
 $node->init;
 $node->start;
 $port = $node->port;
index c26e5eda676961a74fd41de55c6561f57d61c2b0..5913fcc530507ecbe46be7a028c9a7647875c578 100644 (file)
@@ -4,8 +4,8 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 
 use Fcntl qw(:seek);
 use Test::More tests => 63;
@@ -120,7 +120,7 @@ sub perform_all_corruptions()
 }
 
 # Test set-up
-$node = PostgresNode->new('test');
+$node = PostgreSQL::Test::Cluster->new('test');
 $node->init;
 $node->append_conf('postgresql.conf', 'autovacuum=off');
 $node->start;
@@ -316,7 +316,7 @@ plan_to_remove_relation_file('db2', 's1.t1_btree');
 # Leave 'db3' uncorrupted
 #
 
-# Standard first arguments to TestLib functions
+# Standard first arguments to PostgreSQL::Test::Utils functions
 my @cmd = ('pg_amcheck', '-p', $port);
 
 # Regular expressions to match various expected output
index a9f485e527bdc358698515939daa5191a7baf23d..4ca7ed297c0f57087ce7edce8444877d3df7485e 100644 (file)
@@ -4,8 +4,8 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 
 use Fcntl qw(:seek);
 use Test::More;
@@ -178,7 +178,7 @@ umask(0077);
 # Set up the node.  Once we create and corrupt the table,
 # autovacuum workers visiting the table could crash the backend.
 # Disable autovacuum so that won't happen.
-my $node = PostgresNode->new('test');
+my $node = PostgreSQL::Test::Cluster->new('test');
 $node->init;
 $node->append_conf('postgresql.conf', 'autovacuum=off');
 
index e87d81d7d42ac51c4fca74610f46858a11a871db..2f86f4f2a408d7cc801c1da4ed43324880c871db 100644 (file)
@@ -6,11 +6,11 @@
 #
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 5;
 
-my $node = PostgresNode->new('test');
+my $node = PostgreSQL::Test::Cluster->new('test');
 $node->init;
 $node->start;
 
index 8d689b9601cee757e4e43bfa62364952736c92dd..6b3f486cfa0ce80aef658f6ba6817d7381f4b51c 100644 (file)
@@ -3,14 +3,14 @@
 
 use strict;
 use warnings;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 42;
 
 program_help_ok('pg_archivecleanup');
 program_version_ok('pg_archivecleanup');
 program_options_handling_ok('pg_archivecleanup');
 
-my $tempdir = TestLib::tempdir;
+my $tempdir = PostgreSQL::Test::Utils::tempdir;
 
 my @walfiles = (
        '00000001000000370000000C.gz', '00000001000000370000000D',
index a2cb2a7679d07a61e835d7525b7e97b254392709..89f45b77a341c25d9243bbf939031dee2ed3f82b 100644 (file)
@@ -8,17 +8,17 @@ use Config;
 use File::Basename qw(basename dirname);
 use File::Path qw(rmtree);
 use Fcntl qw(:seek);
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 110;
 
 program_help_ok('pg_basebackup');
 program_version_ok('pg_basebackup');
 program_options_handling_ok('pg_basebackup');
 
-my $tempdir = TestLib::tempdir;
+my $tempdir = PostgreSQL::Test::Utils::tempdir;
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 
 # Set umask so test directories and files are created with default permissions
 umask(0077);
@@ -238,14 +238,14 @@ $node->start;
 # to our physical temp location.  That way we can use shorter names
 # for the tablespace directories, which hopefully won't run afoul of
 # the 99 character length limit.
-my $sys_tempdir = TestLib::tempdir_short;
-my $real_sys_tempdir = TestLib::perl2host($sys_tempdir) . "/tempdir";
+my $sys_tempdir = PostgreSQL::Test::Utils::tempdir_short;
+my $real_sys_tempdir = PostgreSQL::Test::Utils::perl2host($sys_tempdir) . "/tempdir";
 my $shorter_tempdir =  $sys_tempdir . "/tempdir";
 dir_symlink "$tempdir", $shorter_tempdir;
 
 mkdir "$tempdir/tblspc1";
 my $realTsDir    = "$real_sys_tempdir/tblspc1";
-my $real_tempdir = TestLib::perl2host($tempdir);
+my $real_tempdir = PostgreSQL::Test::Utils::perl2host($tempdir);
 $node->safe_psql('postgres',
        "CREATE TABLESPACE tblspc1 LOCATION '$realTsDir';");
 $node->safe_psql('postgres',
@@ -270,7 +270,7 @@ SKIP:
        skip "no tar program available", 1
          if (!defined $tar || $tar eq '');
 
-       my $node2 = PostgresNode->new('replica');
+       my $node2 = PostgreSQL::Test::Cluster->new('replica');
 
        # Recover main data directory
        $node2->init_from_backup($node, 'tarbackup2', tar_program => $tar);
@@ -279,7 +279,7 @@ SKIP:
        my $repTsDir     = "$tempdir/tblspc1replica";
        my $realRepTsDir = "$real_sys_tempdir/tblspc1replica";
        mkdir $repTsDir;
-       TestLib::system_or_bail($tar, 'xf', $tblspc_tars[0], '-C', $repTsDir);
+       PostgreSQL::Test::Utils::system_or_bail($tar, 'xf', $tblspc_tars[0], '-C', $repTsDir);
 
        # Update tablespace map to point to new directory.
        # XXX Ideally pg_basebackup would handle this.
index 0b33d739005efb20e5406324a686f0e9bd09abeb..b93493b5e9b24002985da35ead7002b86a8b29d4 100644 (file)
@@ -3,8 +3,8 @@
 
 use strict;
 use warnings;
-use TestLib;
-use PostgresNode;
+use PostgreSQL::Test::Utils;
+use PostgreSQL::Test::Cluster;
 use Test::More tests => 27;
 
 program_help_ok('pg_receivewal');
@@ -14,7 +14,7 @@ program_options_handling_ok('pg_receivewal');
 # Set umask so test directories and files are created with default permissions
 umask(0077);
 
-my $primary = PostgresNode->new('primary');
+my $primary = PostgreSQL::Test::Cluster->new('primary');
 $primary->init(allows_streaming => 1);
 $primary->start;
 
index fe7fe762954b2123a541848996b14c91af0655f1..90da1662e337a7c56282669305df4946cc11970a 100644 (file)
@@ -3,15 +3,15 @@
 
 use strict;
 use warnings;
-use TestLib;
-use PostgresNode;
+use PostgreSQL::Test::Utils;
+use PostgreSQL::Test::Cluster;
 use Test::More tests => 20;
 
 program_help_ok('pg_recvlogical');
 program_version_ok('pg_recvlogical');
 program_options_handling_ok('pg_recvlogical');
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 
 # Initialize node without replication settings
 $node->init(allows_streaming => 1, has_archiving => 1);
index 62e78a50438faee99267d4795eb2df4ca023366b..e9eb3197a628e17eccfd5b14309b25fc87c1058c 100644 (file)
@@ -3,7 +3,7 @@
 
 use strict;
 use warnings;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 8;
 
 program_help_ok('pg_checksums');
index 0b3e19ab7c68118537f6768a2bac5c902e85bcfa..20a5f27840454b63358595cd9a44bf88d7753b13 100644 (file)
@@ -7,8 +7,8 @@
 use strict;
 use warnings;
 use Config;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 
 use Fcntl qw(:seek);
 use Test::More tests => 66;
@@ -93,7 +93,7 @@ sub check_relation_corruption
 }
 
 # Initialize node with checksums disabled.
-my $node = PostgresNode->new('node_checksum');
+my $node = PostgreSQL::Test::Cluster->new('node_checksum');
 $node->init();
 my $pgdata = $node->data_dir;
 
@@ -207,7 +207,7 @@ check_relation_corruption($node, 'corrupt1', 'pg_default');
 my $basedir        = $node->basedir;
 my $tablespace_dir = "$basedir/ts_corrupt_dir";
 mkdir($tablespace_dir);
-$tablespace_dir = TestLib::perl2host($tablespace_dir);
+$tablespace_dir = PostgreSQL::Test::Utils::perl2host($tablespace_dir);
 $node->safe_psql('postgres',
        "CREATE TABLESPACE ts_corrupt LOCATION '$tablespace_dir';");
 check_relation_corruption($node, 'corrupt2', 'ts_corrupt');
index d8829faea6c9faaeed0031295b3c2b558ebd6962..6c7f9b8602c2593f297e2137f1c94fa446da067b 100644 (file)
@@ -3,7 +3,7 @@
 
 use strict;
 use warnings;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 20;
 
 program_help_ok('pg_config');
index ce31cfbd3b38605b8defda518533960934f6b2ca..ad7bacace5877dfa77d9a8dc758b27c581a97f7b 100644 (file)
@@ -3,8 +3,8 @@
 
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 17;
 
 program_help_ok('pg_controldata');
@@ -14,7 +14,7 @@ command_fails(['pg_controldata'], 'pg_controldata without arguments fails');
 command_fails([ 'pg_controldata', 'nonexistent' ],
        'pg_controldata with nonexistent directory fails');
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 
 command_like([ 'pg_controldata', $node->data_dir ],
index 1d8d6bbb701e6862d31068396e336e8bc7b15f6b..f95352bf94fdea883bc7ac1d1b400c083e1fbeda 100644 (file)
@@ -7,12 +7,12 @@ use warnings;
 use Config;
 use Fcntl ':mode';
 use File::stat qw{lstat};
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 24;
 
-my $tempdir       = TestLib::tempdir;
-my $tempdir_short = TestLib::tempdir_short;
+my $tempdir       = PostgreSQL::Test::Utils::tempdir;
+my $tempdir_short = PostgreSQL::Test::Utils::tempdir_short;
 
 program_help_ok('pg_ctl');
 program_version_ok('pg_ctl');
@@ -25,11 +25,11 @@ command_ok([ 'pg_ctl', 'initdb', '-D', "$tempdir/data", '-o', '-N' ],
        'pg_ctl initdb');
 command_ok([ $ENV{PG_REGRESS}, '--config-auth', "$tempdir/data" ],
        'configure authentication');
-my $node_port = PostgresNode::get_free_port();
+my $node_port = PostgreSQL::Test::Cluster::get_free_port();
 open my $conf, '>>', "$tempdir/data/postgresql.conf";
 print $conf "fsync = off\n";
 print $conf "port = $node_port\n";
-print $conf TestLib::slurp_file($ENV{TEMP_CONFIG})
+print $conf PostgreSQL::Test::Utils::slurp_file($ENV{TEMP_CONFIG})
   if defined $ENV{TEMP_CONFIG};
 
 if ($use_unix_sockets)
@@ -44,7 +44,7 @@ else
 close $conf;
 my $ctlcmd = [
        'pg_ctl', 'start', '-D', "$tempdir/data", '-l',
-       "$TestLib::log_path/001_start_stop_server.log"
+       "$PostgreSQL::Test::Utils::log_path/001_start_stop_server.log"
 ];
 if ($Config{osname} ne 'msys')
 {
index c6f4fac57b65e857f6641bcaf927db4a9fdbeaf8..a74e6e3b91c7f5bb805c24b0aaf6df77431a31ad 100644 (file)
@@ -4,16 +4,16 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 3;
 
-my $tempdir       = TestLib::tempdir;
+my $tempdir       = PostgreSQL::Test::Utils::tempdir;
 
 command_exit_is([ 'pg_ctl', 'status', '-D', "$tempdir/nonexistent" ],
        4, 'pg_ctl status with nonexistent directory');
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 
 command_exit_is([ 'pg_ctl', 'status', '-D', $node->data_dir ],
index 547b3d8893c6fc2baef5b15a4c8b91dbd6fc6c05..50819db92b3b27ac42a788169dba08a517ac2221 100644 (file)
@@ -4,18 +4,18 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 12;
 
-my $tempdir = TestLib::tempdir;
+my $tempdir = PostgreSQL::Test::Utils::tempdir;
 
 command_fails_like(
        [ 'pg_ctl', '-D', "$tempdir/nonexistent", 'promote' ],
        qr/directory .* does not exist/,
        'pg_ctl promote with nonexistent directory');
 
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(allows_streaming => 1);
 
 command_fails_like(
@@ -30,7 +30,7 @@ command_fails_like(
        qr/not in standby mode/,
        'pg_ctl promote of primary instance fails');
 
-my $node_standby = PostgresNode->new('standby');
+my $node_standby = PostgreSQL::Test::Cluster->new('standby');
 $node_primary->backup('my_backup');
 $node_standby->init_from_backup($node_primary, 'my_backup',
        has_streaming => 1);
@@ -47,7 +47,7 @@ ok( $node_standby->poll_query_until(
        'promoted standby is not in recovery');
 
 # same again with default wait option
-$node_standby = PostgresNode->new('standby2');
+$node_standby = PostgreSQL::Test::Cluster->new('standby2');
 $node_standby->init_from_backup($node_primary, 'my_backup',
        has_streaming => 1);
 $node_standby->start;
index 13e91f3bc97e9937c471c8ddc8f069d76b81ab23..3813a3b1fd08be16aa442326b42ee2ae8bd2df47 100644 (file)
@@ -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;
 use Time::HiRes qw(usleep);
 
@@ -60,7 +60,7 @@ sub check_log_pattern
 }
 
 # Set up node with logging collector
-my $node = PostgresNode->new('primary');
+my $node = PostgreSQL::Test::Cluster->new('primary');
 $node->init();
 $node->append_conf(
        'postgresql.conf', qq(
index d6731855eda3e86152b01f819e4c6d17d6cf7c9a..863f4da3d80638ecee94e268a204f8cf539dccf0 100644 (file)
@@ -5,11 +5,11 @@ use strict;
 use warnings;
 
 use Config;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 82;
 
-my $tempdir       = TestLib::tempdir;
+my $tempdir       = PostgreSQL::Test::Utils::tempdir;
 
 #########################################
 # Basic checks
index 7e00f4ddbb1b5e000d96665f771148242046cb9a..2eece79250ab18d035048154f4de80e1c1637112 100644 (file)
@@ -5,11 +5,11 @@ use strict;
 use warnings;
 
 use Config;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 
-my $tempdir       = TestLib::tempdir;
+my $tempdir       = PostgreSQL::Test::Utils::tempdir;
 
 ###############################################################
 # Definition of the pg_dump runs to make.
@@ -25,7 +25,7 @@ my $tempdir       = TestLib::tempdir;
 # the full command and arguments to run.  Note that this is run
 # using $node->command_ok(), so the port does not need to be
 # specified and is pulled from $PGPORT, which is set by the
-# PostgresNode system.
+# PostgreSQL::Test::Cluster system.
 #
 # restore_cmd is the pg_restore command to run, if any.  Note
 # that this should generally be used when the pg_dump goes to
@@ -3577,7 +3577,7 @@ my %tests = (
 #########################################
 # Create a PG instance to test actually dumping from
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 $node->start;
 
index a879ae28d8d7bfe7fd3927ebe4ff1367b31972a6..66d9563d86b667a592ea5e9c42e748f7a64ac958 100644 (file)
@@ -4,13 +4,13 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 3;
 
-my $tempdir       = TestLib::tempdir;
+my $tempdir       = PostgreSQL::Test::Utils::tempdir;
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 my $port = $node->port;
 
 $node->init;
index c4b60c5d2a474b0e66119d6faee173658f91de88..b36e2a42af260b85ba83bb16276ce7b20d01d26b 100644 (file)
@@ -4,11 +4,11 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 
-if ($TestLib::is_msys2)
+if ($PostgreSQL::Test::Utils::is_msys2)
 {
        plan skip_all => 'High bit name tests fail on Msys2';
 }
@@ -34,7 +34,7 @@ my $dbname1 =
   . generate_ascii_string(1,  9)
   . generate_ascii_string(11, 12)
   . generate_ascii_string(14, 33)
-  . ($TestLib::windows_os ? '' : '"x"')   # IPC::Run mishandles '"' on Windows
+  . ($PostgreSQL::Test::Utils::windows_os ? '' : '"x"')   # IPC::Run mishandles '"' on Windows
   . generate_ascii_string(35, 43)         # skip ','
   . generate_ascii_string(45, 54);
 my $dbname2 = 'regression' . generate_ascii_string(55, 65)    # skip 'B'-'W'
@@ -51,7 +51,7 @@ my $dbname4 = 'regression' . generate_ascii_string(203, 255);
 my $src_bootstrap_super = 'regress_postgres';
 my $dst_bootstrap_super = 'boot';
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init(extra =>
          [ '-U', $src_bootstrap_super, '--locale=C', '--encoding=LATIN1' ]);
 
@@ -175,13 +175,13 @@ system_log('cat', $plain);
 my ($stderr, $result);
 my $restore_super = qq{regress_a'b\\c=d\\ne"f};
 $restore_super =~ s/"//g
-  if $TestLib::windows_os;    # IPC::Run mishandles '"' on Windows
+  if $PostgreSQL::Test::Utils::windows_os;    # IPC::Run mishandles '"' on Windows
 
 
 # Restore full dump through psql using environment variables for
 # dbname/user connection parameters
 
-my $envar_node = PostgresNode->new('destination_envar');
+my $envar_node = PostgreSQL::Test::Cluster->new('destination_envar');
 $envar_node->init(
        extra =>
          [ '-U', $dst_bootstrap_super, '--locale=C', '--encoding=LATIN1' ],
@@ -208,7 +208,7 @@ is($stderr, '', 'no dump errors');
 # dbname/user connection parameters.  "\connect dbname=" forgets
 # user/port from command line.
 
-my $cmdline_node = PostgresNode->new('destination_cmdline');
+my $cmdline_node = PostgreSQL::Test::Cluster->new('destination_cmdline');
 $cmdline_node->init(
        extra =>
          [ '-U', $dst_bootstrap_super, '--locale=C', '--encoding=LATIN1' ],
index f01a4d2d483b94bdbc352d3c4779bdcc28fc2510..0f86aea68edcdefca61653ecd9ddb45e8112c1dd 100644 (file)
@@ -4,15 +4,15 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 12;
 
 program_help_ok('pg_resetwal');
 program_version_ok('pg_resetwal');
 program_options_handling_ok('pg_resetwal');
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 
 command_like([ 'pg_resetwal', '-n', $node->data_dir ],
index ac915ef91fcf23a759759c7f7a070bdbf9ed9b25..fd0c3ecb23ee1df8d12cab0708ef10537df604c5 100644 (file)
@@ -6,11 +6,11 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 6;
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 
 my $pg_control = $node->data_dir . '/global/pg_control';
index d636f35f5e5edfc4d0f89158a623c521d199c546..7738c306d223bc1cba882892d145687d8dd6621b 100644 (file)
@@ -3,7 +3,7 @@
 
 use strict;
 use warnings;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 23;
 
 use FindBin;
index 72c4b225a7f1df1eda104a9a05854b02c016ced6..f3fba68fd63448725ad7a445cb256be7a7c25ca4 100644 (file)
@@ -3,7 +3,7 @@
 
 use strict;
 use warnings;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 7;
 
 use FindBin;
index 672c5e586ba7453829bb080369f4038495d9bf0a..c363b2b362d0cbf6bad67cdeabed9ddc6f84e22d 100644 (file)
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 5;
 
 use File::Find;
index 8fb0ab3eadd0b2424b1d75a4917ff3f2e45e1d35..92952173cb90229de6eea3d4c0f2a7c5728c44da 100644 (file)
@@ -8,7 +8,7 @@ use strict;
 use warnings;
 use File::Copy;
 use File::Path qw(rmtree);
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 5;
 
 use FindBin;
@@ -20,7 +20,7 @@ sub run_test
 {
        my $test_mode = shift;
 
-       my $primary_xlogdir = "${TestLib::tmp_check}/xlog_primary";
+       my $primary_xlogdir = "${PostgreSQL::Test::Utils::tmp_check}/xlog_primary";
 
        rmtree($primary_xlogdir);
        RewindTest::setup_cluster($test_mode);
index efe1d4c77f5adf503a3e97ac10cb7830eec3d071..85a2f20b116e9131607d09460018d30e3be191f0 100644 (file)
@@ -7,7 +7,7 @@
 #
 use strict;
 use warnings;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 1;
 
 use FindBin;
index 81793899e59d5fed3c27fe4fd83ac76da6a5460b..30c7bb46d26bd527a023d13216a20be7ca0225d1 100644 (file)
@@ -6,15 +6,15 @@
 #
 use strict;
 use warnings;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 12;
 
 program_help_ok('pg_rewind');
 program_version_ok('pg_rewind');
 program_options_handling_ok('pg_rewind');
 
-my $primary_pgdata = TestLib::tempdir;
-my $standby_pgdata = TestLib::tempdir;
+my $primary_pgdata = PostgreSQL::Test::Utils::tempdir;
+my $standby_pgdata = PostgreSQL::Test::Utils::tempdir;
 command_fails(
        [
                'pg_rewind',       '--debug',
index 2a717f5a2e71ed62837916d1bcd6d670aa6ec1ec..d23411bb5b34e92512430fe34c32f095981a697d 100644 (file)
 
 use strict;
 use warnings;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 3;
 
 use FindBin;
 use lib $FindBin::RealBin;
 use File::Copy;
-use PostgresNode;
+use PostgreSQL::Test::Cluster;
 use RewindTest;
 
-my $tmp_folder = TestLib::tempdir;
+my $tmp_folder = PostgreSQL::Test::Utils::tempdir;
 
 my $node_a;
 my $node_b;
@@ -58,13 +58,13 @@ primary_psql("CHECKPOINT");
 #
 # A (primary) <--- B (standby) <--- C (standby)
 $node_a->backup('my_backup');
-$node_b = PostgresNode->new('node_b');
+$node_b = PostgreSQL::Test::Cluster->new('node_b');
 $node_b->init_from_backup($node_a, 'my_backup', has_streaming => 1);
 $node_b->set_standby_mode();
 $node_b->start;
 
 $node_b->backup('my_backup');
-$node_c = PostgresNode->new('node_c');
+$node_c = PostgreSQL::Test::Cluster->new('node_c');
 $node_c->init_from_backup($node_b, 'my_backup', has_streaming => 1);
 $node_c->set_standby_mode();
 $node_c->start;
index 7a390f4abd1b2f77e5c6b5ad288e1bc01875efeb..ad80cb3a0897bba876c0087c235bc8353fb60c34 100644 (file)
 
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 3;
 
 use File::Copy;
 
-my $tmp_folder = TestLib::tempdir;
+my $tmp_folder = PostgreSQL::Test::Utils::tempdir;
 
-my $node_1 = PostgresNode->new('node_1');
+my $node_1 = PostgreSQL::Test::Cluster->new('node_1');
 $node_1->init(allows_streaming => 1);
 $node_1->append_conf(
        'postgresql.conf', qq(
@@ -60,11 +60,11 @@ $node_1->safe_psql('postgres', "INSERT INTO public.bar VALUES ('in both')");
 my $backup_name = 'my_backup';
 $node_1->backup($backup_name);
 
-my $node_2 = PostgresNode->new('node_2');
+my $node_2 = PostgreSQL::Test::Cluster->new('node_2');
 $node_2->init_from_backup($node_1, $backup_name, has_streaming => 1);
 $node_2->start;
 
-my $node_3 = PostgresNode->new('node_3');
+my $node_3 = PostgreSQL::Test::Cluster->new('node_3');
 $node_3->init_from_backup($node_1, $backup_name, has_streaming => 1);
 $node_3->start;
 
index 367b99a438f166a1b4fd67c9f546003d7e8f0c55..5546ce456cd5e7d53086e478201643987ba37ace 100644 (file)
@@ -40,9 +40,9 @@ use Exporter 'import';
 use File::Copy;
 use File::Path qw(rmtree);
 use IPC::Run qw(run);
-use PostgresNode;
-use RecursiveCopy;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::RecursiveCopy;
+use PostgreSQL::Test::Utils;
 use Test::More;
 
 our @EXPORT = qw(
@@ -128,7 +128,7 @@ sub setup_cluster
 
        # Initialize primary, data checksums are mandatory
        $node_primary =
-         PostgresNode->new('primary' . ($extra_name ? "_${extra_name}" : ''));
+         PostgreSQL::Test::Cluster->new('primary' . ($extra_name ? "_${extra_name}" : ''));
 
        # Set up pg_hba.conf and pg_ident.conf for the role running
        # pg_rewind.  This role is used for all the tests, and has
@@ -176,7 +176,7 @@ sub create_standby
        my $extra_name = shift;
 
        $node_standby =
-         PostgresNode->new('standby' . ($extra_name ? "_${extra_name}" : ''));
+         PostgreSQL::Test::Cluster->new('standby' . ($extra_name ? "_${extra_name}" : ''));
        $node_primary->backup('my_backup');
        $node_standby->init_from_backup($node_primary, 'my_backup');
        my $connstr_primary = $node_primary->connstr();
@@ -226,7 +226,7 @@ sub run_pg_rewind
        my $primary_pgdata  = $node_primary->data_dir;
        my $standby_pgdata  = $node_standby->data_dir;
        my $standby_connstr = $node_standby->connstr('postgres');
-       my $tmp_folder      = TestLib::tempdir;
+       my $tmp_folder      = PostgreSQL::Test::Utils::tempdir;
 
        # Append the rewind-specific role to the connection string.
        $standby_connstr = "$standby_connstr user=rewind_user";
@@ -315,7 +315,7 @@ sub run_pg_rewind
                # segments from the old primary to the archives.  These
                # will be used by pg_rewind.
                rmtree($node_primary->archive_dir);
-               RecursiveCopy::copypath($node_primary->data_dir . "/pg_wal",
+               PostgreSQL::Test::RecursiveCopy::copypath($node_primary->data_dir . "/pg_wal",
                        $node_primary->archive_dir);
 
                # Fast way to remove entire directory content
index c0d0effd92de877cee8e353a958ac35d2d30fb5f..8c71f1111efdb8389f064dfba8a6a2975ee91f19 100644 (file)
@@ -5,7 +5,7 @@ use strict;
 use warnings;
 
 use Config;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 12;
 
 #########################################
index 72e5a42b6f2e3a592dc554451573af844940fbd0..3e58926c96132331bfdd64f35dec09a69f0bc4bd 100644 (file)
@@ -5,7 +5,7 @@ use strict;
 use warnings;
 
 use Config;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 12;
 
 #########################################
index 4ad1c3f0a995cbb104a5c43fc997b16c84613054..33d6b38d33df41f922e6f86889366672a81f9f5a 100644 (file)
@@ -3,10 +3,10 @@
 
 use strict;
 use warnings;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 16;
 
-my $tempdir = TestLib::tempdir;
+my $tempdir = PostgreSQL::Test::Utils::tempdir;
 
 program_help_ok('pg_verifybackup');
 program_version_ok('pg_verifybackup');
index 7dc1af982a34e70ca9e8ba029c0542c4cdb348d2..5c429ea7fcfcde3c6feac6929c52dc843bad17e1 100644 (file)
@@ -8,11 +8,11 @@ use warnings;
 use Cwd;
 use Config;
 use File::Path qw(rmtree);
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 19;
 
-my $primary = PostgresNode->new('primary');
+my $primary = PostgreSQL::Test::Cluster->new('primary');
 $primary->init(allows_streaming => 1);
 $primary->start;
 
index 509390f975706cba98e30799acb0d060e1e74f6e..7a8c5d7a040d175bff0ff659202036d659cb3b99 100644 (file)
@@ -8,17 +8,17 @@ use warnings;
 use Cwd;
 use Config;
 use File::Path qw(rmtree);
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 44;
 
-my $primary = PostgresNode->new('primary');
+my $primary = PostgreSQL::Test::Cluster->new('primary');
 $primary->init(allows_streaming => 1);
 $primary->start;
 
 # Include a user-defined tablespace in the hopes of detecting problems in that
 # area.
-my $source_ts_path   = TestLib::perl2host(TestLib::tempdir_short());
+my $source_ts_path   = PostgreSQL::Test::Utils::perl2host(PostgreSQL::Test::Utils::tempdir_short());
 my $source_ts_prefix = $source_ts_path;
 $source_ts_prefix =~ s!(^[A-Z]:/[^/]*)/.*!$1!;
 
@@ -107,7 +107,7 @@ for my $scenario (@scenario)
 
                # Take a backup and check that it verifies OK.
                my $backup_path    = $primary->backup_dir . '/' . $name;
-               my $backup_ts_path = TestLib::perl2host(TestLib::tempdir_short());
+               my $backup_ts_path = PostgreSQL::Test::Utils::perl2host(PostgreSQL::Test::Utils::tempdir_short());
                # The tablespace map parameter confuses Msys2, which tries to mangle
                # it. Tell it not to.
                # See https://www.msys2.org/wiki/Porting/#filesystem-namespaces
index d4210fd293b2134ab2f2e550b57aae4a35778fc2..22b1444091aca3d4b340003ef5dcea5dd035be14 100644 (file)
@@ -8,12 +8,12 @@ use warnings;
 use Cwd;
 use Config;
 use File::Path qw(rmtree);
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 25;
 
 # Start up the server and take a backup.
-my $primary = PostgresNode->new('primary');
+my $primary = PostgreSQL::Test::Cluster->new('primary');
 $primary->init(allows_streaming => 1);
 $primary->start;
 my $backup_path = $primary->backup_dir . '/test_options';
index 1420cfb352c703ddee558b1e55e0b57aad661aec..c8ea12838ce22ee4d2f50a6073d5c17e8fd0759a 100644 (file)
@@ -8,11 +8,11 @@ use strict;
 use warnings;
 use Cwd;
 use Config;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 58;
 
-my $tempdir = TestLib::tempdir;
+my $tempdir = PostgreSQL::Test::Utils::tempdir;
 
 test_bad_manifest(
        'input string ended unexpectedly',
index c0667b7f43c6ece84a00c010a3b5c26e7cfd5854..21c4198b1c9d5336e1fa9f7be081fdc1d9c1786f 100644 (file)
@@ -7,11 +7,11 @@ use strict;
 use warnings;
 use Cwd;
 use Config;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 5;
 
-my $primary = PostgresNode->new('primary');
+my $primary = PostgreSQL::Test::Cluster->new('primary');
 $primary->init(allows_streaming => 1);
 $primary->start;
 my $backup_path = $primary->backup_dir . '/test_encoding';
index dc85b2a7745762d387db7b440ab3f8bb45f47af8..6eb245a9ef4aafb63eb2f91f01afafb89c81d4ba 100644 (file)
@@ -8,12 +8,12 @@ use warnings;
 use Cwd;
 use Config;
 use File::Path qw(rmtree);
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 9;
 
 # Start up the server and take a backup.
-my $primary = PostgresNode->new('primary');
+my $primary = PostgreSQL::Test::Cluster->new('primary');
 $primary->init(allows_streaming => 1);
 $primary->start;
 my $backup_path = $primary->backup_dir . '/test_wal';
index fb2f807dc3bc96e1ac53cfd377bf663763ae0d6c..fdc968a5ee0d3802cfc9b207a641b017d8db590f 100644 (file)
@@ -3,7 +3,7 @@
 
 use strict;
 use warnings;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 8;
 
 program_help_ok('pg_waldump');
index 7ca96e58cabd34bb9e165db091faebacd258b9e9..69ffa595dd4b9c76eaff91abb7b487952dd41a7a 100644 (file)
@@ -4,13 +4,13 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 use Config;
 
 # start a pgbench specific server
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 $node->start;
 
@@ -20,7 +20,7 @@ $node->start;
 my $ts = $node->basedir . '/regress_pgbench_tap_1_ts_dir';
 mkdir $ts or die "cannot create directory $ts";
 # this takes care of WIN-specific path issues
-my $ets = TestLib::perl2host($ts);
+my $ets = PostgreSQL::Test::Utils::perl2host($ts);
 
 # the next commands will issue a syntax error if the path contains a "'"
 $node->safe_psql('postgres',
@@ -252,7 +252,7 @@ select $$'Valame Dios!' dijo Sancho; 'no le dije yo a vuestra merced que mirase
 select column1::jsonb from (values (:value), (:long)) as q;
 ]
        });
-my $log = TestLib::slurp_file($node->logfile);
+my $log = PostgreSQL::Test::Utils::slurp_file($node->logfile);
 unlike(
        $log,
        qr[DETAIL:  parameters: \$1 = '\{ invalid ',],
@@ -293,7 +293,7 @@ select $$'Valame Dios!' dijo Sancho; 'no le dije yo a vuestra merced que mirase
 select column1::jsonb from (values (:value), (:long)) as q;
 ]
        });
-$log = TestLib::slurp_file($node->logfile);
+$log = PostgreSQL::Test::Utils::slurp_file($node->logfile);
 like(
        $log,
        qr[DETAIL:  parameters: \$1 = '\{ invalid ', \$2 = '''Valame Dios!'' dijo Sancho; ''no le dije yo a vuestra merced que mirase bien lo que hacia\?'''],
@@ -338,7 +338,7 @@ select $$'Valame Dios!' dijo Sancho; 'no le dije yo a vuestra merced que mirase
 select column1::jsonb from (values (:value), (:long)) as q;
 ]
        });
-$log = TestLib::slurp_file($node->logfile);
+$log = PostgreSQL::Test::Utils::slurp_file($node->logfile);
 like(
        $log,
        qr[DETAIL:  parameters: \$1 = '\{ inval\.\.\.', \$2 = '''Valame\.\.\.'],
index da38d9b1d21ede96d7689dcbb8915898d5907777..703eff490ba48dcfdd6cb6a1d27db05444a206bc 100644 (file)
@@ -8,7 +8,7 @@
 use strict;
 use warnings;
 
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More;
 
 # create a directory for scripts
@@ -16,7 +16,7 @@ my $testname = $0;
 $testname =~ s,.*/,,;
 $testname =~ s/\.pl$//;
 
-my $testdir = "$TestLib::tmp_check/t_${testname}_stuff";
+my $testdir = "$PostgreSQL::Test::Utils::tmp_check/t_${testname}_stuff";
 mkdir $testdir
   or BAIL_OUT("could not create test directory \"${testdir}\": $!");
 
index eb9041d1f333352498433620c7861cb82f570685..6ca0bc75d00eddf50d06a98cbb73dfde08d85edb 100644 (file)
@@ -4,8 +4,8 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 25;
 
 program_help_ok('psql');
@@ -60,7 +60,7 @@ foreach my $arg (qw(commands variables))
        is($stderr, '', "psql --help=$arg nothing to stderr");
 }
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 $node->append_conf(
        'postgresql.conf', q{
index dbca56afadc9a84f0e8ee46afe25205aad8248d9..55b318517ea5433f724eaf2a83b1a17146a39096 100644 (file)
@@ -4,8 +4,8 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 use IPC::Run qw(pump finish timer);
 use Data::Dumper;
@@ -34,7 +34,7 @@ if ($@)
 }
 
 # start a new server
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 $node->start;
 
@@ -48,7 +48,7 @@ $node->safe_psql('postgres',
 # their ~/.psql_history, so be sure to redirect history into a temp file.
 # We might as well put it in the test log directory, so that buildfarm runs
 # capture the result for possible debugging purposes.
-my $historyfile = "${TestLib::log_path}/010_psql_history.txt";
+my $historyfile = "${PostgreSQL::Test::Utils::log_path}/010_psql_history.txt";
 $ENV{PSQL_HISTORY} = $historyfile;
 
 # Another pitfall for developers is that they might have a ~/.inputrc
index 0ca8e1743db6478b0163013eaf643b74ecd9c469..28d72caf2ac9f933d9b6f74e572e6f5f470e7bb9 100644 (file)
@@ -4,14 +4,14 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 2;
 use Time::HiRes qw(usleep);
 
-my $tempdir = TestLib::tempdir;
+my $tempdir = PostgreSQL::Test::Utils::tempdir;
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 $node->start;
 
@@ -44,7 +44,7 @@ SKIP: {
        pump $h while length $stdin;
        my $count;
        my $psql_pid;
-       until (-s "$tempdir/psql.pid" and ($psql_pid = TestLib::slurp_file("$tempdir/psql.pid")) =~ /^\d+\n/s)
+       until (-s "$tempdir/psql.pid" and ($psql_pid = PostgreSQL::Test::Utils::slurp_file("$tempdir/psql.pid")) =~ /^\d+\n/s)
        {
                ($count++ < 180 * 100) or die "pid file did not appear";
                usleep(10_000)
index aae5ea985b7fa7ed74224e664135c63ffd0a4df5..0ba4aa4876eae25f97927f2baa6bffb78ad3d685 100644 (file)
@@ -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;
 
index 6ba71780de3f37debaf274dd376a8667f963d371..d040b95cfbfac3df28f5e2ab8f3bc0ec9eb7b15a 100644 (file)
@@ -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;
 
index 3db2f13ae2155daf7888af6e24867dd9bb9f3047..cb8e26c77312dc98ab9ea207a91ae4e48fb416f2 100644 (file)
@@ -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;
 
index 3da8b7ae755366d2ab5aa9bff28c1f03443acb1e..a865c01f5a7bcc06a09608bfd20870b834706a92 100644 (file)
@@ -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;
 
index b9f0592bcaa0dd97e7fa7366a3a21f2b701ddb68..5c9342f290d5bc324ed5ee1c95fd546dea5078d8 100644 (file)
@@ -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;
 
index 26dadaf4a5f0d728b649d8d80b1fad3afb56aeac..5d6e75c903379afe05b53354f306405f9c90c0d3 100644 (file)
@@ -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;
 
index 4f1184953ed49a44f84af7894bcdf394b796148b..42be32decc35c5400e09dc29d388edaae34fc1ac 100644 (file)
@@ -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;
 
index 541504d8f01dc29bc5299d23ad59aae78d97f135..5384b74ccdb8300df1a787eab533894c92654a5d 100644 (file)
@@ -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';");
index 34174e4d71a0164e335260db2a8648a36cde629c..acb24189765b9f6f332be9837a3f75d4dfb6f548 100644 (file)
@@ -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;
 
index 0f1e5bb2788ed7c48efe301d1b2896eb1d32768e..6937a35bc4ac62708018f8e3dda5632d4b44e4b8 100644 (file)
@@ -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;
 
index a60fc79aae7ed5a12331f707dfc01c80236b6f1a..3dfbfbfdb286b33ec8cc8ae12b843658fabb0019 100644 (file)
@@ -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;
 
index c15057a763ed3616fc072098f885f35ca593714d..f7bd45ba922815897cde344ffa4e7b8332652775 100644 (file)
@@ -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;
 
index f702e32f00ee766a83dcf56b679b561232855a65..b2fa50a1c6ddab25e15e616a243664f8266087b7 100644 (file)
@@ -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;
 
index 16570a4e2cb4b4c109c8e0ab0446f212cb9772e9..11ca525c6c6f61654fa9b507fb1dc8ff52c6f79e 100644 (file)
@@ -10,8 +10,8 @@
 
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 if (!$use_unix_sockets)
 {
@@ -64,7 +64,7 @@ sub test_role
 }
 
 # Initialize primary node
-my $node = PostgresNode->new('primary');
+my $node = PostgreSQL::Test::Cluster->new('primary');
 $node->init;
 $node->append_conf('postgresql.conf', "log_connections = on\n");
 $node->start;
@@ -136,7 +136,7 @@ $ENV{"PGCHANNELBINDING"} = 'require';
 test_role($node, 'scram_role', 'scram-sha-256', 2);
 
 # Test .pgpass processing; but use a temp file, don't overwrite the real one!
-my $pgpassfile = "${TestLib::tmp_check}/pgpass";
+my $pgpassfile = "${PostgreSQL::Test::Utils::tmp_check}/pgpass";
 
 delete $ENV{"PGPASSWORD"};
 delete $ENV{"PGCHANNELBINDING"};
index acd379df31666624a3fd1333bedcdc4a2a4b3c04..766fed67cc5c4b09052090e43c8e4a982dfc6eb7 100644 (file)
@@ -7,8 +7,8 @@
 
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 if (!$use_unix_sockets)
 {
@@ -64,7 +64,7 @@ sub test_login
 
 # Initialize primary node. Force UTF-8 encoding, so that we can use non-ASCII
 # characters in the passwords below.
-my $node = PostgresNode->new('primary');
+my $node = PostgreSQL::Test::Cluster->new('primary');
 $node->init(extra => [ '--locale=C', '--encoding=UTF8' ]);
 $node->start;
 
index 968be3952f4cdb63ea680b40e88d8a83ad8e2ac7..13d664dda049614df474aa201df7602a41d12bf2 100644 (file)
@@ -16,8 +16,8 @@
 
 use strict;
 use warnings;
-use TestLib;
-use PostgresNode;
+use PostgreSQL::Test::Utils;
+use PostgreSQL::Test::Cluster;
 use Test::More;
 use Time::HiRes qw(usleep);
 
@@ -69,15 +69,15 @@ my $host     = 'auth-test-localhost.postgresql.example.com';
 my $hostaddr = '127.0.0.1';
 my $realm    = 'EXAMPLE.COM';
 
-my $krb5_conf   = "${TestLib::tmp_check}/krb5.conf";
-my $kdc_conf    = "${TestLib::tmp_check}/kdc.conf";
-my $krb5_cache  = "${TestLib::tmp_check}/krb5cc";
-my $krb5_log    = "${TestLib::log_path}/krb5libs.log";
-my $kdc_log     = "${TestLib::log_path}/krb5kdc.log";
-my $kdc_port    = PostgresNode::get_free_port();
-my $kdc_datadir = "${TestLib::tmp_check}/krb5kdc";
-my $kdc_pidfile = "${TestLib::tmp_check}/krb5kdc.pid";
-my $keytab      = "${TestLib::tmp_check}/krb5.keytab";
+my $krb5_conf   = "${PostgreSQL::Test::Utils::tmp_check}/krb5.conf";
+my $kdc_conf    = "${PostgreSQL::Test::Utils::tmp_check}/kdc.conf";
+my $krb5_cache  = "${PostgreSQL::Test::Utils::tmp_check}/krb5cc";
+my $krb5_log    = "${PostgreSQL::Test::Utils::log_path}/krb5libs.log";
+my $kdc_log     = "${PostgreSQL::Test::Utils::log_path}/krb5kdc.log";
+my $kdc_port    = PostgreSQL::Test::Cluster::get_free_port();
+my $kdc_datadir = "${PostgreSQL::Test::Utils::tmp_check}/krb5kdc";
+my $kdc_pidfile = "${PostgreSQL::Test::Utils::tmp_check}/krb5kdc.pid";
+my $keytab      = "${PostgreSQL::Test::Utils::tmp_check}/krb5.keytab";
 
 my $dbname      = 'postgres';
 my $username    = 'test1';
@@ -167,7 +167,7 @@ END
 
 note "setting up PostgreSQL instance";
 
-my $node = PostgresNode->new('node');
+my $node = PostgreSQL::Test::Cluster->new('node');
 $node->init;
 $node->append_conf(
        'postgresql.conf', qq{
index 104002d149ad1565a489be58b32423e36d7cd1ef..5a9a0098327bcb14eeb78316997ee578ad1e35b2 100644 (file)
@@ -3,8 +3,8 @@
 
 use strict;
 use warnings;
-use TestLib;
-use PostgresNode;
+use PostgreSQL::Test::Utils;
+use PostgreSQL::Test::Cluster;
 use Test::More;
 
 if ($ENV{with_ldap} eq 'yes')
@@ -51,21 +51,21 @@ elsif ($^O eq 'freebsd')
 
 $ENV{PATH} = "$ldap_bin_dir:$ENV{PATH}" if $ldap_bin_dir;
 
-my $ldap_datadir  = "${TestLib::tmp_check}/openldap-data";
-my $slapd_certs   = "${TestLib::tmp_check}/slapd-certs";
-my $slapd_conf    = "${TestLib::tmp_check}/slapd.conf";
-my $slapd_pidfile = "${TestLib::tmp_check}/slapd.pid";
-my $slapd_logfile = "${TestLib::log_path}/slapd.log";
-my $ldap_conf     = "${TestLib::tmp_check}/ldap.conf";
+my $ldap_datadir  = "${PostgreSQL::Test::Utils::tmp_check}/openldap-data";
+my $slapd_certs   = "${PostgreSQL::Test::Utils::tmp_check}/slapd-certs";
+my $slapd_conf    = "${PostgreSQL::Test::Utils::tmp_check}/slapd.conf";
+my $slapd_pidfile = "${PostgreSQL::Test::Utils::tmp_check}/slapd.pid";
+my $slapd_logfile = "${PostgreSQL::Test::Utils::log_path}/slapd.log";
+my $ldap_conf     = "${PostgreSQL::Test::Utils::tmp_check}/ldap.conf";
 my $ldap_server   = 'localhost';
-my $ldap_port     = PostgresNode::get_free_port();
-my $ldaps_port    = PostgresNode::get_free_port();
+my $ldap_port     = PostgreSQL::Test::Cluster::get_free_port();
+my $ldaps_port    = PostgreSQL::Test::Cluster::get_free_port();
 my $ldap_url      = "ldap://$ldap_server:$ldap_port";
 my $ldaps_url     = "ldaps://$ldap_server:$ldaps_port";
 my $ldap_basedn   = 'dc=example,dc=net';
 my $ldap_rootdn   = 'cn=Manager,dc=example,dc=net';
 my $ldap_rootpw   = 'secret';
-my $ldap_pwfile   = "${TestLib::tmp_check}/ldappassword";
+my $ldap_pwfile   = "${PostgreSQL::Test::Utils::tmp_check}/ldappassword";
 
 note "setting up slapd";
 
@@ -155,7 +155,7 @@ system_or_bail 'ldappasswd', '-x', '-y', $ldap_pwfile, '-s', 'secret2',
 
 note "setting up PostgreSQL instance";
 
-my $node = PostgresNode->new('node');
+my $node = PostgreSQL::Test::Cluster->new('node');
 $node->init;
 $node->append_conf('postgresql.conf', "log_connections = on\n");
 $node->start;
index ea2e2944a1577d24604d90051b827c847c9f4567..48bb8abfe6ee1125da77ac4cc2001feca6eba4de 100644 (file)
@@ -6,11 +6,11 @@
 use strict;
 use warnings;
 
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 2;
-use PostgresNode;
+use PostgreSQL::Test::Cluster;
 
-my $node = PostgresNode->new('tango');
+my $node = PostgreSQL::Test::Cluster->new('tango');
 $node->init;
 $node->append_conf('postgresql.conf', 'autovacuum_naptime=1s');
 $node->start;
index 0c504421d44ca844f0817f5ed408d175f3fbad92..16f0f1225347e3a843e657fba48e0e95d6927124 100644 (file)
@@ -6,11 +6,11 @@
 use strict;
 use warnings;
 
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 2;
-use PostgresNode;
+use PostgreSQL::Test::Cluster;
 
-my $node = PostgresNode->new('foxtrot');
+my $node = PostgreSQL::Test::Cluster->new('foxtrot');
 $node->init;
 $node->append_conf('postgresql.conf', 'track_commit_timestamp = on');
 $node->start;
index 227eddeda26d202e2f099b8ec4e9db7b4a103b2a..c22956c9ea0852f97ba759fe1688fec9dcbf1c1d 100644 (file)
@@ -6,12 +6,12 @@
 use strict;
 use warnings;
 
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 4;
-use PostgresNode;
+use PostgreSQL::Test::Cluster;
 
 my $bkplabel = 'backup';
-my $primary  = PostgresNode->new('primary');
+my $primary  = PostgreSQL::Test::Cluster->new('primary');
 $primary->init(allows_streaming => 1);
 
 $primary->append_conf(
@@ -22,7 +22,7 @@ $primary->append_conf(
 $primary->start;
 $primary->backup($bkplabel);
 
-my $standby = PostgresNode->new('standby');
+my $standby = PostgreSQL::Test::Cluster->new('standby');
 $standby->init_from_backup($primary, $bkplabel, has_streaming => 1);
 $standby->start;
 
index 27c5bfbfb73cf7c50ed0a416a6be8438f4d080dd..a6e9f4188e9efed069a7c746fd5c71a21a160c78 100644 (file)
@@ -6,12 +6,12 @@
 use strict;
 use warnings;
 
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 4;
-use PostgresNode;
+use PostgreSQL::Test::Cluster;
 
 my $bkplabel = 'backup';
-my $primary  = PostgresNode->new('primary');
+my $primary  = PostgreSQL::Test::Cluster->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 = PostgresNode->new('standby');
+my $standby = PostgreSQL::Test::Cluster->new('standby');
 $standby->init_from_backup($primary, $bkplabel, has_streaming => 1);
 $standby->start;
 
index 5d92c5a2e6de944beeb3b350ebf21f5fed71d877..c0f3a7c8af5d752e6bcda7114dfd4096502f337f 100644 (file)
@@ -4,11 +4,11 @@
 # Testing of commit timestamps preservation across restarts
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 16;
 
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(allows_streaming => 1);
 $node_primary->append_conf('postgresql.conf', 'track_commit_timestamp = on');
 $node_primary->start;
index 7f648b19a26140f0dc685dc57fb32e6e207496e8..4f9b67f2544a8945feed0120ec14e6a0ad0313c3 100644 (file)
@@ -5,11 +5,11 @@ use strict;
 use warnings;
 
 use Config;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 $node->start;
 
@@ -19,7 +19,7 @@ my ($out, $err) = run_command([ 'libpq_pipeline', 'tests' ]);
 die "oops: $err" unless $err eq '';
 my @tests = split(/\s+/, $out);
 
-mkdir "$TestLib::tmp_check/traces";
+mkdir "$PostgreSQL::Test::Utils::tmp_check/traces";
 
 for my $testname (@tests)
 {
@@ -29,7 +29,7 @@ for my $testname (@tests)
                  pipeline_abort transaction disallowed_in_pipeline)) > 0;
 
        # For a bunch of tests, generate a libpq trace file too.
-       my $traceout = "$TestLib::tmp_check/traces/$testname.trace";
+       my $traceout = "$PostgreSQL::Test::Utils::tmp_check/traces/$testname.trace";
        if ($cmptrace)
        {
                push @extraargs, "-t", $traceout;
index 1f28f303f1aaf77b614c719fc033cce3967b1e4e..7fcba283e99ff9c0545e6fcc7ce81093665f40ed 100644 (file)
@@ -6,9 +6,9 @@ use warnings;
 
 use File::Copy;
 
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Test::More;
-use PostgresNode;
+use PostgreSQL::Test::Cluster;
 
 unless (($ENV{with_ssl} || "") eq 'openssl')
 {
@@ -20,7 +20,7 @@ my $rot13pass = "SbbOnE1";
 
 # see the Makefile for how the certificate and key have been generated
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 $node->append_conf('postgresql.conf',
        "ssl_passphrase.passphrase = '$rot13pass'");
@@ -63,7 +63,7 @@ like(
 $node->append_conf('postgresql.conf', "ssl_passphrase.passphrase = 'blurfl'");
 
 # try to start the server again
-my $ret = TestLib::system_log('pg_ctl', '-D', $node->data_dir, '-l',
+my $ret = PostgreSQL::Test::Utils::system_log('pg_ctl', '-D', $node->data_dir, '-l',
        $node->logfile, 'start');
 
 
index 7c1929f8053e958fcab224cde0c66f0e5d8456ff..147daf0832633da09b06d81c5396af26a0d66ce5 100644 (file)
@@ -5,12 +5,12 @@
 
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 42;
 
 # Initialize a test cluster
-my $node = PostgresNode->new('primary');
+my $node = PostgreSQL::Test::Cluster->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');
index 17c404c81f237585750d58da1534a07ebb4a0e8e..16f7610883bc87688abff81cef29b97574e0e9aa 100644 (file)
@@ -5,11 +5,11 @@ use strict;
 use warnings;
 
 use Config;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 
-my $tempdir       = TestLib::tempdir;
+my $tempdir       = PostgreSQL::Test::Utils::tempdir;
 
 ###############################################################
 # This structure is based off of the src/bin/pg_dump/t test
@@ -28,7 +28,7 @@ my $tempdir       = TestLib::tempdir;
 # the full command and arguments to run.  Note that this is run
 # using $node->command_ok(), so the port does not need to be
 # specified and is pulled from $PGPORT, which is set by the
-# PostgresNode system.
+# PostgreSQL::Test::Cluster system.
 #
 # restore_cmd is the pg_restore command to run, if any.  Note
 # that this should generally be used when the pg_dump goes to
@@ -712,7 +712,7 @@ my %tests = (
 #########################################
 # Create a PG instance to test actually dumping from
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 $node->init;
 $node->start;
 
index 3d3a95b52fd394d2d35c276e40d2483469fcf775..60cdbe777bb69b096e3390aa5775e3163896c12b 100644 (file)
@@ -16,20 +16,20 @@ include $(top_builddir)/src/Makefile.global
 ifeq ($(enable_tap_tests),yes)
 
 installdirs:
-       $(MKDIR_P) '$(DESTDIR)$(pgxsdir)/$(subdir)'
+       $(MKDIR_P) '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test'
 
 install: all installdirs
-       $(INSTALL_DATA) $(srcdir)/TestLib.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/TestLib.pm'
-       $(INSTALL_DATA) $(srcdir)/SimpleTee.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/SimpleTee.pm'
-       $(INSTALL_DATA) $(srcdir)/RecursiveCopy.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/RecursiveCopy.pm'
-       $(INSTALL_DATA) $(srcdir)/PostgresNode.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgresNode.pm'
-       $(INSTALL_DATA) $(srcdir)/PostgresVersion.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgresVersion.pm'
+       $(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/Utils.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/Utils.pm'
+       $(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/SimpleTee.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/SimpleTee.pm'
+       $(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/RecursiveCopy.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/RecursiveCopy.pm'
+       $(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/Cluster.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/Cluster.pm'
+       $(INSTALL_DATA) $(srcdir)/PostgreSQL/Version.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Version.pm'
 
 uninstall:
-       rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/TestLib.pm'
-       rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/SimpleTee.pm'
-       rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/RecursiveCopy.pm'
-       rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgresNode.pm'
-       rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgresVersion.pm'
+       rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/Utils.pm'
+       rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/SimpleTee.pm'
+       rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/RecursiveCopy.pm'
+       rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/Cluster.pm'
+       rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Version.pm'
 
 endif
similarity index 92%
rename from src/test/perl/PostgresNode.pm
rename to src/test/perl/PostgreSQL/Test/Cluster.pm
index 465fdb68708787c799ce35bb67e195e716136ac5..86eb920ea10b9e24dbdc032bbe3379ab25d3c97c 100644 (file)
@@ -5,13 +5,13 @@
 
 =head1 NAME
 
-PostgresNode - class representing PostgreSQL server instance
+PostgreSQL::Test::Cluster - class representing PostgreSQL server instance
 
 =head1 SYNOPSIS
 
-  use PostgresNode;
+  use PostgreSQL::Test::Cluster;
 
-  my $node = PostgresNode->new('mynode');
+  my $node = PostgreSQL::Test::Cluster->new('mynode');
 
   # Create a data directory with initdb
   $node->init();
@@ -61,7 +61,7 @@ PostgresNode - class representing PostgreSQL server instance
   my $ret = $node->backup_fs_cold('testbackup3')
 
   # Restore it to create a new independent node (not a replica)
-  my $other_node = PostgresNode->new('mycopy');
+  my $other_node = PostgreSQL::Test::Cluster->new('mycopy');
   $other_node->init_from_backup($node, 'testbackup');
   $other_node->start;
 
@@ -69,15 +69,15 @@ PostgresNode - class representing PostgreSQL server instance
   $node->stop('fast');
 
   # Find a free, unprivileged TCP port to bind some other service to
-  my $port = PostgresNode::get_free_port();
+  my $port = PostgreSQL::Test::Cluster::get_free_port();
 
 =head1 DESCRIPTION
 
-PostgresNode contains a set of routines able to work on a PostgreSQL node,
+PostgreSQL::Test::Cluster contains a set of routines able to work on a PostgreSQL node,
 allowing to start, stop, backup and initialize it with various options.
 The set of nodes managed by a given test is also managed by this module.
 
-In addition to node management, PostgresNode instances have some wrappers
+In addition to node management, PostgreSQL::Test::Cluster instances have some wrappers
 around Test::More functions to run commands with an environment set up to
 point to the instance.
 
@@ -85,7 +85,7 @@ The IPC::Run module is required.
 
 =cut
 
-package PostgresNode;
+package PostgreSQL::Test::Cluster;
 
 use strict;
 use warnings;
@@ -100,11 +100,11 @@ use File::Spec;
 use File::stat qw(stat);
 use File::Temp ();
 use IPC::Run;
-use PostgresVersion;
-use RecursiveCopy;
+use PostgreSQL::Version;
+use PostgreSQL::Test::RecursiveCopy;
 use Socket;
 use Test::More;
-use TestLib ();
+use PostgreSQL::Test::Utils ();
 use Time::HiRes qw(usleep);
 use Scalar::Util qw(blessed);
 
@@ -116,10 +116,10 @@ INIT
 
        # Set PGHOST for backward compatibility.  This doesn't work for own_host
        # nodes, so prefer to not rely on this when writing new tests.
-       $use_tcp            = !$TestLib::use_unix_sockets;
+       $use_tcp            = !$PostgreSQL::Test::Utils::use_unix_sockets;
        $test_localhost     = "127.0.0.1";
        $last_host_assigned = 1;
-       $test_pghost        = $use_tcp ? $test_localhost : TestLib::tempdir_short;
+       $test_pghost        = $use_tcp ? $test_localhost : PostgreSQL::Test::Utils::tempdir_short;
        $ENV{PGHOST}        = $test_pghost;
        $ENV{PGDATABASE}    = 'postgres';
 
@@ -369,8 +369,8 @@ sub set_replication_conf
          or croak "set_replication_conf only works with the default host";
 
        open my $hba, '>>', "$pgdata/pg_hba.conf";
-       print $hba "\n# Allow replication (set up by PostgresNode.pm)\n";
-       if ($TestLib::windows_os && !$TestLib::use_unix_sockets)
+       print $hba "\n# Allow replication (set up by PostgreSQL::Test::Cluster.pm)\n";
+       if ($PostgreSQL::Test::Utils::windows_os && !$PostgreSQL::Test::Utils::use_unix_sockets)
        {
                print $hba
                  "host replication all $test_localhost/32 sspi include_realm=1 map=regress\n";
@@ -419,13 +419,13 @@ sub init
        mkdir $self->backup_dir;
        mkdir $self->archive_dir;
 
-       TestLib::system_or_bail('initdb', '-D', $pgdata, '-A', 'trust', '-N',
+       PostgreSQL::Test::Utils::system_or_bail('initdb', '-D', $pgdata, '-A', 'trust', '-N',
                @{ $params{extra} });
-       TestLib::system_or_bail($ENV{PG_REGRESS}, '--config-auth', $pgdata,
+       PostgreSQL::Test::Utils::system_or_bail($ENV{PG_REGRESS}, '--config-auth', $pgdata,
                @{ $params{auth_extra} });
 
        open my $conf, '>>', "$pgdata/postgresql.conf";
-       print $conf "\n# Added by PostgresNode.pm\n";
+       print $conf "\n# Added by PostgreSQL::Test::Cluster.pm\n";
        print $conf "fsync = off\n";
        print $conf "restart_after_crash = off\n";
        print $conf "log_line_prefix = '%m [%p] %q%a '\n";
@@ -437,7 +437,7 @@ sub init
        # TEMP_CONFIG.  Otherwise, print it before TEMP_CONFIG, thereby permitting
        # overrides.  Settings that merely improve performance or ease debugging
        # belong before TEMP_CONFIG.
-       print $conf TestLib::slurp_file($ENV{TEMP_CONFIG})
+       print $conf PostgreSQL::Test::Utils::slurp_file($ENV{TEMP_CONFIG})
          if defined $ENV{TEMP_CONFIG};
 
        # XXX Neutralize any stats_temp_directory in TEMP_CONFIG.  Nodes running
@@ -510,7 +510,7 @@ sub append_conf
 
        my $conffile = $self->data_dir . '/' . $filename;
 
-       TestLib::append_to_file($conffile, $str . "\n");
+       PostgreSQL::Test::Utils::append_to_file($conffile, $str . "\n");
 
        chmod($self->group_access() ? 0640 : 0600, $conffile)
          or die("unable to set permissions for $conffile");
@@ -538,7 +538,7 @@ sub adjust_conf
 
        my $conffile = $self->data_dir . '/' . $filename;
 
-       my $contents = TestLib::slurp_file($conffile);
+       my $contents = PostgreSQL::Test::Utils::slurp_file($conffile);
        my @lines    = split(/\n/, $contents);
        my @result;
        my $eq = $skip_equals ? '' : '= ';
@@ -587,7 +587,7 @@ sub backup
        local %ENV = $self->_get_env();
 
        print "# Taking pg_basebackup $backup_name from node \"$name\"\n";
-       TestLib::system_or_bail(
+       PostgreSQL::Test::Utils::system_or_bail(
                'pg_basebackup', '-D',
                $backup_path,    '-h',
                $self->host,     '-p',
@@ -652,7 +652,7 @@ sub _backup_fs
                print "# pg_start_backup: $stdout\n";
        }
 
-       RecursiveCopy::copypath(
+       PostgreSQL::Test::RecursiveCopy::copypath(
                $self->data_dir,
                $backup_path,
                filterfn => sub {
@@ -682,7 +682,7 @@ sub _backup_fs
 =item $node->init_from_backup(root_node, backup_name)
 
 Initialize a node from a backup, which may come from this node or a different
-node. root_node must be a PostgresNode reference, backup_name the string name
+node. root_node must be a PostgreSQL::Test::Cluster reference, backup_name the string name
 of a backup previously created on that node with $node->backup.
 
 Does not start the node after initializing it.
@@ -732,10 +732,10 @@ sub init_from_backup
        if (defined $params{tar_program})
        {
                mkdir($data_path);
-               TestLib::system_or_bail($params{tar_program}, 'xf',
+               PostgreSQL::Test::Utils::system_or_bail($params{tar_program}, 'xf',
                        $backup_path . '/base.tar',
                        '-C', $data_path);
-               TestLib::system_or_bail(
+               PostgreSQL::Test::Utils::system_or_bail(
                        $params{tar_program},         'xf',
                        $backup_path . '/pg_wal.tar', '-C',
                        $data_path . '/pg_wal');
@@ -743,7 +743,7 @@ sub init_from_backup
        else
        {
                rmdir($data_path);
-               RecursiveCopy::copypath($backup_path, $data_path);
+               PostgreSQL::Test::RecursiveCopy::copypath($backup_path, $data_path);
        }
        chmod(0700, $data_path);
 
@@ -827,13 +827,13 @@ sub start
        # sub init) so that it does not get copied to standbys.
        # -w is now the default but having it here does no harm and helps
        # compatibility with older versions.
-       $ret = TestLib::system_log('pg_ctl', '-w', '-D', $self->data_dir, '-l',
+       $ret = PostgreSQL::Test::Utils::system_log('pg_ctl', '-w', '-D', $self->data_dir, '-l',
                $self->logfile, '-o', "--cluster-name=$name", 'start');
 
        if ($ret != 0)
        {
                print "# pg_ctl start failed; logfile:\n";
-               print TestLib::slurp_file($self->logfile);
+               print PostgreSQL::Test::Utils::slurp_file($self->logfile);
                BAIL_OUT("pg_ctl start failed") unless $params{fail_ok};
                return 0;
        }
@@ -865,7 +865,7 @@ sub kill9
        print "### Killing node \"$name\" using signal 9\n";
        # kill(9, ...) fails under msys Perl 5.8.8, so fall back on pg_ctl.
        kill(9, $self->{_pid})
-         or TestLib::system_or_bail('pg_ctl', 'kill', 'KILL', $self->{_pid});
+         or PostgreSQL::Test::Utils::system_or_bail('pg_ctl', 'kill', 'KILL', $self->{_pid});
        $self->{_pid} = undef;
        return;
 }
@@ -894,7 +894,7 @@ sub stop
        $mode = 'fast' unless defined $mode;
        return unless defined $self->{_pid};
        print "### Stopping node \"$name\" using mode $mode\n";
-       TestLib::system_or_bail('pg_ctl', '-D', $pgdata, '-m', $mode, 'stop');
+       PostgreSQL::Test::Utils::system_or_bail('pg_ctl', '-D', $pgdata, '-m', $mode, 'stop');
        $self->_update_pid(0);
        return;
 }
@@ -917,7 +917,7 @@ sub reload
        local %ENV = $self->_get_env();
 
        print "### Reloading node \"$name\"\n";
-       TestLib::system_or_bail('pg_ctl', '-D', $pgdata, 'reload');
+       PostgreSQL::Test::Utils::system_or_bail('pg_ctl', '-D', $pgdata, 'reload');
        return;
 }
 
@@ -943,7 +943,7 @@ sub restart
 
        # -w is now the default but having it here does no harm and helps
        # compatibility with older versions.
-       TestLib::system_or_bail('pg_ctl', '-w', '-D', $pgdata, '-l', $logfile,
+       PostgreSQL::Test::Utils::system_or_bail('pg_ctl', '-w', '-D', $pgdata, '-l', $logfile,
                'restart');
 
        $self->_update_pid(1);
@@ -969,7 +969,7 @@ sub promote
        local %ENV = $self->_get_env();
 
        print "### Promoting node \"$name\"\n";
-       TestLib::system_or_bail('pg_ctl', '-D', $pgdata, '-l', $logfile,
+       PostgreSQL::Test::Utils::system_or_bail('pg_ctl', '-D', $pgdata, '-l', $logfile,
                'promote');
        return;
 }
@@ -993,7 +993,7 @@ sub logrotate
        local %ENV = $self->_get_env();
 
        print "### Rotating log in node \"$name\"\n";
-       TestLib::system_or_bail('pg_ctl', '-D', $pgdata, '-l', $logfile,
+       PostgreSQL::Test::Utils::system_or_bail('pg_ctl', '-D', $pgdata, '-l', $logfile,
                'logrotate');
        return;
 }
@@ -1018,7 +1018,7 @@ primary_conninfo='$root_connstr'
 sub enable_restoring
 {
        my ($self, $root_node, $standby) = @_;
-       my $path = TestLib::perl2host($root_node->archive_dir);
+       my $path = PostgreSQL::Test::Utils::perl2host($root_node->archive_dir);
        my $name = $self->name;
 
        print "### Enabling WAL restore for node \"$name\"\n";
@@ -1029,9 +1029,9 @@ sub enable_restoring
        # in this routine, using only one back-slash, need to be properly changed
        # first. Paths also need to be double-quoted to prevent failures where
        # the path contains spaces.
-       $path =~ s{\\}{\\\\}g if ($TestLib::windows_os);
+       $path =~ s{\\}{\\\\}g if ($PostgreSQL::Test::Utils::windows_os);
        my $copy_command =
-         $TestLib::windows_os
+         $PostgreSQL::Test::Utils::windows_os
          ? qq{copy "$path\\\\%f" "%p"}
          : qq{cp "$path/%f" "%p"};
 
@@ -1086,7 +1086,7 @@ sub set_standby_mode
 sub enable_archiving
 {
        my ($self) = @_;
-       my $path   = TestLib::perl2host($self->archive_dir);
+       my $path   = PostgreSQL::Test::Utils::perl2host($self->archive_dir);
        my $name   = $self->name;
 
        print "### Enabling WAL archiving for node \"$name\"\n";
@@ -1097,9 +1097,9 @@ sub enable_archiving
        # in this routine, using only one back-slash, need to be properly changed
        # first. Paths also need to be double-quoted to prevent failures where
        # the path contains spaces.
-       $path =~ s{\\}{\\\\}g if ($TestLib::windows_os);
+       $path =~ s{\\}{\\\\}g if ($PostgreSQL::Test::Utils::windows_os);
        my $copy_command =
-         $TestLib::windows_os
+         $PostgreSQL::Test::Utils::windows_os
          ? qq{copy "%p" "$path\\\\%f"}
          : qq{cp "%p" "$path/%f"};
 
@@ -1141,9 +1141,9 @@ sub _update_pid
 
 =pod
 
-=item PostgresNode->new(node_name, %params)
+=item PostgreSQL::Test::Cluster->new(node_name, %params)
 
-Build a new object of class C<PostgresNode> (or of a subclass, if you have
+Build a new object of class C<PostgreSQL::Test::Cluster> (or of a subclass, if you have
 one), assigning a free port number.  Remembers the node, to prevent its port
 number from being reused for another node, and to ensure that it gets
 shut down when the test script exits.
@@ -1216,11 +1216,11 @@ sub new
        my $node = {
                _port    => $port,
                _host    => $host,
-               _basedir => "$TestLib::tmp_check/t_${testname}_${name}_data",
+               _basedir => "$PostgreSQL::Test::Utils::tmp_check/t_${testname}_${name}_data",
                _name    => $name,
                _logfile_generation => 0,
-               _logfile_base       => "$TestLib::log_path/${testname}_${name}",
-               _logfile            => "$TestLib::log_path/${testname}_${name}.log"
+               _logfile_base       => "$PostgreSQL::Test::Utils::log_path/${testname}_${name}",
+               _logfile            => "$PostgreSQL::Test::Utils::log_path/${testname}_${name}.log"
        };
 
        if ($params{install_path})
@@ -1242,7 +1242,7 @@ sub new
 
        my $v = $node->{_pg_version};
 
-       carp("PostgresNode isn't fully compatible with version " . $v)
+       carp("PostgreSQL::Test::Cluster isn't fully compatible with version " . $v)
          if $v < 12;
 
        return $node;
@@ -1272,9 +1272,9 @@ sub _set_pg_version
                $pg_config = "$inst/bin/pg_config";
                BAIL_OUT("pg_config not found: $pg_config")
                  unless -e $pg_config
-                 or ($TestLib::windows_os and -e "$pg_config.exe");
+                 or ($PostgreSQL::Test::Utils::windows_os and -e "$pg_config.exe");
                BAIL_OUT("pg_config not executable: $pg_config")
-                 unless $TestLib::windows_os or -x $pg_config;
+                 unless $PostgreSQL::Test::Utils::windows_os or -x $pg_config;
 
                # Leave $pg_config install_path qualified, to be sure we get the right
                # version information, below, or die trying
@@ -1286,7 +1286,7 @@ sub _set_pg_version
        my $version_line = qx{$pg_config --version};
        BAIL_OUT("$pg_config failed: $!") if $?;
 
-       $self->{_pg_version} = PostgresVersion->new($version_line);
+       $self->{_pg_version} = PostgreSQL::Version->new($version_line);
 
        BAIL_OUT("could not parse pg_config --version output: $version_line")
          unless defined $self->{_pg_version};
@@ -1331,7 +1331,7 @@ sub _get_env
        my $inst = $self->{_install_path};
        if ($inst)
        {
-               if ($TestLib::windows_os)
+               if ($PostgreSQL::Test::Utils::windows_os)
                {
                        # Windows picks up DLLs from the PATH rather than *LD_LIBRARY_PATH
                        # choose the right path separator
@@ -1394,14 +1394,14 @@ Locate an unprivileged (high) TCP port that's not currently bound to
 anything.  This is used by C<new()>, and also by some test cases that need to
 start other, non-Postgres servers.
 
-Ports assigned to existing PostgresNode objects are automatically
+Ports assigned to existing PostgreSQL::Test::Cluster objects are automatically
 excluded, even if those servers are not currently running.
 
 XXX A port available now may become unavailable by the time we start
 the desired service.
 
 Note: this is not an instance method. As it's not exported it should be
-called from outside the module as C<PostgresNode::get_free_port()>.
+called from outside the module as C<PostgreSQL::Test::Cluster::get_free_port()>.
 
 =cut
 
@@ -1440,7 +1440,7 @@ sub get_free_port
                if ($found == 1)
                {
                        foreach my $addr (qw(127.0.0.1),
-                               ($use_tcp && $TestLib::windows_os)
+                               ($use_tcp && $PostgreSQL::Test::Utils::windows_os)
                                  ? qw(127.0.0.2 127.0.0.3 0.0.0.0)
                                  : ())
                        {
@@ -1474,7 +1474,7 @@ sub can_bind
 
        # As in postmaster, don't use SO_REUSEADDR on Windows
        setsockopt(SOCK, SOL_SOCKET, SO_REUSEADDR, pack("l", 1))
-         unless $TestLib::windows_os;
+         unless $PostgreSQL::Test::Utils::windows_os;
        my $ret = bind(SOCK, $paddr) && listen(SOCK, SOMAXCONN);
        close(SOCK);
        return $ret;
@@ -1496,7 +1496,7 @@ END
                next if defined $ENV{'PG_TEST_NOCLEAN'};
 
                # clean basedir on clean test invocation
-               $node->clean_node if $exit_code == 0 && TestLib::all_tests_passing();
+               $node->clean_node if $exit_code == 0 && PostgreSQL::Test::Utils::all_tests_passing();
        }
 
        $? = $exit_code;
@@ -2008,7 +2008,7 @@ sub _pgbench_make_files
                                ok(0, "$filename must not already exist");
                                unlink $filename or die "cannot unlink $filename: $!";
                        }
-                       TestLib::append_to_file($filename, $$files{$fn});
+                       PostgreSQL::Test::Utils::append_to_file($filename, $$files{$fn});
                }
        }
 
@@ -2194,7 +2194,7 @@ sub connect_ok
        }
        if (@log_like or @log_unlike)
        {
-               my $log_contents = TestLib::slurp_file($self->logfile, $log_location);
+               my $log_contents = PostgreSQL::Test::Utils::slurp_file($self->logfile, $log_location);
 
                while (my $regex = shift @log_like)
                {
@@ -2264,7 +2264,7 @@ sub connect_fails
 
        if (@log_like or @log_unlike)
        {
-               my $log_contents = TestLib::slurp_file($self->logfile, $log_location);
+               my $log_contents = PostgreSQL::Test::Utils::slurp_file($self->logfile, $log_location);
 
                while (my $regex = shift @log_like)
                {
@@ -2343,8 +2343,8 @@ $stderr);
 
 =item $node->command_ok(...)
 
-Runs a shell command like TestLib::command_ok, but with PGHOST and PGPORT set
-so that the command will default to connecting to this PostgresNode.
+Runs a shell command like PostgreSQL::Test::Utils::command_ok, but with PGHOST and PGPORT set
+so that the command will default to connecting to this PostgreSQL::Test::Cluster.
 
 =cut
 
@@ -2356,7 +2356,7 @@ sub command_ok
 
        local %ENV = $self->_get_env();
 
-       TestLib::command_ok(@_);
+       PostgreSQL::Test::Utils::command_ok(@_);
        return;
 }
 
@@ -2364,7 +2364,7 @@ sub command_ok
 
 =item $node->command_fails(...)
 
-TestLib::command_fails with our connection parameters. See command_ok(...)
+PostgreSQL::Test::Utils::command_fails with our connection parameters. See command_ok(...)
 
 =cut
 
@@ -2376,7 +2376,7 @@ sub command_fails
 
        local %ENV = $self->_get_env();
 
-       TestLib::command_fails(@_);
+       PostgreSQL::Test::Utils::command_fails(@_);
        return;
 }
 
@@ -2384,7 +2384,7 @@ sub command_fails
 
 =item $node->command_like(...)
 
-TestLib::command_like with our connection parameters. See command_ok(...)
+PostgreSQL::Test::Utils::command_like with our connection parameters. See command_ok(...)
 
 =cut
 
@@ -2396,7 +2396,7 @@ sub command_like
 
        local %ENV = $self->_get_env();
 
-       TestLib::command_like(@_);
+       PostgreSQL::Test::Utils::command_like(@_);
        return;
 }
 
@@ -2404,7 +2404,7 @@ sub command_like
 
 =item $node->command_fails_like(...)
 
-TestLib::command_fails_like with our connection parameters. See command_ok(...)
+PostgreSQL::Test::Utils::command_fails_like with our connection parameters. See command_ok(...)
 
 =cut
 
@@ -2416,7 +2416,7 @@ sub command_fails_like
 
        local %ENV = $self->_get_env();
 
-       TestLib::command_fails_like(@_);
+       PostgreSQL::Test::Utils::command_fails_like(@_);
        return;
 }
 
@@ -2424,7 +2424,7 @@ sub command_fails_like
 
 =item $node->command_checks_all(...)
 
-TestLib::command_checks_all with our connection parameters. See
+PostgreSQL::Test::Utils::command_checks_all with our connection parameters. See
 command_ok(...)
 
 =cut
@@ -2437,7 +2437,7 @@ sub command_checks_all
 
        local %ENV = $self->_get_env();
 
-       TestLib::command_checks_all(@_);
+       PostgreSQL::Test::Utils::command_checks_all(@_);
        return;
 }
 
@@ -2460,9 +2460,9 @@ sub issues_sql_like
 
        my $log_location = -s $self->logfile;
 
-       my $result = TestLib::run_log($cmd);
+       my $result = PostgreSQL::Test::Utils::run_log($cmd);
        ok($result, "@$cmd exit code 0");
-       my $log = TestLib::slurp_file($self->logfile, $log_location);
+       my $log = PostgreSQL::Test::Utils::slurp_file($self->logfile, $log_location);
        like($log, $expected_sql, "$test_name: SQL found in server log");
        return;
 }
@@ -2471,8 +2471,8 @@ sub issues_sql_like
 
 =item $node->run_log(...)
 
-Runs a shell command like TestLib::run_log, but with connection parameters set
-so that the command will default to connecting to this PostgresNode.
+Runs a shell command like PostgreSQL::Test::Utils::run_log, but with connection parameters set
+so that the command will default to connecting to this PostgreSQL::Test::Cluster.
 
 =cut
 
@@ -2482,7 +2482,7 @@ sub run_log
 
        local %ENV = $self->_get_env();
 
-       TestLib::run_log(@_);
+       PostgreSQL::Test::Utils::run_log(@_);
        return;
 }
 
@@ -2563,8 +2563,8 @@ sub wait_for_catchup
          . join(', ', keys(%valid_modes))
          unless exists($valid_modes{$mode});
 
-       # Allow passing of a PostgresNode instance as shorthand
-       if (blessed($standby_name) && $standby_name->isa("PostgresNode"))
+       # Allow passing of a PostgreSQL::Test::Cluster instance as shorthand
+       if (blessed($standby_name) && $standby_name->isa("PostgreSQL::Test::Cluster"))
        {
                $standby_name = $standby_name->name;
        }
similarity index 91%
rename from src/test/perl/RecursiveCopy.pm
rename to src/test/perl/PostgreSQL/Test/RecursiveCopy.pm
index 8a9cc722b556571e2e985aa7b812d84db7e4e177..dd320a605e354b26261204d737c112630e596741 100644 (file)
@@ -5,18 +5,18 @@
 
 =head1 NAME
 
-RecursiveCopy - simple recursive copy implementation
+PostgreSQL::Test::RecursiveCopy - simple recursive copy implementation
 
 =head1 SYNOPSIS
 
-use RecursiveCopy;
+use PostgreSQL::Test::RecursiveCopy;
 
-RecursiveCopy::copypath($from, $to, filterfn => sub { return 1; });
-RecursiveCopy::copypath($from, $to);
+PostgreSQL::Test::RecursiveCopy::copypath($from, $to, filterfn => sub { return 1; });
+PostgreSQL::Test::RecursiveCopy::copypath($from, $to);
 
 =cut
 
-package RecursiveCopy;
+package PostgreSQL::Test::RecursiveCopy;
 
 use strict;
 use warnings;
@@ -54,7 +54,7 @@ attempted.
 
 =head1 EXAMPLES
 
- RecursiveCopy::copypath('/some/path', '/empty/dir',
PostgreSQL::Test::RecursiveCopy::copypath('/some/path', '/empty/dir',
     filterfn => sub {
                # omit log/ and contents
                my $src = shift;
similarity index 94%
rename from src/test/perl/SimpleTee.pm
rename to src/test/perl/PostgreSQL/Test/SimpleTee.pm
index 681a36a0f8e8b04120629fb27f3fba6fe6d68cfe..80a56fc0ea84d23c3c7d524626ff41b210b2e374 100644 (file)
@@ -10,7 +10,7 @@
 # method is currently implemented; that's all we need. We don't want to
 # depend on IO::Tee just for this.
 
-package SimpleTee;
+package PostgreSQL::Test::SimpleTee;
 use strict;
 use warnings;
 
similarity index 96%
rename from src/test/perl/TestLib.pm
rename to src/test/perl/PostgreSQL/Test/Utils.pm
index 06aae1760ebf938f9b3adb6ec4f9962a2daeaecb..f29d43f1f3215b96496e4adde309d1d490a244c6 100644 (file)
@@ -5,11 +5,11 @@
 
 =head1 NAME
 
-TestLib - helper module for writing PostgreSQL's C<prove> tests.
+PostgreSQL::Test::Utils - helper module for writing PostgreSQL's C<prove> tests.
 
 =head1 SYNOPSIS
 
-  use TestLib;
+  use PostgreSQL::Test::Utils;
 
   # Test basic output of a command
   program_help_ok('initdb');
@@ -19,19 +19,19 @@ TestLib - helper module for writing PostgreSQL's C<prove> tests.
   # Test option combinations
   command_fails(['initdb', '--invalid-option'],
               'command fails with invalid option');
-  my $tempdir = TestLib::tempdir;
+  my $tempdir = PostgreSQL::Test::Utils::tempdir;
   command_ok('initdb', '-D', $tempdir);
 
   # Miscellanea
-  print "on Windows" if $TestLib::windows_os;
-  my $path = TestLib::perl2host($backup_dir);
+  print "on Windows" if $PostgreSQL::Test::Utils::windows_os;
+  my $path = PostgreSQL::Test::Utils::perl2host($backup_dir);
   ok(check_mode_recursive($stream_dir, 0700, 0600),
     "check stream dir permissions");
-  TestLib::system_log('pg_ctl', 'kill', 'QUIT', $slow_pid);
+  PostgreSQL::Test::Utils::system_log('pg_ctl', 'kill', 'QUIT', $slow_pid);
 
 =head1 DESCRIPTION
 
-C<TestLib> contains a set of routines dedicated to environment setup for
+C<PostgreSQL::Test::Utils> contains a set of routines dedicated to environment setup for
 a PostgreSQL regression test run and includes some low-level routines
 aimed at controlling command execution, logging and test functions.
 
@@ -40,7 +40,7 @@ aimed at controlling command execution, logging and test functions.
 # This module should never depend on any other PostgreSQL regression test
 # modules.
 
-package TestLib;
+package PostgreSQL::Test::Utils;
 
 use strict;
 use warnings;
@@ -56,7 +56,7 @@ use File::Spec;
 use File::stat qw(stat);
 use File::Temp ();
 use IPC::Run;
-use SimpleTee;
+use PostgreSQL::Test::SimpleTee;
 
 # specify a recent enough version of Test::More to support the
 # done_testing() function
@@ -212,9 +212,9 @@ INIT
        # in the log.
        my $builder = Test::More->builder;
        my $fh      = $builder->output;
-       tie *$fh, "SimpleTee", $orig_stdout, $testlog;
+       tie *$fh, "PostgreSQL::Test::SimpleTee", $orig_stdout, $testlog;
        $fh = $builder->failure_output;
-       tie *$fh, "SimpleTee", $orig_stderr, $testlog;
+       tie *$fh, "PostgreSQL::Test::SimpleTee", $orig_stderr, $testlog;
 
        # Enable auto-flushing for all the file handles. Stderr and stdout are
        # redirected to the same file, and buffering causes the lines to appear
similarity index 87%
rename from src/test/perl/PostgresVersion.pm
rename to src/test/perl/PostgreSQL/Version.pm
index 5ff701ce112d4ca863282fa563fb2623d540ab8b..08c7f7f51914811e074e4efa9a27f0964b15761c 100644 (file)
@@ -1,6 +1,6 @@
 ############################################################################
 #
-# PostgresVersion.pm
+# PostgreSQL/Version.pm
 #
 # Module encapsulating Postgres Version numbers
 #
 
 =head1 NAME
 
-PostgresVersion - class representing PostgreSQL version numbers
+PostgreSQL::Version - class representing PostgreSQL version numbers
 
 =head1 SYNOPSIS
 
-  use PostgresVersion;
+  use PostgreSQL::Version;
 
-  my $version = PostgresVersion->new($version_arg);
+  my $version = PostgreSQL::Version->new($version_arg);
 
   # compare two versions
   my $bool = $version1 <= $version2;
@@ -37,12 +37,12 @@ PostgresVersion - class representing PostgreSQL version numbers
 
 =head1 DESCRIPTION
 
-PostgresVersion encapsulates Postgres version numbers, providing parsing
+PostgreSQL::Version encapsulates Postgres version numbers, providing parsing
 of common version formats and comparison operations.
 
 =cut
 
-package PostgresVersion;
+package PostgreSQL::Version;
 
 use strict;
 use warnings;
@@ -60,9 +60,9 @@ use overload
 
 =over
 
-=item PostgresVersion->new($version)
+=item PostgreSQL::Version->new($version)
 
-Create a new PostgresVersion instance.
+Create a new PostgreSQL::Version instance.
 
 The argument can be a number like 12, or a string like '12.2' or the output
 of a Postgres command like `psql --version` or `pg_config --version`;
@@ -103,7 +103,7 @@ sub new
 
 # Routine which compares the _pg_version_array obtained for the two
 # arguments and returns -1, 0, or 1, allowing comparison between two
-# PostgresVersion objects or a PostgresVersion and a version string or number.
+# PostgreSQL::Version objects or a PostgreSQL::Version and a version string or number.
 #
 # If the second argument is not a blessed object we call the constructor
 # to make one.
index b2a5541557b0dbe83533cd8075393561ebd4abda..0e9a00ea058b074ed30e6c03e2ba6390f5dbdc70 100644 (file)
@@ -40,15 +40,15 @@ Each test script should begin with:
 
     use strict;
     use warnings;
-    use PostgresNode;
-    use TestLib;
+    use PostgreSQL::Test::Cluster;
+    use PostgreSQL::Test::Utils;
     # Replace with the number of tests to execute:
     use Test::More tests => 1;
 
 then it will generally need to set up one or more nodes, run commands
 against them and evaluate the results. For example:
 
-    my $node = PostgresNode->new('primary');
+    my $node = PostgreSQL::Test::Cluster->new('primary');
     $node->init;
     $node->start;
 
@@ -76,7 +76,7 @@ Read the documentation for more on how to write tests:
 For available PostgreSQL-specific test methods and some example tests read the
 perldoc for the test modules, e.g.:
 
-    perldoc src/test/perl/PostgresNode.pm
+    perldoc src/test/perl/PostgreSQL/Test/Cluster.pm
 
 Portability
 -----------
index 9916a36012c85a685f3b67f8146355f67fd962f2..bc62ec66bce9da80d4d5bec87ee9809b92951c38 100644 (file)
@@ -4,12 +4,12 @@
 # Minimal test testing streaming replication
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 49;
 
 # Initialize primary node
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 # A specific role is created to perform some tests related to replication,
 # and it needs proper authentication configuration.
 $node_primary->init(
@@ -22,7 +22,7 @@ my $backup_name = 'my_backup';
 $node_primary->backup($backup_name);
 
 # Create streaming standby linking to primary
-my $node_standby_1 = PostgresNode->new('standby_1');
+my $node_standby_1 = PostgreSQL::Test::Cluster->new('standby_1');
 $node_standby_1->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
 $node_standby_1->start;
@@ -37,7 +37,7 @@ $node_standby_1->backup('my_backup_2');
 $node_primary->start;
 
 # Create second standby node linking to standby 1
-my $node_standby_2 = PostgresNode->new('standby_2');
+my $node_standby_2 = PostgreSQL::Test::Cluster->new('standby_2');
 $node_standby_2->init_from_backup($node_standby_1, $backup_name,
        has_streaming => 1);
 $node_standby_2->start;
index ce60159f036163b9ad857f44f7bb6e3491636fdb..24852c97fda80a7d5dd0f2b422eb3ddd51fd8bbb 100644 (file)
@@ -4,13 +4,13 @@
 # test for archiving with hot standby
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 3;
 use File::Copy;
 
 # Initialize primary node, doing archives
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(
        has_archiving    => 1,
        allows_streaming => 1);
@@ -23,7 +23,7 @@ $node_primary->start;
 $node_primary->backup($backup_name);
 
 # Initialize standby node from backup, fetching WAL from archives
-my $node_standby = PostgresNode->new('standby');
+my $node_standby = PostgreSQL::Test::Cluster->new('standby');
 $node_standby->init_from_backup($node_primary, $backup_name,
        has_restoring => 1);
 $node_standby->append_conf('postgresql.conf',
@@ -62,7 +62,7 @@ is($result, qq(1000), 'check content from archives');
 # promoted.
 $node_standby->promote;
 
-my $node_standby2 = PostgresNode->new('standby2');
+my $node_standby2 = PostgreSQL::Test::Cluster->new('standby2');
 $node_standby2->init_from_backup($node_primary, $backup_name,
        has_restoring => 1);
 $node_standby2->start;
index 78ef60d3b2d46403d2bac4955b9910b4eb405be1..0d0636b85c090096292d6d11492f5eaffe12e356 100644 (file)
@@ -4,8 +4,8 @@
 # Test for recovery targets: name, timestamp, XID
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 9;
 use Time::HiRes qw(usleep);
 
@@ -23,7 +23,7 @@ sub test_recovery_standby
        my $num_rows        = shift;
        my $until_lsn       = shift;
 
-       my $node_standby = PostgresNode->new($node_name);
+       my $node_standby = PostgreSQL::Test::Cluster->new($node_name);
        $node_standby->init_from_backup($node_primary, 'my_backup',
                has_restoring => 1);
 
@@ -52,7 +52,7 @@ sub test_recovery_standby
 }
 
 # Initialize primary node
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(has_archiving => 1, allows_streaming => 1);
 
 # Bump the transaction ID epoch.  This is useful to stress the portability
@@ -138,7 +138,7 @@ test_recovery_standby('LSN', 'standby_5', $node_primary, \@recovery_params,
 test_recovery_standby('multiple overriding settings',
        'standby_6', $node_primary, \@recovery_params, "3000", $lsn3);
 
-my $node_standby = PostgresNode->new('standby_7');
+my $node_standby = PostgreSQL::Test::Cluster->new('standby_7');
 $node_standby->init_from_backup($node_primary, 'my_backup',
        has_restoring => 1);
 $node_standby->append_conf(
@@ -158,7 +158,7 @@ ok($logfile =~ qr/multiple recovery targets specified/,
 
 # Check behavior when recovery ends before target is reached
 
-$node_standby = PostgresNode->new('standby_8');
+$node_standby = PostgreSQL::Test::Cluster->new('standby_8');
 $node_standby->init_from_backup(
        $node_primary, 'my_backup',
        has_restoring => 1,
index 07b152704382c5858a6d49f8ed34746d630485b2..56dd1c4f1aa134e7ca86de0cd707e456f5f051b7 100644 (file)
@@ -5,8 +5,8 @@
 use strict;
 use warnings;
 use File::Path qw(rmtree);
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 3;
 
 $ENV{PGDATABASE} = 'postgres';
@@ -15,7 +15,7 @@ $ENV{PGDATABASE} = 'postgres';
 # on a new timeline.
 
 # Initialize primary node
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(allows_streaming => 1);
 $node_primary->start;
 
@@ -24,11 +24,11 @@ my $backup_name = 'my_backup';
 $node_primary->backup($backup_name);
 
 # Create two standbys linking to it
-my $node_standby_1 = PostgresNode->new('standby_1');
+my $node_standby_1 = PostgreSQL::Test::Cluster->new('standby_1');
 $node_standby_1->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
 $node_standby_1->start;
-my $node_standby_2 = PostgresNode->new('standby_2');
+my $node_standby_2 = PostgreSQL::Test::Cluster->new('standby_2');
 $node_standby_2->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
 $node_standby_2->start;
@@ -76,7 +76,7 @@ is($result, qq(2000), 'check content of standby 2');
 # when WAL archiving is enabled.
 
 # Initialize primary node
-my $node_primary_2 = PostgresNode->new('primary_2');
+my $node_primary_2 = PostgreSQL::Test::Cluster->new('primary_2');
 $node_primary_2->init(allows_streaming => 1, has_archiving => 1);
 $node_primary_2->append_conf(
        'postgresql.conf', qq(
@@ -88,7 +88,7 @@ $node_primary_2->start;
 $node_primary_2->backup($backup_name);
 
 # Create standby node
-my $node_standby_3 = PostgresNode->new('standby_3');
+my $node_standby_3 = PostgreSQL::Test::Cluster->new('standby_3');
 $node_standby_3->init_from_backup($node_primary_2, $backup_name,
        has_streaming => 1);
 
index 0b56380e0a77851acc0fe38bcb76cb30dc35b76a..db44c287d260412a0078c20141a42c793ea7af0e 100644 (file)
@@ -5,12 +5,12 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 3;
 
 # Initialize primary node
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(allows_streaming => 1);
 $node_primary->start;
 
@@ -23,7 +23,7 @@ my $backup_name = 'my_backup';
 $node_primary->backup($backup_name);
 
 # Create streaming standby from backup
-my $node_standby = PostgresNode->new('standby');
+my $node_standby = PostgreSQL::Test::Cluster->new('standby');
 my $delay        = 3;
 $node_standby->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
@@ -58,7 +58,7 @@ ok(time() - $primary_insert_time >= $delay,
 
 
 # Check that recovery can be paused or resumed expectedly.
-my $node_standby2 = PostgresNode->new('standby2');
+my $node_standby2 = PostgreSQL::Test::Cluster->new('standby2');
 $node_standby2->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
 $node_standby2->start;
index cc116062c2c45060e9ac2f0fa93046bb467973e2..1655298bf5ba1a6d1cce0492ff39c184f45b6c26 100644 (file)
@@ -8,13 +8,13 @@
 # are required.
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 14;
 use Config;
 
 # Initialize primary node
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(allows_streaming => 1);
 $node_primary->append_conf(
        'postgresql.conf', qq(
index 3b031addf7667a477307c1f7169bf97f1dd34a48..0d0e60b772371bf12d7791e199caa4b44d01995c 100644 (file)
@@ -4,8 +4,8 @@
 # Minimal test testing synchronous replication sync_state transition
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 11;
 
 # Query checking sync_priority and sync_state of each standby
@@ -51,7 +51,7 @@ sub start_standby_and_wait
 }
 
 # Initialize primary node
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(allows_streaming => 1);
 $node_primary->start;
 my $backup_name = 'primary_backup';
@@ -63,19 +63,19 @@ $node_primary->backup($backup_name);
 # the ordering of each one of them in the WAL sender array of the primary.
 
 # Create standby1 linking to primary
-my $node_standby_1 = PostgresNode->new('standby1');
+my $node_standby_1 = PostgreSQL::Test::Cluster->new('standby1');
 $node_standby_1->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
 start_standby_and_wait($node_primary, $node_standby_1);
 
 # Create standby2 linking to primary
-my $node_standby_2 = PostgresNode->new('standby2');
+my $node_standby_2 = PostgreSQL::Test::Cluster->new('standby2');
 $node_standby_2->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
 start_standby_and_wait($node_primary, $node_standby_2);
 
 # Create standby3 linking to primary
-my $node_standby_3 = PostgresNode->new('standby3');
+my $node_standby_3 = PostgreSQL::Test::Cluster->new('standby3');
 $node_standby_3->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
 start_standby_and_wait($node_primary, $node_standby_3);
@@ -125,7 +125,7 @@ standby3|3|sync),
 start_standby_and_wait($node_primary, $node_standby_1);
 
 # Create standby4 linking to primary
-my $node_standby_4 = PostgresNode->new('standby4');
+my $node_standby_4 = PostgreSQL::Test::Cluster->new('standby4');
 $node_standby_4->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
 $node_standby_4->start;
index b1082546a81534b66577c09abc2fb615cd31420d..e8c59678fdbb0919c723477c35e1c9ebe226da24 100644 (file)
@@ -8,11 +8,11 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 1;
 
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(allows_streaming => 1);
 
 $node_primary->append_conf(
@@ -28,7 +28,7 @@ autovacuum = off
 $node_primary->start;
 
 $node_primary->backup('primary_backup');
-my $node_standby = PostgresNode->new('standby');
+my $node_standby = PostgreSQL::Test::Cluster->new('standby');
 $node_standby->init_from_backup($node_primary, 'primary_backup',
        has_streaming => 1);
 $node_standby->start;
index 66a256208c46c6040fd24ccf9ac3431e77d2da2b..b11832b99a98f9958e392ec5cd93a2da09432da5 100644 (file)
@@ -5,8 +5,8 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 24;
 
 my $psql_out = '';
@@ -31,7 +31,7 @@ sub configure_and_reload
 # Set up two nodes, which will alternately be primary and replication standby.
 
 # Setup london node
-my $node_london = PostgresNode->new("london");
+my $node_london = PostgreSQL::Test::Cluster->new("london");
 $node_london->init(allows_streaming => 1);
 $node_london->append_conf(
        'postgresql.conf', qq(
@@ -42,7 +42,7 @@ $node_london->start;
 $node_london->backup('london_backup');
 
 # Setup paris node
-my $node_paris = PostgresNode->new('paris');
+my $node_paris = PostgreSQL::Test::Cluster->new('paris');
 $node_paris->init_from_backup($node_london, 'london_backup',
        has_streaming => 1);
 $node_paris->start;
index 2a9cf3b79c34390adbeb43b473e48f6a3d6d3b92..68d94ac91c90fbe91cdeb83ec478b00a910f7620 100644 (file)
@@ -24,8 +24,8 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 13;
 use File::Copy;
 use IPC::Run ();
@@ -34,7 +34,7 @@ use Scalar::Util qw(blessed);
 my ($stdout, $stderr, $ret);
 
 # Initialize primary node
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(allows_streaming => 1, has_archiving => 1);
 $node_primary->append_conf(
        'postgresql.conf', q[
@@ -74,7 +74,7 @@ $node_primary->backup_fs_hot($backup_name);
 $node_primary->safe_psql('postgres',
        q[SELECT pg_create_physical_replication_slot('phys_slot');]);
 
-my $node_replica = PostgresNode->new('replica');
+my $node_replica = PostgreSQL::Test::Cluster->new('replica');
 $node_replica->init_from_backup(
        $node_primary, $backup_name,
        has_streaming => 1,
index 72fc603e6d27c07826becc5db1c6b288d1ddac94..d7806e667155c615d9df33f76cc93558b5bcbeb2 100644 (file)
@@ -6,14 +6,14 @@
 #
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 use Config;
 
 plan tests => 3;
 
-my $node = PostgresNode->new('primary');
+my $node = PostgreSQL::Test::Cluster->new('primary');
 $node->init(allows_streaming => 1);
 $node->start;
 
index a3655a076b88bfd8c72c309232e149cd19ed864d..dbdc2d38bd335c444e30b359ddb97bc3f5ba75e4 100644 (file)
@@ -5,12 +5,12 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 12;
 
 # Setup primary node
-my $node_primary = PostgresNode->new("primary");
+my $node_primary = PostgreSQL::Test::Cluster->new("primary");
 $node_primary->init(allows_streaming => 1);
 $node_primary->append_conf(
        'postgresql.conf', qq(
@@ -22,7 +22,7 @@ $node_primary->backup('primary_backup');
 $node_primary->psql('postgres', "CREATE TABLE t_012_tbl (id int)");
 
 # Setup standby node
-my $node_standby = PostgresNode->new('standby');
+my $node_standby = PostgreSQL::Test::Cluster->new('standby');
 $node_standby->init_from_backup($node_primary, 'primary_backup',
        has_streaming => 1);
 $node_standby->start;
index b5e3457753f24c1e3e4aba3290e6698f1a1b31d9..49aee1e243f9d0497416f2d1df9830e4c058fc2c 100644 (file)
@@ -13,8 +13,8 @@
 #
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 use Config;
 
@@ -27,11 +27,11 @@ plan tests => 18;
 # is really wrong.
 my $psql_timeout = IPC::Run::timer(60);
 
-my $node = PostgresNode->new('primary');
+my $node = PostgreSQL::Test::Cluster->new('primary');
 $node->init(allows_streaming => 1);
 $node->start();
 
-# by default PostgresNode doesn't doesn't restart after a crash
+# by default PostgreSQL::Test::Cluster doesn't doesn't restart after a crash
 $node->safe_psql(
        'postgres',
        q[ALTER SYSTEM SET restart_after_crash = 1;
@@ -105,7 +105,7 @@ $monitor_stdout = '';
 $monitor_stderr = '';
 
 # kill once with QUIT - we expect psql to exit, while emitting error message first
-my $ret = TestLib::system_log('pg_ctl', 'kill', 'QUIT', $pid);
+my $ret = PostgreSQL::Test::Utils::system_log('pg_ctl', 'kill', 'QUIT', $pid);
 
 # Exactly process should have been alive to be killed
 is($ret, 0, "killed process with SIGQUIT");
@@ -184,7 +184,7 @@ $monitor_stderr = '';
 
 # kill with SIGKILL this time - we expect the backend to exit, without
 # being able to emit an error message
-$ret = TestLib::system_log('pg_ctl', 'kill', 'KILL', $pid);
+$ret = PostgreSQL::Test::Utils::system_log('pg_ctl', 'kill', 'KILL', $pid);
 is($ret, 0, "killed process with KILL");
 
 # Check that psql sees the server as being terminated. No WARNING,
index 4c22663b644ef8348e9f4b78804b93804ce283c9..7d6b0e3c683196f8e7d1074ee21c74825c455b2c 100644 (file)
@@ -8,11 +8,11 @@
 
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 12;
 
-my $node = PostgresNode->new('main');
+my $node = PostgreSQL::Test::Cluster->new('main');
 
 $node->init;
 $node->start;
@@ -31,9 +31,9 @@ ok(-f "$pgdata/$baseUnloggedPath",        'main fork in base exists');
 
 # Create an unlogged table in a tablespace.
 
-my $tablespaceDir = TestLib::tempdir;
+my $tablespaceDir = PostgreSQL::Test::Utils::tempdir;
 
-my $realTSDir = TestLib::perl2host($tablespaceDir);
+my $realTSDir = PostgreSQL::Test::Utils::perl2host($tablespaceDir);
 
 $node->safe_psql('postgres', "CREATE TABLESPACE ts1 LOCATION '$realTSDir'");
 $node->safe_psql('postgres',
index 562c4cd3e4fbbdf555c820efc8097b6aa703d982..b0f5ae615a6ca040522fbdc1dcc82da7f4a98fdd 100644 (file)
@@ -7,12 +7,12 @@
 # recovery point defined.
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 1;
 
 # Initialize primary node
-my $alpha = PostgresNode->new('alpha');
+my $alpha = PostgreSQL::Test::Cluster->new('alpha');
 $alpha->init(allows_streaming => 1);
 # Setting wal_log_hints to off is important to get invalid page
 # references.
@@ -25,7 +25,7 @@ $alpha->start;
 
 # setup/start a standby
 $alpha->backup('bkp');
-my $bravo = PostgresNode->new('bravo');
+my $bravo = PostgreSQL::Test::Cluster->new('bravo');
 $bravo->init_from_backup($alpha, 'bkp', has_streaming => 1);
 $bravo->append_conf('postgresql.conf', <<EOF);
 checkpoint_timeout=1h
index 23f4c4274538a7ec4dadfe0f0c37a09a36e7b1ba..87995a73ea68d19696185d64596636f3f9d04813 100644 (file)
@@ -9,8 +9,8 @@
 
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 1;
 
 # Find the largest LSN in the set of pages part of the given relation
@@ -43,7 +43,7 @@ sub find_largest_lsn
 }
 
 # Initialize primary node
-my $primary = PostgresNode->new('primary');
+my $primary = PostgreSQL::Test::Cluster->new('primary');
 $primary->init(allows_streaming => 1);
 
 # Set shared_buffers to a very low value to enforce discard and flush
@@ -61,7 +61,7 @@ $primary->start;
 
 # setup/start a standby
 $primary->backup('bkp');
-my $standby = PostgresNode->new('standby');
+my $standby = PostgreSQL::Test::Cluster->new('standby');
 $standby->init_from_backup($primary, 'bkp', has_streaming => 1);
 $standby->start;
 
index 5548a1556d365f0e1f1ae6122bf7e122e5c11442..29667d1f3982d05a8e98781a3ae63e99871c4f9c 100644 (file)
@@ -9,9 +9,9 @@ use warnings;
 use Config;
 use File::stat qw(stat);
 use IPC::Run 'run';
-use PostgresNode;
+use PostgreSQL::Test::Cluster;
 use Test::More;
-use TestLib;
+use PostgreSQL::Test::Utils;
 use Time::HiRes qw(usleep);
 
 # If we don't have shmem support, skip the whole thing
@@ -30,7 +30,7 @@ else
        plan tests => 4;
 }
 
-my $tempdir = TestLib::tempdir;
+my $tempdir = PostgreSQL::Test::Utils::tempdir;
 
 # Log "ipcs" diffs on a best-effort basis, swallowing any error.
 my $ipcs_before = "$tempdir/ipcs_before";
@@ -43,7 +43,7 @@ sub log_ipcs
 }
 
 # Node setup.
-my $gnat = PostgresNode->new('gnat');
+my $gnat = PostgreSQL::Test::Cluster->new('gnat');
 $gnat->init;
 
 # Create a shmem segment that will conflict with gnat's first choice
@@ -116,7 +116,7 @@ log_ipcs();
 $gnat->start;
 log_ipcs();
 
-my $regress_shlib = TestLib::perl2host($ENV{REGRESS_SHLIB});
+my $regress_shlib = PostgreSQL::Test::Utils::perl2host($ENV{REGRESS_SHLIB});
 $gnat->safe_psql('postgres', <<EOSQL);
 CREATE FUNCTION wait_pid(int)
    RETURNS void
@@ -175,7 +175,7 @@ like($single_stderr, $pre_existing_msg,
 log_ipcs();
 
 # cleanup slow backend
-TestLib::system_log('pg_ctl', 'kill', 'QUIT', $slow_pid);
+PostgreSQL::Test::Utils::system_log('pg_ctl', 'kill', 'QUIT', $slow_pid);
 $slow_client->finish;    # client has detected backend termination
 log_ipcs();
 
index 3bedeffcae19c2e13c0e5ffefd9de6036ef91077..5fd5ad804996ddbcd5c0880969a9fc014d14a28c 100644 (file)
@@ -12,8 +12,8 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 38;
 
 sub check_orphan_relfilenodes
@@ -45,7 +45,7 @@ sub run_wal_optimize
 {
        my $wal_level = shift;
 
-       my $node = PostgresNode->new("node_$wal_level");
+       my $node = PostgreSQL::Test::Cluster->new("node_$wal_level");
        $node->init;
        $node->append_conf(
                'postgresql.conf', qq(
@@ -60,7 +60,7 @@ wal_skip_threshold = 0
        # Setup
        my $tablespace_dir = $node->basedir . '/tablespace_other';
        mkdir($tablespace_dir);
-       $tablespace_dir = TestLib::perl2host($tablespace_dir);
+       $tablespace_dir = PostgreSQL::Test::Utils::perl2host($tablespace_dir);
        my $result;
 
        # Test redo of CREATE TABLESPACE.
@@ -148,11 +148,11 @@ wal_skip_threshold = 0
        # Data file for COPY query in subsequent tests
        my $basedir   = $node->basedir;
        my $copy_file = "$basedir/copy_data.txt";
-       TestLib::append_to_file(
+       PostgreSQL::Test::Utils::append_to_file(
                $copy_file, qq(20000,30000
 20001,30001
 20002,30002));
-       $copy_file = TestLib::perl2host($copy_file);
+       $copy_file = PostgreSQL::Test::Utils::perl2host($copy_file);
 
        # Test truncation with inserted tuples using both INSERT and COPY.  Tuples
        # inserted after the truncation should be seen.
index e065c5c008c18b9aebe2d8c1f75976b8f5ba9fd0..2275e28a502e644f53d1b334211555d12ad2b61f 100644 (file)
@@ -7,17 +7,17 @@
 use strict;
 use warnings;
 
-use TestLib;
-use PostgresNode;
+use PostgreSQL::Test::Utils;
+use PostgreSQL::Test::Cluster;
 
 use File::Path qw(rmtree);
-use Test::More tests => $TestLib::windows_os ? 16 : 20;
+use Test::More tests => $PostgreSQL::Test::Utils::windows_os ? 16 : 20;
 use Time::HiRes qw(usleep);
 
 $ENV{PGDATABASE} = 'postgres';
 
 # Initialize primary node, setting wal-segsize to 1MB
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(allows_streaming => 1, extra => ['--wal-segsize=1']);
 $node_primary->append_conf(
        'postgresql.conf', qq(
@@ -41,7 +41,7 @@ my $backup_name = 'my_backup';
 $node_primary->backup($backup_name);
 
 # Create a standby linking to it using the replication slot
-my $node_standby = PostgresNode->new('standby_1');
+my $node_standby = PostgreSQL::Test::Cluster->new('standby_1');
 $node_standby->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
 $node_standby->append_conf('postgresql.conf', "primary_slot_name = 'rep1'");
@@ -260,7 +260,7 @@ ok($failed, 'check that replication has been broken');
 $node_primary->stop;
 $node_standby->stop;
 
-my $node_primary2 = PostgresNode->new('primary2');
+my $node_primary2 = PostgreSQL::Test::Cluster->new('primary2');
 $node_primary2->init(allows_streaming => 1);
 $node_primary2->append_conf(
        'postgresql.conf', qq(
@@ -281,7 +281,7 @@ max_slot_wal_keep_size = 0
 ));
 $node_primary2->start;
 
-$node_standby = PostgresNode->new('standby_2');
+$node_standby = PostgreSQL::Test::Cluster->new('standby_2');
 $node_standby->init_from_backup($node_primary2, $backup_name,
        has_streaming => 1);
 $node_standby->append_conf('postgresql.conf', "primary_slot_name = 'rep1'");
@@ -305,7 +305,7 @@ $node_standby->stop;
 # The next test depends on Perl's `kill`, which apparently is not
 # portable to Windows.  (It would be nice to use Test::More's `subtest`,
 # but that's not in the ancient version we require.)
-if ($TestLib::windows_os)
+if ($PostgreSQL::Test::Utils::windows_os)
 {
        done_testing();
        exit;
@@ -313,7 +313,7 @@ if ($TestLib::windows_os)
 
 # Get a slot terminated while the walsender is active
 # We do this by sending SIGSTOP to the walsender.  Skip this on Windows.
-my $node_primary3 = PostgresNode->new('primary3');
+my $node_primary3 = PostgreSQL::Test::Cluster->new('primary3');
 $node_primary3->init(allows_streaming => 1, extra => ['--wal-segsize=1']);
 $node_primary3->append_conf(
        'postgresql.conf', qq(
@@ -329,7 +329,7 @@ $node_primary3->safe_psql('postgres',
 $backup_name = 'my_backup';
 $node_primary3->backup($backup_name);
 # Create standby
-my $node_standby3 = PostgresNode->new('standby_3');
+my $node_standby3 = PostgreSQL::Test::Cluster->new('standby_3');
 $node_standby3->init_from_backup($node_primary3, $backup_name,
        has_streaming => 1);
 $node_standby3->append_conf('postgresql.conf', "primary_slot_name = 'rep3'");
@@ -419,7 +419,7 @@ sub find_in_log
        my ($node, $pat, $off) = @_;
 
        $off = 0 unless defined $off;
-       my $log = TestLib::slurp_file($node->logfile);
+       my $log = PostgreSQL::Test::Utils::slurp_file($node->logfile);
        return 0 if (length($log) <= $off);
 
        $log = substr($log, $off);
index cea65735a39d7efea353f61d3250f63739d9e455..68a21eb82ce955e032bcb92ee2d7514f91321b97 100644 (file)
@@ -6,12 +6,12 @@
 #
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 16;
 use Config;
 
-my $primary = PostgresNode->new('primary');
+my $primary = PostgreSQL::Test::Cluster->new('primary');
 $primary->init(
        has_archiving    => 1,
        allows_streaming => 1);
@@ -27,7 +27,7 @@ my $primary_data = $primary->data_dir;
 # a portable solution, use an archive command based on a command known to
 # work but will fail: copy with an incorrect original path.
 my $incorrect_command =
-  $TestLib::windows_os
+  $PostgreSQL::Test::Utils::windows_os
   ? qq{copy "%p_does_not_exist" "%f_does_not_exist"}
   : qq{cp "%p_does_not_exist" "%f_does_not_exist"};
 $primary->safe_psql(
@@ -138,7 +138,7 @@ $primary->poll_query_until('postgres',
   or die "Timed out while waiting for archiving to finish";
 
 # Test standby with archive_mode = on.
-my $standby1 = PostgresNode->new('standby');
+my $standby1 = PostgreSQL::Test::Cluster->new('standby');
 $standby1->init_from_backup($primary, 'backup', has_restoring => 1);
 $standby1->append_conf('postgresql.conf', "archive_mode = on");
 my $standby1_data = $standby1->data_dir;
@@ -174,7 +174,7 @@ ok( -f "$standby1_data/$segment_path_2_done",
 # command to fail to persist the .ready files.  Note that this node
 # has inherited the archive command of the previous cold backup that
 # will cause archiving failures.
-my $standby2 = PostgresNode->new('standby2');
+my $standby2 = PostgreSQL::Test::Cluster->new('standby2');
 $standby2->init_from_backup($primary, 'backup', has_restoring => 1);
 $standby2->append_conf('postgresql.conf', 'archive_mode = always');
 my $standby2_data = $standby2->data_dir;
index 7f40977976b17300b4d8d2ef49213a59697fbcc0..2d409434ef4fa29192921ebdadb99e01605f1391 100644 (file)
@@ -6,13 +6,13 @@
 use strict;
 use warnings;
 
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 10;
 use Config;
 
 # Initialize primary node
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(allows_streaming => 1);
 $node_primary->append_conf('postgresql.conf', 'max_prepared_transactions=10');
 $node_primary->start;
@@ -26,7 +26,7 @@ my $backup_name = 'my_backup';
 $node_primary->backup($backup_name);
 
 # Create streaming standby from backup
-my $node_standby = PostgresNode->new('standby');
+my $node_standby = PostgreSQL::Test::Cluster->new('standby');
 $node_standby->init_from_backup($node_primary, $backup_name,
        has_streaming => 1);
 $node_standby->append_conf('postgresql.conf', 'max_prepared_transactions=10');
@@ -187,7 +187,7 @@ sub send_query_and_wait
        $$psql{run}->pump_nb();
        while (1)
        {
-               # See PostgresNode.pm's psql()
+               # See PostgreSQL::Test::Cluster.pm's psql()
                $$psql{stdout} =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
 
                last if $$psql{stdout} =~ /$untl/;
index cc8c8664e28833ce2a51a914460a25969fa28dfe..bf95a30761afc0c54c3ed2dca0e338ba6c1f6c86 100644 (file)
@@ -4,8 +4,8 @@
 # Test remove of temporary files after a crash.
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 use Config;
 
@@ -26,11 +26,11 @@ else
 # is really wrong.
 my $psql_timeout = IPC::Run::timer(60);
 
-my $node = PostgresNode->new('node_crash');
+my $node = PostgreSQL::Test::Cluster->new('node_crash');
 $node->init();
 $node->start();
 
-# By default, PostgresNode doesn't restart after crash
+# By default, PostgreSQL::Test::Cluster doesn't restart after crash
 # Reduce work_mem to generate temporary file with a few number of rows
 $node->safe_psql(
        'postgres',
@@ -131,7 +131,7 @@ $killme_stdout2 = '';
 $killme_stderr2 = '';
 
 # Kill with SIGKILL
-my $ret = TestLib::system_log('pg_ctl', 'kill', 'KILL', $pid);
+my $ret = PostgreSQL::Test::Utils::system_log('pg_ctl', 'kill', 'KILL', $pid);
 is($ret, 0, 'killed process with KILL');
 
 # Close psql session
@@ -220,7 +220,7 @@ $killme_stdout2 = '';
 $killme_stderr2 = '';
 
 # Kill with SIGKILL
-$ret = TestLib::system_log('pg_ctl', 'kill', 'KILL', $pid);
+$ret = PostgreSQL::Test::Utils::system_log('pg_ctl', 'kill', 'KILL', $pid);
 is($ret, 0, 'killed process with KILL');
 
 # Close psql session
index a1ff97d070acf508427eeb1b1f01897358f98dcf..4fcc7ad40020623ab19015fdcb6869d656a1c4a9 100644 (file)
@@ -4,13 +4,13 @@
 # Test for point-in-time-recovery (PITR) with prepared transactions
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 1;
 use File::Compare;
 
 # Initialize and start primary node with WAL archiving
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(has_archiving => 1, allows_streaming => 1);
 $node_primary->append_conf(
        'postgresql.conf', qq{
@@ -24,7 +24,7 @@ $node_primary->backup($backup_name);
 # Initialize node for PITR targeting a very specific restore point, just
 # after a PREPARE TRANSACTION is issued so as we finish with a promoted
 # node where this 2PC transaction needs an explicit COMMIT PREPARED.
-my $node_pitr = PostgresNode->new('node_pitr');
+my $node_pitr = PostgreSQL::Test::Cluster->new('node_pitr');
 $node_pitr->init_from_backup(
        $node_primary, $backup_name,
        standby       => 0,
index 32be5c4251574615e412c7e1be5dad1b2c84ee0b..70ef9c7e67282859175990577d8e2fff609e397c 100644 (file)
@@ -4,14 +4,14 @@
 # Test for archive recovery of WAL generated with wal_level=minimal
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 2;
 use Time::HiRes qw(usleep);
 
 # Initialize and start node with wal_level = replica and WAL archiving
 # enabled.
-my $node = PostgresNode->new('orig');
+my $node = PostgreSQL::Test::Cluster->new('orig');
 $node->init(has_archiving => 1, allows_streaming => 1);
 my $replica_config = q[
 wal_level = replica
@@ -66,7 +66,7 @@ sub test_recovery_wal_level_minimal
 {
        my ($node_name, $node_text, $standby_setting) = @_;
 
-       my $recovery_node = PostgresNode->new($node_name);
+       my $recovery_node = PostgreSQL::Test::Cluster->new($node_name);
        $recovery_node->init_from_backup(
                $node, $backup_name,
                has_restoring => 1,
index 00ee9fcaeddedb2512921acaa49f21b3c09b7906..4e0f6291f4e3979ce4f78504b8f225ed8f8d42d4 100644 (file)
@@ -8,15 +8,15 @@
 # standby can follow the new primary (promoted standby).
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 
 use File::Basename;
 use FindBin;
 use Test::More tests => 1;
 
 # Initialize primary node
-my $node_primary = PostgresNode->new('primary');
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 
 # Set up an archive command that will copy the history file but not the WAL
 # files. No real archive command should behave this way; the point is to
@@ -28,10 +28,10 @@ $node_primary->init(allows_streaming => 1, has_archiving => 1);
 # Note: consistent use of forward slashes here avoids any escaping problems
 # that arise from use of backslashes. That means we need to double-quote all
 # the paths in the archive_command
-my $perlbin = TestLib::perl2host($^X);
-$perlbin =~ s!\\!/!g if $TestLib::windows_os;
+my $perlbin = PostgreSQL::Test::Utils::perl2host($^X);
+$perlbin =~ s!\\!/!g if $PostgreSQL::Test::Utils::windows_os;
 my $archivedir_primary = $node_primary->archive_dir;
-$archivedir_primary =~ s!\\!/!g if $TestLib::windows_os;
+$archivedir_primary =~ s!\\!/!g if $PostgreSQL::Test::Utils::windows_os;
 $node_primary->append_conf(
        'postgresql.conf', qq(
 archive_command = '"$perlbin" "$FindBin::RealBin/cp_history_files" "%p" "$archivedir_primary/%f"'
@@ -47,7 +47,7 @@ my $backup_name = 'my_backup';
 $node_primary->backup($backup_name);
 
 # Create streaming standby linking to primary
-my $node_standby = PostgresNode->new('standby');
+my $node_standby = PostgreSQL::Test::Cluster->new('standby');
 $node_standby->init_from_backup(
        $node_primary, $backup_name,
        allows_streaming => 1,
@@ -60,7 +60,7 @@ $node_standby->backup($backup_name, backup_options => ['-Xnone']);
 
 # Create cascading standby but don't start it yet.
 # Must set up both streaming and archiving.
-my $node_cascade = PostgresNode->new('cascade');
+my $node_cascade = PostgreSQL::Test::Cluster->new('cascade');
 $node_cascade->init_from_backup($node_standby, $backup_name,
        has_streaming => 1);
 $node_cascade->enable_restoring($node_primary);
index b7d3b6e03d4b72e36deda6c2a57dadb85f567b29..70705ab91de39a6167e38593b6753fbc2354a91f 100644 (file)
@@ -6,8 +6,8 @@ use strict;
 use warnings;
 
 use FindBin;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 
 plan tests => 3;
@@ -17,7 +17,7 @@ plan tests => 3;
 # that the replica replays the "overwrite contrecord" from that new
 # file.
 
-my $node = PostgresNode->new('primary');
+my $node = PostgreSQL::Test::Cluster->new('primary');
 $node->init(allows_streaming => 1);
 $node->append_conf('postgresql.conf', 'wal_keep_size=1GB');
 $node->start;
@@ -70,7 +70,7 @@ unlink $node->basedir . "/pgdata/pg_wal/$endfile"
 
 # OK, create a standby at this spot.
 $node->backup_fs_cold('backup');
-my $node_standby = PostgresNode->new('standby');
+my $node_standby = PostgreSQL::Test::Cluster->new('standby');
 $node_standby->init_from_backup($node, 'backup', has_streaming => 1);
 
 $node_standby->start;
index 0343e6e66d4ae4db626933dac804b7a5e349de6c..2c8a600bad1c4531266f406539c8c8e62c8324b3 100644 (file)
@@ -822,7 +822,7 @@ initialize_environment(void)
                 * won't mess things up.)  Also, set PGPORT to the temp port, and set
                 * PGHOST depending on whether we are using TCP or Unix sockets.
                 *
-                * This list should be kept in sync with TestLib.pm.
+                * This list should be kept in sync with PostgreSQL/Test/Utils.pm.
                 */
                unsetenv("PGCHANNELBINDING");
                /* PGCLIENTENCODING, see above */
index 80e318f32e827d43c868e1a01a69bc818726458e..2f30d1176341b1e31d34b58b1eb1bb4a4a1c69e6 100644 (file)
@@ -4,8 +4,8 @@
 use strict;
 use warnings;
 use Config qw ( %Config );
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 
 use File::Copy;
@@ -65,7 +65,7 @@ push @keys, 'client_wrongperms';
 #### Set up the server.
 
 note "setting up data directory";
-my $node = PostgresNode->new('primary');
+my $node = PostgreSQL::Test::Cluster->new('primary');
 $node->init;
 
 # PGHOST is enforced here to set up the node, subsequent connections
index 1dfa2b91f32ae1b71f22c9d9a686e4587feac251..983554263fb6a3138dc2387d2c651ec128381bcc 100644 (file)
@@ -5,8 +5,8 @@
 
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 
 use File::Copy;
@@ -38,7 +38,7 @@ my $common_connstr;
 # Set up the server.
 
 note "setting up data directory";
-my $node = PostgresNode->new('primary');
+my $node = PostgreSQL::Test::Cluster->new('primary');
 $node->init;
 
 # PGHOST is enforced here to set up the node, subsequent connections
index 804d008245231675db1518fcbfcc6a0abbc72e29..c5999e0b3331f3dd89e58318b15cbb5210ed1042 100644 (file)
@@ -30,8 +30,8 @@ package SSLServer;
 
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use File::Basename;
 use File::Copy;
 use Test::More;
index d89875a98bbef51a36839cd7f526dfc3a3986644..9531d81f19d8be941b749b216260d0bf07442bec 100644 (file)
@@ -4,17 +4,17 @@
 # Basic logical replication test
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 32;
 
 # Initialize publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 79fc046f2dff24cb281fa82fc257250ffb91d449..1606d478d9abd4a599f8fd4382cf4ea8076199e9 100644 (file)
@@ -5,17 +5,17 @@
 # by logical replication
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 4;
 
 # Initialize publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 3767d24f92b4096e5c323c1dc9d03f104046f321..752daabd968d00647c48b63b5e76cf951d3a2294 100644 (file)
@@ -4,17 +4,17 @@
 # This test checks that constraints work on subscriber
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 6;
 
 # Initialize publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index f07c306e5b798c791cbfe046d6b1e7517e17a9ed..aae9bb4141657c077fc28815fabb9cb8dd71a52d 100644 (file)
@@ -4,17 +4,17 @@
 # Tests for logical replication table syncing
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 8;
 
 # Initialize publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->append_conf('postgresql.conf',
        "wal_retrieve_retry_interval = 1ms");
index 9df474beb5aacf1f1657afafa8b3a5a47410ebbf..ea991f5a888fc909020916a4a08d8a109a558383 100644 (file)
@@ -4,17 +4,17 @@
 # Test replication between databases with different encodings
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 1;
 
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(
        allows_streaming => 'logical',
        extra            => [ '--locale=C', '--encoding=UTF8' ]);
 $node_publisher->start;
 
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(
        allows_streaming => 'logical',
        extra            => [ '--locale=C', '--encoding=LATIN1' ]);
index ec4d641230b7d4509054a0459b71f6cf1b45a60e..0e189469f71764246138c3a166c818069b250a6b 100644 (file)
@@ -4,15 +4,15 @@
 # Test logical replication behavior with heap rewrites
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 2;
 
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 1a3a1dcf14d27c44a936643553688a08b523b20a..8c869c5c15c8f424a151481a39d1180f0b04de6d 100644 (file)
@@ -4,15 +4,15 @@
 # Test some logical replication DDL behavior
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 1;
 
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 3af3d25604e831c0b148f3f107b992717ab835bf..50a83b521827637fa21f1b93ff5d653f826cf9dc 100644 (file)
@@ -4,17 +4,17 @@
 # Test behavior with different schema on subscriber
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 5;
 
 # Create publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 2e7d0d44138c8a02fcbfc64d7126490f1e222a4b..f93ce1ef3504c709095367d70904c6a58ba9326e 100644 (file)
@@ -4,15 +4,15 @@
 # Test materialized views behavior
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 1;
 
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 0e6ecf9c2fc18fe1b3a4aa45e985eaaf42b3b3d9..448032edf14c217b3eed9fab4962ceddf76c1976 100644 (file)
@@ -4,17 +4,17 @@
 # Test TRUNCATE
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 14;
 
 # setup
 
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->append_conf('postgresql.conf',
        qq(max_logical_replication_workers = 6));
index a8e7fbd9dabc3e01201d12ded00d10f8cdebb7be..781c87fddc28bd17ed95af8d68006e480515485e 100644 (file)
@@ -4,17 +4,17 @@
 # Test generated columns
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 2;
 
 # setup
 
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 09873911886a4649aba931fbca4818d5934d2199..06f19160e3f7472ef4700d9c09355ffdd4e27623 100644 (file)
@@ -5,8 +5,8 @@
 # (only works with ICU)
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More;
 
 if ($ENV{with_icu} eq 'yes')
@@ -18,13 +18,13 @@ else
        plan skip_all => 'ICU not supported by this build';
 }
 
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(
        allows_streaming => 'logical',
        extra            => [ '--locale=C', '--encoding=UTF8' ]);
 $node_publisher->start;
 
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(
        allows_streaming => 'logical',
        extra            => [ '--locale=C', '--encoding=UTF8' ]);
index c89d4952219e52f1a0dd9bcb33a094cd928ca651..c75a07d6b35e97b923e31eda6162ee4597b26ac4 100644 (file)
@@ -4,21 +4,21 @@
 # Test logical replication with partitioned tables
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 62;
 
 # setup
 
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
-my $node_subscriber1 = PostgresNode->new('subscriber1');
+my $node_subscriber1 = PostgreSQL::Test::Cluster->new('subscriber1');
 $node_subscriber1->init(allows_streaming => 'logical');
 $node_subscriber1->start;
 
-my $node_subscriber2 = PostgresNode->new('subscriber2');
+my $node_subscriber2 = PostgreSQL::Test::Cluster->new('subscriber2');
 $node_subscriber2->init(allows_streaming => 'logical');
 $node_subscriber2->start;
 
index 4e8aeb2e41335be25e1d123343a23ed5d2ce4d31..3dd69fb502d92e20b2a3f3f30ef7d2ef730f219b 100644 (file)
@@ -5,17 +5,17 @@
 
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 5;
 
 # Create and initialize a publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
 # Create and initialize subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index da6761f81eaabbc0fb2ec9765f3a03502556dd66..debb74cc65e3c5ab42151a8f14d675f8dba09e3d 100644 (file)
@@ -4,19 +4,19 @@
 # Test streaming of simple large transaction
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 4;
 
 # Create publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->append_conf('postgresql.conf',
        'logical_decoding_work_mem = 64kB');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 4aae98a66ec29f1245b7e56ce838e5210b8046e1..92c756dc2e93880ca6bf4e77d5f75c1cf1b6a5ec 100644 (file)
@@ -4,19 +4,19 @@
 # Test streaming of large transaction containing large subtransactions
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 2;
 
 # Create publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->append_conf('postgresql.conf',
        'logical_decoding_work_mem = 64kB');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 50bd6e31173c2f51cf612f8ff132057c9688b356..8d8310ecbe80b18efd940a7a15d41c229593b225 100644 (file)
@@ -4,19 +4,19 @@
 # Test streaming of large transaction with DDL and subtransactions
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 3;
 
 # Create publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->append_conf('postgresql.conf',
        'logical_decoding_work_mem = 64kB');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 63fe248a047f283a560b2b227ebd7cd3a9e5cafe..df21377a6ec240553f926ce737e1514567f94a95 100644 (file)
@@ -4,19 +4,19 @@
 # Test streaming of large transaction containing multiple subtransactions and rollbacks
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 4;
 
 # Create publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->append_conf('postgresql.conf',
        'logical_decoding_work_mem = 64kB');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 176a7024861529974440f1398608fcdffbbe8420..5e062f191c33152afaefb04824e06683f034bc7b 100644 (file)
@@ -5,19 +5,19 @@
 # rollbacks
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 2;
 
 # Create publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->append_conf('postgresql.conf',
        'logical_decoding_work_mem = 64kB');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index ecf9b192a3423375342e64d2a0121552594af576..408a3ad1d6b43c54eaed2a4353cfc0f7615edc8c 100644 (file)
@@ -4,18 +4,18 @@
 # Tests that logical decoding messages
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 5;
 
 # Create publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->append_conf('postgresql.conf', 'autovacuum = off');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index 19f096295f23df427a91723d7891b304c5fbb704..f8597cfdaa22b2e7a27e087ca4d774daea9a5586 100644 (file)
@@ -4,8 +4,8 @@
 # logical replication of 2PC test
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 24;
 
 ###############################
@@ -13,14 +13,14 @@ use Test::More tests => 24;
 ###############################
 
 # Initialize publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->append_conf('postgresql.conf',
        qq(max_prepared_transactions = 10));
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->append_conf('postgresql.conf',
        qq(max_prepared_transactions = 10));
index a38c5e78fe6ebd9a04cb2c7f5e56d99599c78f72..8b402d63c07d5b441a24ac61ca7a5f98824b760a 100644 (file)
@@ -7,8 +7,8 @@
 #
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 41;
 
 ###############################
@@ -18,7 +18,7 @@ use Test::More tests => 41;
 
 # Initialize nodes
 # node_A
-my $node_A = PostgresNode->new('node_A');
+my $node_A = PostgreSQL::Test::Cluster->new('node_A');
 $node_A->init(allows_streaming => 'logical');
 $node_A->append_conf('postgresql.conf', qq(
 max_prepared_transactions = 10
@@ -26,7 +26,7 @@ logical_decoding_work_mem = 64kB
 ));
 $node_A->start;
 # node_B
-my $node_B = PostgresNode->new('node_B');
+my $node_B = PostgreSQL::Test::Cluster->new('node_B');
 $node_B->init(allows_streaming => 'logical');
 $node_B->append_conf('postgresql.conf', qq(
 max_prepared_transactions = 10
@@ -34,7 +34,7 @@ logical_decoding_work_mem = 64kB
 ));
 $node_B->start;
 # node_C
-my $node_C = PostgresNode->new('node_C');
+my $node_C = PostgreSQL::Test::Cluster->new('node_C');
 $node_C->init(allows_streaming => 'logical');
 $node_C->append_conf('postgresql.conf', qq(
 max_prepared_transactions = 10
index c72c6b5ef41b688066b695c89be899ee8d4cff82..bc5a17581ce22f347198e83c7fb27d672fe44678 100644 (file)
@@ -4,8 +4,8 @@
 # Test logical replication of 2PC with streaming.
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 18;
 
 ###############################
@@ -13,7 +13,7 @@ use Test::More tests => 18;
 ###############################
 
 # Initialize publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->append_conf('postgresql.conf', qq(
 max_prepared_transactions = 10
@@ -22,7 +22,7 @@ logical_decoding_work_mem = 64kB
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->append_conf('postgresql.conf', qq(
 max_prepared_transactions = 10
index 24493a9c4e39f089966868e061c42e5a748375cc..9384b3a9c46bde88517f435556f4e804011ecd8a 100644 (file)
@@ -4,17 +4,17 @@
 # This test checks behaviour of ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 3;
 
 # Initialize publisher node
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
 # Create subscriber node
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
index baa4a90771385c6092b694d4b7fdbc1688873987..34a60fd9ab9c61760f836e59518707f8d8194b92 100644 (file)
@@ -4,8 +4,8 @@
 # Tests for various bugs found over time
 use strict;
 use warnings;
-use PostgresNode;
-use TestLib;
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
 use Test::More tests => 5;
 
 # Bug #15114
@@ -19,11 +19,11 @@ use Test::More tests => 5;
 # fix was to avoid the constant expressions simplification in
 # RelationGetIndexAttrBitmap(), so it's safe to call in more contexts.
 
-my $node_publisher = PostgresNode->new('publisher');
+my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
-my $node_subscriber = PostgresNode->new('subscriber');
+my $node_subscriber = PostgreSQL::Test::Cluster->new('subscriber');
 $node_subscriber->init(allows_streaming => 'logical');
 $node_subscriber->start;
 
@@ -81,7 +81,7 @@ $node_subscriber->stop('fast');
 # identity set before accepting updates.  If it did not it would cause
 # an error when an update was attempted.
 
-$node_publisher = PostgresNode->new('publisher2');
+$node_publisher = PostgreSQL::Test::Cluster->new('publisher2');
 $node_publisher->init(allows_streaming => 'logical');
 $node_publisher->start;
 
@@ -108,7 +108,7 @@ $node_publisher->stop('fast');
 #
 # Initial sync doesn't complete; the protocol was not being followed per
 # expectations after commit 07082b08cc5d.
-my $node_twoways = PostgresNode->new('twoways');
+my $node_twoways = PostgreSQL::Test::Cluster->new('twoways');
 $node_twoways->init(allows_streaming => 'logical');
 $node_twoways->start;
 for my $db (qw(d1 d2))
@@ -158,15 +158,15 @@ is($node_twoways->safe_psql('d2', "SELECT count(f) FROM t2"),
 
 # Verify table data is synced with cascaded replication setup. This is mainly
 # to test whether the data written by tablesync worker gets replicated.
-my $node_pub = PostgresNode->new('testpublisher1');
+my $node_pub = PostgreSQL::Test::Cluster->new('testpublisher1');
 $node_pub->init(allows_streaming => 'logical');
 $node_pub->start;
 
-my $node_pub_sub = PostgresNode->new('testpublisher_subscriber');
+my $node_pub_sub = PostgreSQL::Test::Cluster->new('testpublisher_subscriber');
 $node_pub_sub->init(allows_streaming => 'logical');
 $node_pub_sub->start;
 
-my $node_sub = PostgresNode->new('testsubscriber1');
+my $node_sub = PostgreSQL::Test::Cluster->new('testsubscriber1');
 $node_sub->init(allows_streaming => 'logical');
 $node_sub->start;