mirror of
https://github.com/postgres/postgres.git
synced 2025-09-09 13:09:39 +03:00
Also, use "verify" rather than "validate" to refer to the process being undertaken here. Per discussion, that is a more appropriate term. Discussion: https://www.postgresql.org/message-id/172c9d9b-1d0a-1b94-1456-376b1e017322@2ndquadrant.com Discussion: http://postgr.es/m/CA+TgmobLgMh6p8FmLbj_rv9Uhd7tPrLnAyLgGd2SoSj=qD-bVg@mail.gmail.com
28 lines
855 B
Perl
28 lines
855 B
Perl
# Verify that pg_verifybackup handles hex-encoded filenames correctly.
|
|
|
|
use strict;
|
|
use warnings;
|
|
use Cwd;
|
|
use Config;
|
|
use PostgresNode;
|
|
use TestLib;
|
|
use Test::More tests => 5;
|
|
|
|
my $master = get_new_node('master');
|
|
$master->init(allows_streaming => 1);
|
|
$master->start;
|
|
my $backup_path = $master->backup_dir . '/test_encoding';
|
|
$master->command_ok(['pg_basebackup', '-D', $backup_path, '--no-sync',
|
|
'--manifest-force-encode' ],
|
|
"backup ok with forced hex encoding");
|
|
|
|
my $manifest = slurp_file("$backup_path/backup_manifest");
|
|
my $count_of_encoded_path_in_manifest =
|
|
(() = $manifest =~ /Encoded-Path/mig);
|
|
cmp_ok($count_of_encoded_path_in_manifest, '>', 100,
|
|
"many paths are encoded in the manifest");
|
|
|
|
command_like(['pg_verifybackup', '-s', $backup_path ],
|
|
qr/backup successfully verified/,
|
|
'backup with forced encoding verified');
|