aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_verifybackup/t
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_verifybackup/t')
-rw-r--r--src/bin/pg_verifybackup/t/002_algorithm.pl6
-rw-r--r--src/bin/pg_verifybackup/t/003_corruption.pl23
-rw-r--r--src/bin/pg_verifybackup/t/004_options.pl3
-rw-r--r--src/bin/pg_verifybackup/t/008_untar.pl12
-rw-r--r--src/bin/pg_verifybackup/t/010_client_untar.pl2
5 files changed, 27 insertions, 19 deletions
diff --git a/src/bin/pg_verifybackup/t/002_algorithm.pl b/src/bin/pg_verifybackup/t/002_algorithm.pl
index 36edad8cd02..71aaa8d881f 100644
--- a/src/bin/pg_verifybackup/t/002_algorithm.pl
+++ b/src/bin/pg_verifybackup/t/002_algorithm.pl
@@ -42,7 +42,8 @@ sub test_checksums
}
# A backup with a valid algorithm should work.
- $primary->command_ok(\@backup, "$format format backup ok with algorithm \"$algorithm\"");
+ $primary->command_ok(\@backup,
+ "$format format backup ok with algorithm \"$algorithm\"");
# We expect each real checksum algorithm to be mentioned on every line of
# the backup manifest file except the first and last; for simplicity, we
@@ -50,7 +51,8 @@ sub test_checksums
# is none, we just check that the manifest exists.
if ($algorithm eq 'none')
{
- ok(-f "$backup_path/backup_manifest", "$format format backup manifest exists");
+ ok( -f "$backup_path/backup_manifest",
+ "$format format backup manifest exists");
}
else
{
diff --git a/src/bin/pg_verifybackup/t/003_corruption.pl b/src/bin/pg_verifybackup/t/003_corruption.pl
index 1111b09637d..a2aa767cff6 100644
--- a/src/bin/pg_verifybackup/t/003_corruption.pl
+++ b/src/bin/pg_verifybackup/t/003_corruption.pl
@@ -60,12 +60,14 @@ my @scenario = (
{
'name' => 'append_to_file',
'mutilate' => \&mutilate_append_to_file,
- 'fails_like' => qr/has size \d+ (on disk|in "[^"]+") but size \d+ in the manifest/
+ 'fails_like' =>
+ qr/has size \d+ (on disk|in "[^"]+") but size \d+ in the manifest/
},
{
'name' => 'truncate_file',
'mutilate' => \&mutilate_truncate_file,
- 'fails_like' => qr/has size 0 (on disk|in "[^"]+") but size \d+ in the manifest/
+ 'fails_like' =>
+ qr/has size 0 (on disk|in "[^"]+") but size \d+ in the manifest/
},
{
'name' => 'replace_file',
@@ -147,8 +149,9 @@ for my $scenario (@scenario)
# same problem, unless the scenario needs UNIX permissions or we don't
# have a TAR program available. Note that this destructively modifies
# the backup directory.
- if (! $scenario->{'needs_unix_permissions'} ||
- !defined $tar || $tar eq '')
+ if ( !$scenario->{'needs_unix_permissions'}
+ || !defined $tar
+ || $tar eq '')
{
my $tar_backup_path = $primary->backup_dir . '/tar_' . $name;
mkdir($tar_backup_path) || die "mkdir $tar_backup_path: $!";
@@ -156,14 +159,15 @@ for my $scenario (@scenario)
# tar and then remove each tablespace. We remove the original files
# so that they don't also end up in base.tar.
my @tsoid = grep { $_ ne '.' && $_ ne '..' }
- slurp_dir("$backup_path/pg_tblspc");
+ slurp_dir("$backup_path/pg_tblspc");
my $cwd = getcwd;
for my $tsoid (@tsoid)
{
my $tspath = $backup_path . '/pg_tblspc/' . $tsoid;
chdir($tspath) || die "chdir: $!";
- command_ok([ $tar, '-cf', "$tar_backup_path/$tsoid.tar", '.' ]);
+ command_ok(
+ [ $tar, '-cf', "$tar_backup_path/$tsoid.tar", '.' ]);
chdir($cwd) || die "chdir: $!";
rmtree($tspath);
}
@@ -175,9 +179,10 @@ for my $scenario (@scenario)
rmtree($backup_path . '/pg_wal');
# move the backup manifest
- move($backup_path . '/backup_manifest',
- $tar_backup_path . '/backup_manifest')
- or die "could not copy manifest to $tar_backup_path";
+ move(
+ $backup_path . '/backup_manifest',
+ $tar_backup_path . '/backup_manifest'
+ ) or die "could not copy manifest to $tar_backup_path";
# Construct base.tar with what's left.
chdir($backup_path) || die "chdir: $!";
diff --git a/src/bin/pg_verifybackup/t/004_options.pl b/src/bin/pg_verifybackup/t/004_options.pl
index 908a7992b80..e6d94b9ad51 100644
--- a/src/bin/pg_verifybackup/t/004_options.pl
+++ b/src/bin/pg_verifybackup/t/004_options.pl
@@ -29,8 +29,7 @@ is($stdout, '', "-q succeeds: no stdout");
is($stderr, '', "-q succeeds: no stderr");
# Should still work if we specify -Fp.
-$primary->command_ok(
- [ 'pg_verifybackup', '-Fp', $backup_path ],
+$primary->command_ok([ 'pg_verifybackup', '-Fp', $backup_path ],
"verifies with -Fp");
# Should not work if we specify -Fy because that's invalid.
diff --git a/src/bin/pg_verifybackup/t/008_untar.pl b/src/bin/pg_verifybackup/t/008_untar.pl
index 480c07f3828..590c497503c 100644
--- a/src/bin/pg_verifybackup/t/008_untar.pl
+++ b/src/bin/pg_verifybackup/t/008_untar.pl
@@ -20,12 +20,14 @@ $primary->start;
my $source_ts_path = PostgreSQL::Test::Utils::tempdir_short();
# Create a tablespace with table in it.
-$primary->safe_psql('postgres', qq(
+$primary->safe_psql(
+ 'postgres', qq(
CREATE TABLESPACE regress_ts1 LOCATION '$source_ts_path';
SELECT oid FROM pg_tablespace WHERE spcname = 'regress_ts1';
CREATE TABLE regress_tbl1(i int) TABLESPACE regress_ts1;
INSERT INTO regress_tbl1 VALUES(generate_series(1,5));));
-my $tsoid = $primary->safe_psql('postgres', qq(
+my $tsoid = $primary->safe_psql(
+ 'postgres', qq(
SELECT oid FROM pg_tablespace WHERE spcname = 'regress_ts1'));
my $backup_path = $primary->backup_dir . '/server-backup';
@@ -35,7 +37,7 @@ my @test_configuration = (
{
'compression_method' => 'none',
'backup_flags' => [],
- 'backup_archive' => ['base.tar', "$tsoid.tar"],
+ 'backup_archive' => [ 'base.tar', "$tsoid.tar" ],
'enabled' => 1
},
{
@@ -47,7 +49,7 @@ my @test_configuration = (
{
'compression_method' => 'lz4',
'backup_flags' => [ '--compress', 'server-lz4' ],
- 'backup_archive' => ['base.tar.lz4', "$tsoid.tar.lz4" ],
+ 'backup_archive' => [ 'base.tar.lz4', "$tsoid.tar.lz4" ],
'enabled' => check_pg_config("#define USE_LZ4 1")
},
{
@@ -95,7 +97,7 @@ for my $tc (@test_configuration)
"found expected backup files, compression $method");
# Verify tar backup.
- $primary->command_ok(['pg_verifybackup', '-n', '-e', $backup_path],
+ $primary->command_ok([ 'pg_verifybackup', '-n', '-e', $backup_path ],
"verify backup, compression $method");
# Cleanup.
diff --git a/src/bin/pg_verifybackup/t/010_client_untar.pl b/src/bin/pg_verifybackup/t/010_client_untar.pl
index 46a598943a7..723f5f16c10 100644
--- a/src/bin/pg_verifybackup/t/010_client_untar.pl
+++ b/src/bin/pg_verifybackup/t/010_client_untar.pl
@@ -108,7 +108,7 @@ for my $tc (@test_configuration)
"found expected backup files, compression $method");
# Verify tar backup.
- $primary->command_ok( [ 'pg_verifybackup', '-n', '-e', $backup_path ],
+ $primary->command_ok([ 'pg_verifybackup', '-n', '-e', $backup_path ],
"verify backup, compression $method");
# Cleanup.