1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

copy() works with remote in either direction.

This commit is contained in:
David Steele
2014-06-14 20:47:32 -04:00
parent 79f85fe6c4
commit d568b6525b
4 changed files with 139 additions and 114 deletions

View File

@ -790,10 +790,10 @@ sub BackRestFileTest
{
$iRun = 0;
for (my $bBackupRemote = 0; $bBackupRemote <= 0; $bBackupRemote++)
for (my $bBackupRemote = 0; $bBackupRemote <= 1; $bBackupRemote++)
{
# Loop through source compression
for (my $bDbRemote = 1; $bDbRemote <= 1; $bDbRemote++)
for (my $bDbRemote = 0; $bDbRemote <= 1; $bDbRemote++)
{
# Backup and db cannot both be remote
if ($bBackupRemote && $bDbRemote)
@ -851,6 +851,8 @@ sub BackRestFileTest
{
system("echo 'TESTDATA' > ${strSourceFile}");
}
my $strSourceHash = $oFile->hash(PATH_ABSOLUTE, $strSourceFile);
# Run file copy in an eval block because some errors are expected
my $bReturn;
@ -937,6 +939,13 @@ sub BackRestFileTest
{
confess "could not find destination file ${strDestinationFile}";
}
my $strDestinationHash = $oFile->hash(PATH_ABSOLUTE, $strDestinationFile);
if ($strSourceHash ne $strDestinationHash)
{
confess "source ${strSourceHash} and destination ${strDestinationHash} file hashes do not match";
}
}
}
}