Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit36dc30a

Browse files
committed
pg_basebackup: Add tests for -R option
Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
1 parent5d0e8bc commit36dc30a

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::Moretests=>35;
5+
use Test::Moretests=>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','-' ],'<', \$sqlordie;
176177
}
177178

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp