Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
90102bb5
Commit
90102bb5
authored
Jun 30, 2015
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pg_basebackup: Add tests for -X option
Reviewed-by:
Michael Paquier
<
michael.paquier@gmail.com
>
parent
36dc30aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
src/bin/pg_basebackup/t/010_pg_basebackup.pl
src/bin/pg_basebackup/t/010_pg_basebackup.pl
+12
-1
src/test/perl/TestLib.pm
src/test/perl/TestLib.pm
+10
-0
No files found.
src/bin/pg_basebackup/t/010_pg_basebackup.pl
View file @
90102bb5
...
...
@@ -2,7 +2,7 @@ use strict;
use
warnings
;
use
Cwd
;
use
TestLib
;
use
Test::
More
tests
=>
39
;
use
Test::
More
tests
=>
44
;
program_help_ok
('
pg_basebackup
');
program_version_ok
('
pg_basebackup
');
...
...
@@ -46,6 +46,10 @@ command_ok([ 'pg_basebackup', '-D', "$tempdir/backup" ],
'
pg_basebackup runs
');
ok
(
-
f
"
$tempdir
/backup/PG_VERSION
",
'
backup was created
');
is_deeply
([
sort
(
slurp_dir
("
$tempdir
/backup/pg_xlog/
"))],
[
sort
qw(. .. archive_status)
],
'
no WAL files copied
');
command_ok
(
[
'
pg_basebackup
',
'
-D
',
"
$tempdir
/backup2
",
'
--xlogdir
',
"
$tempdir
/xlog2
"
],
...
...
@@ -145,3 +149,10 @@ ok(-f "$tempdir/backupR/recovery.conf", 'recovery.conf was created');
my
$recovery_conf
=
slurp_file
"
$tempdir
/backupR/recovery.conf
";
like
(
$recovery_conf
,
qr/^standby_mode = 'on'$/
m, 'recovery.conf sets standby_mode');
like($recovery_conf,
qr/^primary_conninfo = '.*port=$ENV{PGPORT}.*'$/
m, 'recovery.conf sets primary_conninfo');
command_ok([ 'pg_basebackup',
'
-D
',
"
$tempdir
/backupxf
",
'
-X
',
'
fetch
'
],
'
pg_basebackup -X fetch runs
');
ok
(
grep
(
/^[0-9A-F]{24}$/
,
slurp_dir
("
$tempdir
/backupxf/pg_xlog
")),
'
WAL files copied
');
command_ok
([
'
pg_basebackup
',
'
-D
',
"
$tempdir
/backupxs
",
'
-X
',
'
stream
'
],
'
pg_basebackup -X stream runs
');
ok
(
grep
(
/^[0-9A-F]{24}$/
,
slurp_dir
("
$tempdir
/backupxf/pg_xlog
")),
'
WAL files copied
');
src/test/perl/TestLib.pm
View file @
90102bb5
...
...
@@ -11,6 +11,7 @@ our @EXPORT = qw(
start_test_server
restart_test_server
psql
slurp_dir
slurp_file
system_or_bail
system_log
...
...
@@ -176,6 +177,15 @@ sub psql
run
[
'
psql
',
'
-X
',
'
-q
',
'
-d
',
$dbname
,
'
-f
',
'
-
'
],
'
<
',
\
$sql
or
die
;
}
sub
slurp_dir
{
my
(
$dir
)
=
@_
;
opendir
(
my
$dh
,
$dir
)
or
die
;
my
@direntries
=
readdir
$dh
;
closedir
$dh
;
return
@direntries
;
}
sub
slurp_file
{
local
$/
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment