From 4bc968d3508e9f608fd572f40f39e2cb374d53f4 Mon Sep 17 00:00:00 2001 From: Amul Sul Date: Wed, 19 Jan 2022 23:22:02 -0500 Subject: [PATCH v4 1/3] Allow TAP tests to choose custom WAL archive and restore path. --- src/test/perl/PostgreSQL/Test/Cluster.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index b7d4c24553..6a562db2ce 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -1033,10 +1033,13 @@ primary_conninfo='$root_connstr' # Internal routine to enable archive recovery command on a standby node sub enable_restoring { - my ($self, $root_node, $standby) = @_; - my $path = PostgreSQL::Test::Utils::perl2host($root_node->archive_dir); + my ($self, $root_node, $standby, $path) = @_; my $name = $self->name; + # Default archive directory will be used if not specified. + $path = $root_node->archive_dir if (!defined($path)); + $path = PostgreSQL::Test::Utils::perl2host($path); + print "### Enabling WAL restore for node \"$name\"\n"; # On Windows, the path specified in the restore command needs to use @@ -1101,10 +1104,13 @@ sub set_standby_mode # Internal routine to enable archiving sub enable_archiving { - my ($self) = @_; - my $path = PostgreSQL::Test::Utils::perl2host($self->archive_dir); + my ($self, $path) = @_; my $name = $self->name; + # Default archive directory will be used if not specified. + $path = $self->archive_dir if (!defined($path)); + $path = PostgreSQL::Test::Utils::perl2host($path); + print "### Enabling WAL archiving for node \"$name\"\n"; # On Windows, the path specified in the restore command needs to use -- 2.18.0