diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2021-10-24 10:28:19 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2021-10-24 10:28:19 -0400 |
commit | b3b4d8e68ae83f432f43f035c7eb481ef93e1583 (patch) | |
tree | ff4e73500b61f2235bd4e3822d8e1a1af3a37523 /src/bin/pg_rewind/t/RewindTest.pm | |
parent | 3cd9c3b921977272e6650a5efbeade4203c4bca2 (diff) |
Move Perl test modules to a better namespace
The five modules in our TAP test framework all had names in the top
level namespace. This is unwise because, even though we're not
exporting them to CPAN, the names can leak, for example if they are
exported by the RPM build process. We therefore move the modules to the
PostgreSQL::Test namespace. In the process PostgresNode is renamed to
Cluster, and TestLib is renamed to Utils. PostgresVersion becomes simply
PostgreSQL::Version, to avoid possible confusion about what it's the
version of.
Discussion: https://postgr.es/m/aede93a4-7d92-ef26-398f-5094944c2504@dunslane.net
Reviewed by Erik Rijkers and Michael Paquier
Diffstat (limited to 'src/bin/pg_rewind/t/RewindTest.pm')
-rw-r--r-- | src/bin/pg_rewind/t/RewindTest.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bin/pg_rewind/t/RewindTest.pm b/src/bin/pg_rewind/t/RewindTest.pm index 367b99a438f..5546ce456cd 100644 --- a/src/bin/pg_rewind/t/RewindTest.pm +++ b/src/bin/pg_rewind/t/RewindTest.pm @@ -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 |