Content-Length: 334428 | pFad | http://github.com/postgrespro/postgres_cluster/commit/36dc30aa7e0ab9628a5a975a921b8ff82e8f31bf

D2 pg_basebackup: Add tests for -R option · postgrespro/postgres_cluster@36dc30a · GitHub
Skip to content

Commit 36dc30a

Browse files
committed
pg_basebackup: Add tests for -R option
Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
1 parent 5d0e8bc commit 36dc30a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/bin/pg_basebackup/t/010_pg_basebackup.pl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use warnings;
33
use Cwd;
44
use TestLib;
5-
use Test::More tests => 35;
5+
use Test::More tests => 39;
66

77
program_help_ok('pg_basebackup');
88
program_version_ok('pg_basebackup');
@@ -138,3 +138,10 @@
138138
command_ok([ 'pg_basebackup', '-D', "$tempdir/tarbackup_l3", '-Ft' ],
139139
'pg_basebackup tar with long symlink target');
140140
psql 'postgres', "DROP TABLESPACE tblspc3;";
141+
142+
command_ok([ 'pg_basebackup', '-D', "$tempdir/backupR", '-R' ],
143+
'pg_basebackup -R runs');
144+
ok(-f "$tempdir/backupR/recovery.conf", 'recovery.conf was created');
145+
my $recovery_conf = slurp_file "$tempdir/backupR/recovery.conf";
146+
like($recovery_conf, qr/^standby_mode = 'on'$/m, 'recovery.conf sets standby_mode');
147+
like($recovery_conf, qr/^primary_conninfo = '.*port=$ENV{PGPORT}.*'$/m, 'recovery.conf sets primary_conninfo');

src/test/perl/TestLib.pm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ our @EXPORT = qw(
1111
start_test_server
1212
restart_test_server
1313
psql
14+
slurp_file
1415
system_or_bail
1516
system_log
1617
run_log
@@ -175,6 +176,13 @@ sub psql
175176
run [ 'psql', '-X', '-q', '-d', $dbname, '-f', '-' ], '<', \$sql or die;
176177
}
177178

179+
sub slurp_file
180+
{
181+
local $/;
182+
local @ARGV = @_;
183+
<>
184+
}
185+
178186
sub system_or_bail
179187
{
180188
if (system_log(@_) != 0)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/36dc30aa7e0ab9628a5a975a921b8ff82e8f31bf

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy