2014-05-14 22:07:37 +03:00
|
|
|
#!/usr/bin/perl
|
|
|
|
####################################################################################################################################
|
2014-06-04 04:22:07 +03:00
|
|
|
# FileTest.pl - Unit Tests for BackRest::File
|
2014-05-14 22:07:37 +03:00
|
|
|
####################################################################################################################################
|
2014-06-22 17:30:17 +03:00
|
|
|
package BackRestTest::FileTest;
|
2014-05-14 22:07:37 +03:00
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# Perl includes
|
|
|
|
####################################################################################################################################
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Carp;
|
2014-06-07 20:15:55 +03:00
|
|
|
|
2014-05-14 22:07:37 +03:00
|
|
|
use File::Basename;
|
2014-06-02 23:26:37 +03:00
|
|
|
use Cwd 'abs_path';
|
2014-06-04 04:22:07 +03:00
|
|
|
use File::stat;
|
|
|
|
use Fcntl ':mode';
|
2014-06-07 20:15:55 +03:00
|
|
|
use Scalar::Util 'blessed';
|
2014-05-14 22:07:37 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
use lib dirname($0) . '/../lib';
|
2014-06-07 23:13:41 +03:00
|
|
|
use BackRest::Utility;
|
2014-06-07 23:25:20 +03:00
|
|
|
use BackRest::File;
|
|
|
|
use BackRest::Remote;
|
2014-05-14 22:07:37 +03:00
|
|
|
|
2014-06-22 17:54:31 +03:00
|
|
|
use BackRestTest::CommonTest;
|
|
|
|
|
2014-05-14 22:07:37 +03:00
|
|
|
use Exporter qw(import);
|
2014-06-22 17:54:31 +03:00
|
|
|
our @EXPORT = qw(BackRestTestFile_Test);
|
2014-05-14 22:07:37 +03:00
|
|
|
|
2014-06-22 17:54:31 +03:00
|
|
|
my $strTestPath;
|
|
|
|
my $strHost;
|
|
|
|
my $strUserBackRest;
|
2014-06-21 21:19:03 +03:00
|
|
|
|
|
|
|
####################################################################################################################################
|
2014-06-22 17:54:31 +03:00
|
|
|
# BackRestTestFile_Setup
|
2014-06-21 21:19:03 +03:00
|
|
|
####################################################################################################################################
|
2014-06-22 17:54:31 +03:00
|
|
|
sub BackRestTestFile_Setup
|
2014-06-21 21:19:03 +03:00
|
|
|
{
|
2014-06-22 01:19:37 +03:00
|
|
|
my $bPrivate = shift;
|
2014-06-21 21:19:03 +03:00
|
|
|
my $bDropOnly = shift;
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
# Remove the backrest private directory
|
2014-06-22 01:19:37 +03:00
|
|
|
if (-e "${strTestPath}/private")
|
|
|
|
{
|
|
|
|
system("ssh ${strUserBackRest}\@${strHost} 'rm -rf ${strTestPath}/private'");
|
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
# Remove the test directory
|
|
|
|
system("rm -rf ${strTestPath}") == 0 or die 'unable to drop test path';
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-22 02:16:55 +03:00
|
|
|
if (!defined($bDropOnly) || !$bDropOnly)
|
2014-06-21 21:19:03 +03:00
|
|
|
{
|
|
|
|
# Create the test directory
|
2014-09-18 18:50:27 +03:00
|
|
|
mkdir($strTestPath, oct('0770')) or confess 'Unable to create test directory';
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
# Create the backrest private directory
|
2014-06-22 01:19:37 +03:00
|
|
|
if (defined($bPrivate) && $bPrivate)
|
|
|
|
{
|
|
|
|
system("ssh backrest\@${strHost} 'mkdir -m 700 ${strTestPath}/private'") == 0 or die 'unable to create test/private path';
|
|
|
|
}
|
2014-06-21 21:19:03 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
2014-06-22 17:54:31 +03:00
|
|
|
# BackRestTestFile_Test
|
2014-06-21 21:19:03 +03:00
|
|
|
####################################################################################################################################
|
2014-06-22 17:54:31 +03:00
|
|
|
sub BackRestTestFile_Test
|
2014-05-14 22:07:37 +03:00
|
|
|
{
|
2014-06-05 17:20:03 +03:00
|
|
|
my $strTest = shift;
|
2014-06-06 05:42:47 +03:00
|
|
|
|
2014-06-05 17:20:03 +03:00
|
|
|
# If no test was specified, then run them all
|
|
|
|
if (!defined($strTest))
|
|
|
|
{
|
|
|
|
$strTest = 'all';
|
|
|
|
}
|
|
|
|
|
2014-06-22 17:30:17 +03:00
|
|
|
# Setup test variables
|
2014-06-02 00:23:33 +03:00
|
|
|
my $iRun;
|
2014-06-22 17:54:31 +03:00
|
|
|
$strTestPath = BackRestTestCommon_TestPathGet();
|
|
|
|
my $strStanza = BackRestTestCommon_StanzaGet();
|
|
|
|
my $strUser = BackRestTestCommon_UserGet();
|
|
|
|
my $strGroup = BackRestTestCommon_GroupGet();
|
|
|
|
$strHost = BackRestTestCommon_HostGet();
|
|
|
|
$strUserBackRest = BackRestTestCommon_UserBackRestGet();
|
2014-06-02 00:23:33 +03:00
|
|
|
|
2014-06-22 18:56:01 +03:00
|
|
|
# Print test banner
|
2014-09-18 18:50:27 +03:00
|
|
|
&log(INFO, 'FILE MODULE ********************************************************************');
|
2014-06-04 04:22:07 +03:00
|
|
|
|
2014-06-07 04:16:24 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Create remote
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-07 23:25:20 +03:00
|
|
|
my $oRemote = BackRest::Remote->new
|
2014-06-07 04:16:24 +03:00
|
|
|
(
|
2014-06-22 17:54:31 +03:00
|
|
|
strHost => $strHost,
|
2014-06-07 04:16:24 +03:00
|
|
|
strUser => $strUser,
|
2014-07-13 16:13:19 +03:00
|
|
|
strCommand => BackRestTestCommon_CommandRemoteGet()
|
2014-06-07 04:16:24 +03:00
|
|
|
);
|
|
|
|
|
2014-06-04 04:22:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Test path_create()
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-05 17:20:03 +03:00
|
|
|
if ($strTest eq 'all' || $strTest eq 'path_create')
|
|
|
|
{
|
|
|
|
$iRun = 0;
|
2014-06-04 04:22:07 +03:00
|
|
|
|
2014-06-05 17:20:03 +03:00
|
|
|
&log(INFO, "Test File->path_create()\n");
|
2014-06-04 04:22:07 +03:00
|
|
|
|
2014-06-05 17:20:03 +03:00
|
|
|
# Loop through local/remote
|
|
|
|
for (my $bRemote = 0; $bRemote <= 1; $bRemote++)
|
2014-06-04 04:22:07 +03:00
|
|
|
{
|
2014-06-21 22:46:26 +03:00
|
|
|
# Create the file object
|
2014-06-22 03:08:49 +03:00
|
|
|
my $oFile = (BackRest::File->new
|
2014-06-05 17:20:03 +03:00
|
|
|
(
|
2014-06-22 17:30:17 +03:00
|
|
|
strStanza => $strStanza,
|
|
|
|
strBackupPath => $strTestPath,
|
2014-06-21 22:46:26 +03:00
|
|
|
strRemote => $bRemote ? 'backup' : undef,
|
|
|
|
oRemote => $bRemote ? $oRemote : undef
|
2014-06-22 03:08:49 +03:00
|
|
|
))->clone();
|
2014-06-05 17:20:03 +03:00
|
|
|
|
2014-06-24 01:54:00 +03:00
|
|
|
# Loop through error
|
2014-06-21 22:17:09 +03:00
|
|
|
for (my $bError = 0; $bError <= 1; $bError++)
|
|
|
|
{
|
|
|
|
# Loop through permission (permission will be set on true)
|
2014-06-24 01:54:00 +03:00
|
|
|
for (my $bPermission = 0; $bPermission <= 1; $bPermission++)
|
2014-06-21 22:17:09 +03:00
|
|
|
{
|
2014-06-22 03:08:49 +03:00
|
|
|
my $strPathType = PATH_BACKUP_CLUSTER;
|
|
|
|
|
2014-07-16 05:32:41 +03:00
|
|
|
# Increment the run, log, and decide whether this unit test should be run
|
|
|
|
if (!BackRestTestCommon_Run(++$iRun,
|
|
|
|
"rmt ${bRemote}, err ${bError}, prm ${bPermission}")) {next}
|
2014-06-04 04:22:07 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
# Setup test directory
|
2014-06-22 17:54:31 +03:00
|
|
|
BackRestTestFile_Setup($bError);
|
2014-06-04 04:22:07 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
mkdir("${strTestPath}/backup") or confess 'Unable to create test/backup directory';
|
|
|
|
mkdir("${strTestPath}/backup/db") or confess 'Unable to create test/backup/db directory';
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
my $strPath = 'path';
|
2014-06-21 22:17:09 +03:00
|
|
|
my $strPermission;
|
2014-06-04 04:22:07 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
# If permission then set one (other than the default)
|
|
|
|
if ($bPermission)
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
$strPermission = '0700';
|
2014-06-21 22:17:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# If not exists then set the path to something bogus
|
|
|
|
if ($bError)
|
|
|
|
{
|
|
|
|
$strPath = "${strTestPath}/private/path";
|
2014-06-22 03:08:49 +03:00
|
|
|
$strPathType = PATH_BACKUP_ABSOLUTE;
|
2014-06-21 22:17:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# Execute in eval to catch errors
|
2014-06-24 01:54:00 +03:00
|
|
|
my $bErrorExpected = $bError;
|
2014-06-21 22:17:09 +03:00
|
|
|
|
|
|
|
eval
|
|
|
|
{
|
2014-06-22 03:08:49 +03:00
|
|
|
$oFile->path_create($strPathType, $strPath, $strPermission);
|
2014-06-21 22:17:09 +03:00
|
|
|
};
|
2014-06-04 04:22:07 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
# Check for errors
|
|
|
|
if ($@)
|
|
|
|
{
|
|
|
|
# Ignore errors if the path did not exist
|
|
|
|
if ($bErrorExpected)
|
2014-06-04 04:22:07 +03:00
|
|
|
{
|
2014-06-21 22:17:09 +03:00
|
|
|
next;
|
2014-06-04 04:22:07 +03:00
|
|
|
}
|
2014-06-04 18:58:30 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
confess "error raised: " . $@ . "\n";
|
|
|
|
}
|
2014-06-04 18:58:30 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
if ($bErrorExpected)
|
|
|
|
{
|
|
|
|
confess 'error was expected';
|
|
|
|
}
|
2014-06-05 17:20:03 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
# Make sure the path was actually created
|
2014-06-22 03:08:49 +03:00
|
|
|
my $strPathCheck = $oFile->path_get($strPathType, $strPath);
|
|
|
|
|
|
|
|
unless (-e $strPathCheck)
|
2014-06-21 22:17:09 +03:00
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'path was not created';
|
2014-06-21 22:17:09 +03:00
|
|
|
}
|
2014-06-04 18:58:30 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
# Check that the permissions were set correctly
|
2014-06-22 03:08:49 +03:00
|
|
|
my $oStat = lstat($strPathCheck);
|
2014-06-04 18:58:30 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
if (!defined($oStat))
|
|
|
|
{
|
2014-06-22 03:08:49 +03:00
|
|
|
confess "unable to stat ${strPathCheck}";
|
2014-06-21 22:17:09 +03:00
|
|
|
}
|
2014-06-05 17:20:03 +03:00
|
|
|
|
2014-06-21 22:46:26 +03:00
|
|
|
if ($bPermission)
|
2014-06-21 22:17:09 +03:00
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
if ($strPermission ne sprintf('%04o', S_IMODE($oStat->mode)))
|
2014-06-21 22:46:26 +03:00
|
|
|
{
|
|
|
|
confess "permissions were not set to {$strPermission}";
|
|
|
|
}
|
2014-06-04 04:22:07 +03:00
|
|
|
}
|
|
|
|
}
|
2014-06-21 22:17:09 +03:00
|
|
|
}
|
2014-06-04 04:22:07 +03:00
|
|
|
}
|
|
|
|
}
|
2014-06-02 00:23:33 +03:00
|
|
|
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-04 02:03:03 +03:00
|
|
|
# Test move()
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-05 17:20:03 +03:00
|
|
|
if ($strTest eq 'all' || $strTest eq 'move')
|
|
|
|
{
|
|
|
|
$iRun = 0;
|
2014-06-04 02:03:03 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
&log(INFO, '--------------------------------------------------------------------------------');
|
2014-06-05 17:20:03 +03:00
|
|
|
&log(INFO, "Test File->move()\n");
|
2014-06-04 02:03:03 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
for (my $bRemote = 0; $bRemote <= 0; $bRemote++)
|
2014-06-04 02:03:03 +03:00
|
|
|
{
|
2014-06-21 21:19:03 +03:00
|
|
|
# Create the file object
|
2014-06-07 23:25:20 +03:00
|
|
|
my $oFile = BackRest::File->new
|
2014-06-05 17:20:03 +03:00
|
|
|
(
|
2014-06-22 17:30:17 +03:00
|
|
|
strStanza => $strStanza,
|
|
|
|
strBackupPath => $strTestPath,
|
2014-06-21 21:19:03 +03:00
|
|
|
strRemote => $bRemote ? 'backup' : undef,
|
|
|
|
oRemote => $bRemote ? $oRemote : undef
|
2014-06-05 17:20:03 +03:00
|
|
|
);
|
|
|
|
|
|
|
|
# Loop through source exists
|
|
|
|
for (my $bSourceExists = 0; $bSourceExists <= 1; $bSourceExists++)
|
2014-06-04 02:03:03 +03:00
|
|
|
{
|
2014-06-21 21:19:03 +03:00
|
|
|
# Loop through source errors
|
|
|
|
for (my $bSourceError = 0; $bSourceError <= 1; $bSourceError++)
|
|
|
|
{
|
|
|
|
# Loop through destination exists
|
|
|
|
for (my $bDestinationExists = 0; $bDestinationExists <= 1; $bDestinationExists++)
|
|
|
|
{
|
|
|
|
# Loop through source errors
|
|
|
|
for (my $bDestinationError = 0; $bDestinationError <= 1; $bDestinationError++)
|
|
|
|
{
|
|
|
|
# Loop through create
|
|
|
|
for (my $bCreate = 0; $bCreate <= $bDestinationExists; $bCreate++)
|
|
|
|
{
|
2014-07-16 05:32:41 +03:00
|
|
|
# Increment the run, log, and decide whether this unit test should be run
|
|
|
|
if (!BackRestTestCommon_Run(++$iRun,
|
2014-09-18 18:50:27 +03:00
|
|
|
"src_exists ${bSourceExists}, src_error ${bSourceError}, " .
|
|
|
|
", dst_exists ${bDestinationExists}, dst_error ${bDestinationError}, " .
|
|
|
|
"dst_create ${bCreate}")) {next}
|
2014-06-04 02:03:03 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
# Setup test directory
|
2014-06-22 17:54:31 +03:00
|
|
|
BackRestTestFile_Setup($bSourceError || $bDestinationError);
|
2014-06-04 18:58:30 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
my $strSourceFile = "${strTestPath}/test.txt";
|
|
|
|
my $strDestinationFile = "${strTestPath}/test-dest.txt";
|
2014-06-04 02:03:03 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
if ($bSourceError)
|
|
|
|
{
|
|
|
|
$strSourceFile = "${strTestPath}/private/test.txt";
|
|
|
|
}
|
|
|
|
elsif ($bSourceExists)
|
|
|
|
{
|
|
|
|
system("echo 'TESTDATA' > ${strSourceFile}");
|
|
|
|
}
|
2014-06-04 02:03:03 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
if ($bDestinationError)
|
|
|
|
{
|
|
|
|
$strSourceFile = "${strTestPath}/private/test.txt";
|
|
|
|
}
|
|
|
|
elsif (!$bDestinationExists)
|
|
|
|
{
|
|
|
|
$strDestinationFile = "${strTestPath}/sub/test-dest.txt";
|
|
|
|
}
|
2014-06-04 02:03:03 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
# Execute in eval in case of error
|
|
|
|
eval
|
|
|
|
{
|
|
|
|
$oFile->move(PATH_BACKUP_ABSOLUTE, $strSourceFile, PATH_BACKUP_ABSOLUTE, $strDestinationFile, $bCreate);
|
|
|
|
};
|
2014-06-04 02:03:03 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
if ($@)
|
|
|
|
{
|
|
|
|
if (!$bSourceExists || (!$bDestinationExists && !$bCreate) || $bSourceError || $bDestinationError)
|
|
|
|
{
|
|
|
|
next;
|
|
|
|
}
|
2014-06-04 02:03:03 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'error raised: ' . $@ . "\n";
|
2014-06-21 21:19:03 +03:00
|
|
|
}
|
2014-06-04 04:22:07 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
if (!$bSourceExists || (!$bDestinationExists && !$bCreate) || $bSourceError || $bDestinationError)
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'error should have been raised';
|
2014-06-21 21:19:03 +03:00
|
|
|
}
|
2014-06-04 02:03:03 +03:00
|
|
|
|
2014-06-21 21:19:03 +03:00
|
|
|
unless (-e $strDestinationFile)
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'file was not moved';
|
2014-06-04 02:03:03 +03:00
|
|
|
}
|
|
|
|
}
|
2014-06-21 21:19:03 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-06-04 02:03:03 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Test compress()
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-05 17:20:03 +03:00
|
|
|
if ($strTest eq 'all' || $strTest eq 'compress')
|
|
|
|
{
|
|
|
|
$iRun = 0;
|
2014-06-03 00:48:07 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
&log(INFO, '--------------------------------------------------------------------------------');
|
2014-06-05 17:20:03 +03:00
|
|
|
&log(INFO, "Test File->compress()\n");
|
2014-06-03 00:48:07 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
for (my $bRemote = 0; $bRemote <= 0; $bRemote++)
|
2014-06-03 00:48:07 +03:00
|
|
|
{
|
2014-06-21 22:17:09 +03:00
|
|
|
# Create the file object
|
2014-06-07 23:25:20 +03:00
|
|
|
my $oFile = BackRest::File->new
|
2014-06-05 17:20:03 +03:00
|
|
|
(
|
2014-06-22 17:30:17 +03:00
|
|
|
strStanza => $strStanza,
|
|
|
|
strBackupPath => $strTestPath,
|
2014-06-21 22:17:09 +03:00
|
|
|
strRemote => $bRemote ? 'backup' : undef,
|
|
|
|
oRemote => $bRemote ? $oRemote : undef
|
2014-06-05 17:20:03 +03:00
|
|
|
);
|
|
|
|
|
|
|
|
# Loop through exists
|
|
|
|
for (my $bExists = 0; $bExists <= 1; $bExists++)
|
2014-06-21 22:17:09 +03:00
|
|
|
{
|
|
|
|
for (my $bError = 0; $bError <= 1; $bError++)
|
2014-06-05 17:20:03 +03:00
|
|
|
{
|
2014-07-16 05:32:41 +03:00
|
|
|
if (!BackRestTestCommon_Run(++$iRun,
|
2014-09-18 18:50:27 +03:00
|
|
|
"rmt ${bRemote}, exists ${bExists}, err ${bError}")) {next}
|
2014-06-03 00:48:07 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
# Setup test directory
|
2014-06-22 17:54:31 +03:00
|
|
|
BackRestTestFile_Setup($bError);
|
2014-06-03 00:48:07 +03:00
|
|
|
|
2014-06-05 17:20:03 +03:00
|
|
|
my $strFile = "${strTestPath}/test.txt";
|
2014-06-21 22:17:09 +03:00
|
|
|
my $strSourceHash;
|
2014-06-03 00:48:07 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
if ($bError)
|
|
|
|
{
|
|
|
|
$strFile = "${strTestPath}/private/test.txt";
|
|
|
|
}
|
|
|
|
elsif ($bExists)
|
2014-06-05 17:20:03 +03:00
|
|
|
{
|
|
|
|
system("echo 'TESTDATA' > ${strFile}");
|
2014-06-21 22:17:09 +03:00
|
|
|
$strSourceHash = $oFile->hash(PATH_BACKUP_ABSOLUTE, $strFile);
|
2014-06-05 17:20:03 +03:00
|
|
|
}
|
2014-06-03 00:48:07 +03:00
|
|
|
|
2014-06-05 17:20:03 +03:00
|
|
|
# Execute in eval in case of error
|
|
|
|
eval
|
|
|
|
{
|
|
|
|
$oFile->compress(PATH_BACKUP_ABSOLUTE, $strFile);
|
|
|
|
};
|
2014-06-03 00:48:07 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
if ($@)
|
2014-06-05 17:20:03 +03:00
|
|
|
{
|
2014-06-21 22:17:09 +03:00
|
|
|
if (!$bExists || $bError)
|
|
|
|
{
|
|
|
|
next;
|
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'error raised: ' . $@ . "\n";
|
2014-06-05 17:20:03 +03:00
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
if (!$bExists || $bError)
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'expected error';
|
2014-06-21 22:17:09 +03:00
|
|
|
}
|
2014-06-04 18:58:30 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
my $strDestinationFile = $strFile . '.gz';
|
2014-06-02 23:26:37 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
if (-e $strFile)
|
2014-06-05 17:20:03 +03:00
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'source file still exists';
|
2014-06-05 17:20:03 +03:00
|
|
|
}
|
2014-06-02 23:26:37 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
unless (-e $strDestinationFile)
|
2014-06-05 17:20:03 +03:00
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'file was not compressed';
|
2014-06-21 22:17:09 +03:00
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
system("gzip -d ${strDestinationFile}") == 0 or die "could not decompress ${strDestinationFile}";
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
my $strDestinationHash = $oFile->hash(PATH_BACKUP_ABSOLUTE, $strFile);
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
if ($strSourceHash ne $strDestinationHash)
|
2014-06-02 23:26:37 +03:00
|
|
|
{
|
2014-06-21 22:17:09 +03:00
|
|
|
confess "source ${strSourceHash} and destination ${strDestinationHash} file hashes do not match";
|
2014-06-02 23:26:37 +03:00
|
|
|
}
|
|
|
|
}
|
2014-06-21 22:17:09 +03:00
|
|
|
}
|
2014-06-02 23:26:37 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-21 22:17:09 +03:00
|
|
|
# Test manifest()
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-22 01:19:37 +03:00
|
|
|
if ($strTest eq 'all' || $strTest eq 'manifest')
|
|
|
|
{
|
|
|
|
$iRun = 0;
|
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
&log(INFO, '--------------------------------------------------------------------------------');
|
2014-06-22 01:19:37 +03:00
|
|
|
&log(INFO, "Test File->manifest()\n");
|
|
|
|
|
|
|
|
my $strManifestCompare =
|
|
|
|
".,d,${strUser},${strGroup},0770,,,,\n" .
|
|
|
|
"sub1,d,${strUser},${strGroup},0750,,,,\n" .
|
|
|
|
"sub1/sub2,d,${strUser},${strGroup},0750,,,,\n" .
|
|
|
|
"sub1/sub2/test,l,${strUser},${strGroup},,,,,../..\n" .
|
|
|
|
"sub1/sub2/test-hardlink.txt,f,${strUser},${strGroup},1640,1111111111,0,9,\n" .
|
|
|
|
"sub1/sub2/test-sub2.txt,f,${strUser},${strGroup},0666,1111111113,0,11,\n" .
|
|
|
|
"sub1/test,l,${strUser},${strGroup},,,,,..\n" .
|
|
|
|
"sub1/test-hardlink.txt,f,${strUser},${strGroup},1640,1111111111,0,9,\n" .
|
|
|
|
"sub1/test-sub1.txt,f,${strUser},${strGroup},0646,1111111112,0,10,\n" .
|
|
|
|
"test.txt,f,${strUser},${strGroup},1640,1111111111,0,9,";
|
|
|
|
|
|
|
|
for (my $bRemote = 0; $bRemote <= 1; $bRemote++)
|
|
|
|
{
|
|
|
|
# Create the file object
|
|
|
|
my $oFile = BackRest::File->new
|
|
|
|
(
|
2014-06-22 17:30:17 +03:00
|
|
|
strStanza => $strStanza,
|
|
|
|
strBackupPath => $strTestPath,
|
2014-06-22 01:19:37 +03:00
|
|
|
strRemote => $bRemote ? 'backup' : undef,
|
|
|
|
oRemote => $bRemote ? $oRemote : undef
|
|
|
|
);
|
|
|
|
|
|
|
|
for (my $bError = 0; $bError <= 1; $bError++)
|
|
|
|
{
|
|
|
|
for (my $bExists = 0; $bExists <= 1; $bExists++)
|
|
|
|
{
|
2014-07-16 05:32:41 +03:00
|
|
|
if (!BackRestTestCommon_Run(++$iRun,
|
2014-09-18 18:50:27 +03:00
|
|
|
"rmt ${bRemote}, exists ${bExists}, err ${bError}")) {next}
|
2014-06-22 01:19:37 +03:00
|
|
|
|
|
|
|
# Setup test directory
|
2014-06-22 17:54:31 +03:00
|
|
|
BackRestTestFile_Setup($bError);
|
2014-06-22 01:19:37 +03:00
|
|
|
|
|
|
|
# Setup test data
|
2014-09-18 18:50:27 +03:00
|
|
|
system("mkdir -m 750 ${strTestPath}/sub1") == 0 or confess 'Unable to create test directory';
|
|
|
|
system("mkdir -m 750 ${strTestPath}/sub1/sub2") == 0 or confess 'Unable to create test directory';
|
2014-06-22 01:19:37 +03:00
|
|
|
|
|
|
|
system("echo 'TESTDATA' > ${strTestPath}/test.txt");
|
|
|
|
utime(1111111111, 1111111111, "${strTestPath}/test.txt");
|
|
|
|
system("chmod 1640 ${strTestPath}/test.txt");
|
|
|
|
|
|
|
|
system("echo 'TESTDATA_' > ${strTestPath}/sub1/test-sub1.txt");
|
|
|
|
utime(1111111112, 1111111112, "${strTestPath}/sub1/test-sub1.txt");
|
|
|
|
system("chmod 0640 ${strTestPath}/sub1/test-sub1.txt");
|
|
|
|
|
|
|
|
system("echo 'TESTDATA__' > ${strTestPath}/sub1/sub2/test-sub2.txt");
|
|
|
|
utime(1111111113, 1111111113, "${strTestPath}/sub1/sub2/test-sub2.txt");
|
|
|
|
system("chmod 0646 ${strTestPath}/sub1/test-sub1.txt");
|
|
|
|
|
|
|
|
system("ln ${strTestPath}/test.txt ${strTestPath}/sub1/test-hardlink.txt");
|
|
|
|
system("ln ${strTestPath}/test.txt ${strTestPath}/sub1/sub2/test-hardlink.txt");
|
|
|
|
|
|
|
|
system("ln -s .. ${strTestPath}/sub1/test");
|
|
|
|
system("chmod 0700 ${strTestPath}/sub1/test");
|
|
|
|
system("ln -s ../.. ${strTestPath}/sub1/sub2/test");
|
|
|
|
system("chmod 0750 ${strTestPath}/sub1/sub2/test");
|
|
|
|
|
|
|
|
system("chmod 0770 ${strTestPath}");
|
|
|
|
|
|
|
|
# Create path
|
|
|
|
my $strPath = $strTestPath;
|
|
|
|
|
|
|
|
if ($bError)
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
$strPath = $strTestPath . '/private';
|
2014-06-22 01:19:37 +03:00
|
|
|
}
|
|
|
|
elsif (!$bExists)
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
$strPath = $strTestPath . '/error';
|
2014-06-22 01:19:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# Execute in eval in case of error
|
|
|
|
my %oManifestHash;
|
2014-06-22 23:05:00 +03:00
|
|
|
my $bErrorExpected = !$bExists || $bError;
|
2014-06-22 01:19:37 +03:00
|
|
|
|
|
|
|
eval
|
|
|
|
{
|
|
|
|
$oFile->manifest(PATH_BACKUP_ABSOLUTE, $strPath, \%oManifestHash);
|
|
|
|
};
|
|
|
|
|
|
|
|
# Check for an error
|
|
|
|
if ($@)
|
|
|
|
{
|
|
|
|
if ($bErrorExpected)
|
|
|
|
{
|
|
|
|
next;
|
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'error raised: ' . $@ . "\n";
|
2014-06-22 01:19:37 +03:00
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-22 01:19:37 +03:00
|
|
|
# Check for an expected error
|
|
|
|
if ($bErrorExpected)
|
|
|
|
{
|
|
|
|
confess 'error was expected';
|
|
|
|
}
|
|
|
|
|
|
|
|
my $strManifest;
|
|
|
|
|
|
|
|
# Validate the manifest
|
|
|
|
foreach my $strName (sort(keys $oManifestHash{name}))
|
|
|
|
{
|
|
|
|
if (!defined($strManifest))
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
$strManifest = '';
|
2014-06-22 01:19:37 +03:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$strManifest .= "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (defined($oManifestHash{name}{"${strName}"}{inode}))
|
|
|
|
{
|
|
|
|
$oManifestHash{name}{"${strName}"}{inode} = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
$strManifest .=
|
|
|
|
"${strName}," .
|
2014-09-18 18:50:27 +03:00
|
|
|
$oManifestHash{name}{"${strName}"}{type} . ',' .
|
2014-06-22 01:19:37 +03:00
|
|
|
(defined($oManifestHash{name}{"${strName}"}{user}) ?
|
2014-09-18 18:50:27 +03:00
|
|
|
$oManifestHash{name}{"${strName}"}{user} : '') . ',' .
|
2014-06-22 01:19:37 +03:00
|
|
|
(defined($oManifestHash{name}{"${strName}"}{group}) ?
|
2014-09-18 18:50:27 +03:00
|
|
|
$oManifestHash{name}{"${strName}"}{group} : '') . ',' .
|
2014-06-22 01:19:37 +03:00
|
|
|
(defined($oManifestHash{name}{"${strName}"}{permission}) ?
|
2014-09-18 18:50:27 +03:00
|
|
|
$oManifestHash{name}{"${strName}"}{permission} : '') . ',' .
|
2014-06-22 01:19:37 +03:00
|
|
|
(defined($oManifestHash{name}{"${strName}"}{modification_time}) ?
|
2014-09-18 18:50:27 +03:00
|
|
|
$oManifestHash{name}{"${strName}"}{modification_time} : '') . ',' .
|
2014-06-22 01:19:37 +03:00
|
|
|
(defined($oManifestHash{name}{"${strName}"}{inode}) ?
|
2014-09-18 18:50:27 +03:00
|
|
|
$oManifestHash{name}{"${strName}"}{inode} : '') . ',' .
|
2014-06-22 01:19:37 +03:00
|
|
|
(defined($oManifestHash{name}{"${strName}"}{size}) ?
|
2014-09-18 18:50:27 +03:00
|
|
|
$oManifestHash{name}{"${strName}"}{size} : '') . ',' .
|
2014-06-22 01:19:37 +03:00
|
|
|
(defined($oManifestHash{name}{"${strName}"}{link_destination}) ?
|
2014-09-18 18:50:27 +03:00
|
|
|
$oManifestHash{name}{"${strName}"}{link_destination} : '');
|
2014-06-22 01:19:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($strManifest ne $strManifestCompare)
|
|
|
|
{
|
|
|
|
confess "manifest is not equal:\n\n${strManifest}\n\ncompare:\n\n${strManifestCompare}\n\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-05-14 22:07:37 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Test list()
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-22 01:19:37 +03:00
|
|
|
if ($strTest eq 'all' || $strTest eq 'list')
|
|
|
|
{
|
|
|
|
$iRun = 0;
|
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
&log(INFO, '--------------------------------------------------------------------------------');
|
2014-06-22 01:19:37 +03:00
|
|
|
&log(INFO, "Test File->list()\n");
|
|
|
|
|
|
|
|
for (my $bRemote = 0; $bRemote <= 1; $bRemote++)
|
|
|
|
{
|
|
|
|
# Create the file object
|
|
|
|
my $oFile = BackRest::File->new
|
|
|
|
(
|
2014-06-22 17:30:17 +03:00
|
|
|
strStanza => $strStanza,
|
|
|
|
strBackupPath => $strTestPath,
|
2014-06-22 01:19:37 +03:00
|
|
|
strRemote => $bRemote ? 'backup' : undef,
|
|
|
|
oRemote => $bRemote ? $oRemote : undef
|
|
|
|
);
|
|
|
|
|
|
|
|
# Loop through exists
|
|
|
|
for (my $bSort = 0; $bSort <= 1; $bSort++)
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
my $strSort = $bSort ? undef : 'reverse';
|
2014-06-22 01:19:37 +03:00
|
|
|
|
|
|
|
# Loop through expression
|
|
|
|
for (my $iExpression = 0; $iExpression <= 2; $iExpression++)
|
|
|
|
{
|
|
|
|
my $strExpression;
|
|
|
|
|
|
|
|
# Expression tha returns results
|
|
|
|
if ($iExpression == 1)
|
|
|
|
{
|
|
|
|
$strExpression = "^test2\\..*\$";
|
|
|
|
}
|
|
|
|
# Expression that does not return results
|
|
|
|
elsif ($iExpression == 2)
|
|
|
|
{
|
|
|
|
$strExpression = "^du\$";
|
|
|
|
}
|
|
|
|
|
|
|
|
# Loop through exists
|
|
|
|
for (my $bExists = 0; $bExists <= 1; $bExists++)
|
|
|
|
{
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-22 01:19:37 +03:00
|
|
|
# Loop through error
|
|
|
|
for (my $bError = 0; $bError <= 1; $bError++)
|
|
|
|
{
|
2014-07-16 05:32:41 +03:00
|
|
|
if (!BackRestTestCommon_Run(++$iRun,
|
2014-09-18 18:50:27 +03:00
|
|
|
"rmt ${bRemote}, err ${bError}, exists ${bExists}, " .
|
|
|
|
'expression ' . (defined($strExpression) ? $strExpression : '[undef]') . ', ' .
|
|
|
|
'sort ' . (defined($strSort) ? $strSort : '[undef]'))) {next}
|
2014-06-22 01:19:37 +03:00
|
|
|
|
|
|
|
# Setup test directory
|
2014-06-22 17:54:31 +03:00
|
|
|
BackRestTestFile_Setup($bError);
|
2014-06-22 01:19:37 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
my $strPath = $strTestPath;
|
2014-06-22 01:19:37 +03:00
|
|
|
|
|
|
|
if ($bError)
|
|
|
|
{
|
|
|
|
$strPath = "${strTestPath}/private";
|
|
|
|
}
|
|
|
|
elsif (!$bExists)
|
|
|
|
{
|
|
|
|
$strPath = "${strTestPath}/error";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
system("echo 'TESTDATA' > ${strPath}/test.txt");
|
|
|
|
system("echo 'TESTDATA2' > ${strPath}/test2.txt");
|
|
|
|
}
|
|
|
|
|
|
|
|
my @stryFileCompare = split(/\n/, "test.txt\ntest2.txt");
|
|
|
|
|
|
|
|
# Execute in eval in case of error
|
|
|
|
my @stryFileList;
|
|
|
|
my $bErrorExpected = !$bExists || $bError;
|
|
|
|
|
|
|
|
eval
|
|
|
|
{
|
|
|
|
@stryFileList = $oFile->list(PATH_BACKUP_ABSOLUTE, $strPath, $strExpression, $strSort);
|
|
|
|
};
|
|
|
|
|
|
|
|
if ($@)
|
|
|
|
{
|
|
|
|
if ($bErrorExpected)
|
|
|
|
{
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'error raised: ' . $@ . "\n";
|
2014-06-22 01:19:37 +03:00
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-22 01:19:37 +03:00
|
|
|
if ($bErrorExpected)
|
|
|
|
{
|
|
|
|
confess 'error was expected';
|
|
|
|
}
|
|
|
|
|
|
|
|
# Validate the list
|
|
|
|
if (defined($strExpression))
|
|
|
|
{
|
|
|
|
@stryFileCompare = grep(/$strExpression/i, @stryFileCompare);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (defined($strSort))
|
|
|
|
{
|
|
|
|
@stryFileCompare = sort {$b cmp $a} @stryFileCompare;
|
|
|
|
}
|
|
|
|
|
|
|
|
my $strFileList = sprintf("@stryFileList");
|
|
|
|
my $strFileCompare = sprintf("@stryFileCompare");
|
|
|
|
|
|
|
|
if ($strFileList ne $strFileCompare)
|
|
|
|
{
|
|
|
|
confess "list (${strFileList})[" . @stryFileList .
|
2014-09-18 18:50:27 +03:00
|
|
|
"] does not match compare (${strFileCompare})[" . @stryFileCompare . ']';
|
2014-06-22 01:19:37 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-06-02 00:23:33 +03:00
|
|
|
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-02 00:23:33 +03:00
|
|
|
# Test remove()
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-22 02:16:55 +03:00
|
|
|
if ($strTest eq 'all' || $strTest eq 'remove')
|
|
|
|
{
|
|
|
|
$iRun = 0;
|
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
&log(INFO, '--------------------------------------------------------------------------------');
|
2014-06-22 02:16:55 +03:00
|
|
|
&log(INFO, "Test File->remove()\n");
|
|
|
|
|
|
|
|
for (my $bRemote = 0; $bRemote <= 1; $bRemote++)
|
|
|
|
{
|
|
|
|
my $oFile = BackRest::File->new
|
|
|
|
(
|
|
|
|
strStanza => $strStanza,
|
2014-06-22 17:30:17 +03:00
|
|
|
strBackupPath => $strTestPath,
|
2014-06-22 02:16:55 +03:00
|
|
|
strRemote => $bRemote ? 'backup' : undef,
|
|
|
|
oRemote => $bRemote ? $oRemote : undef
|
|
|
|
);
|
|
|
|
|
|
|
|
# Loop through exists
|
|
|
|
for (my $bError = 0; $bError <= 1; $bError++)
|
|
|
|
{
|
|
|
|
# Loop through exists
|
|
|
|
for (my $bExists = 0; $bExists <= 1; $bExists++)
|
|
|
|
{
|
|
|
|
# Loop through temp
|
|
|
|
for (my $bTemp = 0; $bTemp <= 1; $bTemp++)
|
|
|
|
{
|
|
|
|
# Loop through ignore missing
|
|
|
|
for (my $bIgnoreMissing = 0; $bIgnoreMissing <= 1; $bIgnoreMissing++)
|
|
|
|
{
|
2014-07-16 05:32:41 +03:00
|
|
|
if (!BackRestTestCommon_Run(++$iRun,
|
2014-09-18 18:50:27 +03:00
|
|
|
"rmt ${bRemote}, err = ${bError}, exists ${bExists}, tmp ${bTemp}, " .
|
2014-07-16 05:32:41 +03:00
|
|
|
"ignore missing ${bIgnoreMissing}")) {next}
|
2014-06-22 02:16:55 +03:00
|
|
|
|
|
|
|
# Setup test directory
|
2014-06-22 17:54:31 +03:00
|
|
|
BackRestTestFile_Setup($bError);
|
2014-06-22 02:16:55 +03:00
|
|
|
|
|
|
|
my $strFile = "${strTestPath}/test.txt";
|
|
|
|
|
|
|
|
if ($bError)
|
|
|
|
{
|
|
|
|
$strFile = "${strTestPath}/private/test.txt"
|
|
|
|
}
|
|
|
|
elsif (!$bExists)
|
|
|
|
{
|
|
|
|
$strFile = "${strTestPath}/private/error.txt"
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
system("echo 'TESTDATA' > ${strFile}" . ($bTemp ? '.backrest.tmp' : ''));
|
2014-06-22 02:16:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# Execute in eval in case of error
|
|
|
|
my $bRemoved;
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-22 02:16:55 +03:00
|
|
|
eval
|
|
|
|
{
|
|
|
|
$bRemoved = $oFile->remove(PATH_BACKUP_ABSOLUTE, $strFile, $bTemp, $bIgnoreMissing);
|
|
|
|
};
|
|
|
|
|
|
|
|
if ($@)
|
|
|
|
{
|
|
|
|
if ($bError || $bRemote)
|
|
|
|
{
|
|
|
|
next;
|
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-22 02:16:55 +03:00
|
|
|
if (!$bExists && !$bIgnoreMissing)
|
|
|
|
{
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'unexpected error raised: ' . $@;
|
2014-06-22 02:16:55 +03:00
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-22 02:16:55 +03:00
|
|
|
if ($bError || $bRemote)
|
|
|
|
{
|
|
|
|
confess 'error should have been returned';
|
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-22 02:16:55 +03:00
|
|
|
if (!$bRemoved)
|
|
|
|
{
|
|
|
|
if (!$bExists && $bIgnoreMissing)
|
|
|
|
{
|
|
|
|
next;
|
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-22 02:16:55 +03:00
|
|
|
confess 'remove returned false, but something should have been removed';
|
|
|
|
}
|
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
if (-e ($strFile . ($bTemp ? '.backrest.tmp' : '')))
|
2014-06-22 02:16:55 +03:00
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'file still exists';
|
2014-06-22 02:16:55 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-05-27 16:00:24 +03:00
|
|
|
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-02 00:23:33 +03:00
|
|
|
# Test hash()
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-22 02:16:55 +03:00
|
|
|
if ($strTest eq 'all' || $strTest eq 'hash')
|
|
|
|
{
|
|
|
|
$iRun = 0;
|
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
&log(INFO, '--------------------------------------------------------------------------------');
|
2014-06-22 02:16:55 +03:00
|
|
|
&log(INFO, "test File->hash()\n");
|
|
|
|
|
|
|
|
for (my $bRemote = 0; $bRemote <= 1; $bRemote++)
|
|
|
|
{
|
|
|
|
my $oFile = BackRest::File->new
|
|
|
|
(
|
|
|
|
strStanza => $strStanza,
|
2014-06-22 17:30:17 +03:00
|
|
|
strBackupPath => $strTestPath,
|
2014-06-22 02:16:55 +03:00
|
|
|
strRemote => $bRemote ? 'backup' : undef,
|
|
|
|
oRemote => $bRemote ? $oRemote : undef
|
|
|
|
);
|
|
|
|
|
|
|
|
# Loop through error
|
|
|
|
for (my $bError = 0; $bError <= 1; $bError++)
|
|
|
|
{
|
|
|
|
# Loop through exists
|
|
|
|
for (my $bExists = 0; $bExists <= 1; $bExists++)
|
|
|
|
{
|
2014-07-16 05:32:41 +03:00
|
|
|
if (!BackRestTestCommon_Run(++$iRun,
|
2014-09-18 18:50:27 +03:00
|
|
|
"rmt ${bRemote}, err ${bError}, exists ${bExists}")) {next}
|
2014-06-22 02:16:55 +03:00
|
|
|
|
|
|
|
# Setup test directory
|
2014-06-22 17:54:31 +03:00
|
|
|
BackRestTestFile_Setup($bError);
|
2014-06-22 02:16:55 +03:00
|
|
|
|
|
|
|
my $strFile = "${strTestPath}/test.txt";
|
|
|
|
|
|
|
|
if ($bError)
|
|
|
|
{
|
|
|
|
$strFile = "${strTestPath}/private/test.txt";
|
|
|
|
}
|
|
|
|
elsif (!$bExists)
|
|
|
|
{
|
|
|
|
$strFile = "${strTestPath}/error.txt";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
system("echo 'TESTDATA' > ${strFile}");
|
|
|
|
}
|
|
|
|
|
|
|
|
# Execute in eval in case of error
|
|
|
|
my $strHash;
|
|
|
|
my $bErrorExpected = !$bExists || $bError || $bRemote;
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-22 02:16:55 +03:00
|
|
|
eval
|
|
|
|
{
|
|
|
|
$strHash = $oFile->hash(PATH_BACKUP_ABSOLUTE, $strFile)
|
|
|
|
};
|
|
|
|
|
|
|
|
if ($@)
|
|
|
|
{
|
|
|
|
if ($bErrorExpected)
|
|
|
|
{
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'unexpected error raised: ' . $@;
|
2014-06-22 02:16:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($bErrorExpected)
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'error was expected';
|
2014-06-22 02:16:55 +03:00
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-22 02:16:55 +03:00
|
|
|
if ($strHash ne '06364afe79d801433188262478a76d19777ef351')
|
|
|
|
{
|
|
|
|
confess 'hashes do not match';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-06-02 00:23:33 +03:00
|
|
|
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-02 00:23:33 +03:00
|
|
|
# Test exists()
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-05 17:20:03 +03:00
|
|
|
if ($strTest eq 'all' || $strTest eq 'exists')
|
|
|
|
{
|
|
|
|
$iRun = 0;
|
2014-06-04 18:58:30 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
&log(INFO, '--------------------------------------------------------------------------------');
|
2014-06-05 17:20:03 +03:00
|
|
|
&log(INFO, "test File->exists()\n");
|
2014-06-02 00:23:33 +03:00
|
|
|
|
2014-06-05 17:20:03 +03:00
|
|
|
for (my $bRemote = 0; $bRemote <= 1; $bRemote++)
|
2014-06-02 00:23:33 +03:00
|
|
|
{
|
2014-06-07 23:25:20 +03:00
|
|
|
my $oFile = BackRest::File->new
|
2014-06-05 17:20:03 +03:00
|
|
|
(
|
|
|
|
strStanza => $strStanza,
|
2014-06-22 17:30:17 +03:00
|
|
|
strBackupPath => $strTestPath,
|
2014-06-07 04:16:24 +03:00
|
|
|
strRemote => $bRemote ? 'backup' : undef,
|
|
|
|
oRemote => $bRemote ? $oRemote : undef
|
2014-06-05 17:20:03 +03:00
|
|
|
);
|
|
|
|
|
|
|
|
# Loop through exists
|
|
|
|
for (my $bExists = 0; $bExists <= 1; $bExists++)
|
|
|
|
{
|
2014-06-07 20:15:55 +03:00
|
|
|
# Loop through exists
|
|
|
|
for (my $bError = 0; $bError <= $bExists; $bError++)
|
|
|
|
{
|
2014-07-16 05:32:41 +03:00
|
|
|
if (!BackRestTestCommon_Run(++$iRun,
|
2014-09-18 18:50:27 +03:00
|
|
|
"rmt ${bRemote}, err ${bError}, exists ${bExists}")) {next}
|
2014-06-02 00:23:33 +03:00
|
|
|
|
2014-06-21 22:17:09 +03:00
|
|
|
# Setup test directory
|
2014-06-22 17:54:31 +03:00
|
|
|
BackRestTestFile_Setup($bError);
|
2014-06-02 00:23:33 +03:00
|
|
|
|
2014-06-07 20:15:55 +03:00
|
|
|
my $strFile = "${strTestPath}/test.txt";
|
2014-06-02 00:23:33 +03:00
|
|
|
|
2014-06-07 20:15:55 +03:00
|
|
|
if ($bError)
|
|
|
|
{
|
|
|
|
$strFile = "${strTestPath}/private/test.txt";
|
|
|
|
}
|
|
|
|
elsif ($bExists)
|
|
|
|
{
|
|
|
|
system("echo 'TESTDATA' > ${strFile}");
|
|
|
|
}
|
2014-06-04 18:58:30 +03:00
|
|
|
|
2014-06-07 20:15:55 +03:00
|
|
|
# Execute in eval in case of error
|
|
|
|
eval
|
2014-06-05 17:20:03 +03:00
|
|
|
{
|
2014-06-07 20:15:55 +03:00
|
|
|
if ($oFile->exists(PATH_BACKUP_ABSOLUTE, $strFile) != $bExists)
|
|
|
|
{
|
|
|
|
confess "bExists is set to ${bExists}, but exists() returned " . !$bExists;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
if ($@)
|
|
|
|
{
|
|
|
|
my $oMessage = $@;
|
|
|
|
my $iCode;
|
|
|
|
my $strMessage;
|
2014-06-07 22:30:13 +03:00
|
|
|
|
2014-06-07 20:15:55 +03:00
|
|
|
if (blessed($oMessage))
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
if ($oMessage->isa('BackRest::Exception'))
|
2014-06-07 20:15:55 +03:00
|
|
|
{
|
|
|
|
$iCode = $oMessage->code();
|
|
|
|
$strMessage = $oMessage->message();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
confess 'unknown error object';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$strMessage = $oMessage;
|
|
|
|
}
|
2014-06-07 22:30:13 +03:00
|
|
|
|
2014-06-24 01:54:00 +03:00
|
|
|
if ($bError)
|
2014-06-07 20:15:55 +03:00
|
|
|
{
|
|
|
|
next;
|
|
|
|
}
|
2014-06-07 22:30:13 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'error raised: ' . $strMessage . "\n";
|
2014-06-07 20:15:55 +03:00
|
|
|
}
|
2014-06-05 17:20:03 +03:00
|
|
|
}
|
2014-05-27 16:00:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-05-14 22:07:37 +03:00
|
|
|
# Test copy()
|
2014-06-03 00:48:07 +03:00
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
2014-06-05 17:20:03 +03:00
|
|
|
if ($strTest eq 'all' || $strTest eq 'copy')
|
2014-05-14 22:07:37 +03:00
|
|
|
{
|
2014-06-05 17:20:03 +03:00
|
|
|
$iRun = 0;
|
2014-05-14 22:07:37 +03:00
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
# Loop through backup local vs remote
|
2014-06-15 03:47:32 +03:00
|
|
|
for (my $bBackupRemote = 0; $bBackupRemote <= 1; $bBackupRemote++)
|
2014-05-14 22:07:37 +03:00
|
|
|
{
|
2014-06-21 19:22:25 +03:00
|
|
|
# Loop through db local vs remote
|
|
|
|
for (my $bDbRemote = 0; $bDbRemote <= 1; $bDbRemote++)
|
|
|
|
{
|
|
|
|
# Backup and db cannot both be remote
|
|
|
|
if ($bBackupRemote && $bDbRemote)
|
|
|
|
{
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Determine side is remote
|
|
|
|
my $strRemote = $bBackupRemote ? 'backup' : $bDbRemote ? 'db' : undef;
|
|
|
|
|
|
|
|
# Create the file object
|
|
|
|
my $oFile = BackRest::File->new
|
|
|
|
(
|
2014-06-22 17:30:17 +03:00
|
|
|
strStanza => $strStanza,
|
|
|
|
strBackupPath => $strTestPath,
|
2014-06-21 19:22:25 +03:00
|
|
|
strRemote => $strRemote,
|
2014-07-13 16:13:19 +03:00
|
|
|
oRemote => defined($strRemote) ? $oRemote : undef
|
2014-06-21 19:22:25 +03:00
|
|
|
);
|
|
|
|
|
2014-06-05 17:20:03 +03:00
|
|
|
# Loop through source compression
|
2014-06-21 19:22:25 +03:00
|
|
|
for (my $bSourceCompressed = 0; $bSourceCompressed <= 1; $bSourceCompressed++)
|
|
|
|
{
|
|
|
|
# Loop through destination compression
|
|
|
|
for (my $bDestinationCompress = 0; $bDestinationCompress <= 1; $bDestinationCompress++)
|
|
|
|
{
|
|
|
|
# Loop through source path types
|
|
|
|
for (my $bSourcePathType = 0; $bSourcePathType <= 1; $bSourcePathType++)
|
2014-05-14 22:07:37 +03:00
|
|
|
{
|
2014-06-21 19:22:25 +03:00
|
|
|
# Loop through destination path types
|
|
|
|
for (my $bDestinationPathType = 0; $bDestinationPathType <= 1; $bDestinationPathType++)
|
|
|
|
{
|
2014-07-13 16:13:19 +03:00
|
|
|
# Loop through source ignore/require
|
|
|
|
for (my $bSourceIgnoreMissing = 0; $bSourceIgnoreMissing <= 1; $bSourceIgnoreMissing++)
|
|
|
|
{
|
2014-06-21 19:22:25 +03:00
|
|
|
# Loop through source missing/present
|
|
|
|
for (my $bSourceMissing = 0; $bSourceMissing <= 1; $bSourceMissing++)
|
|
|
|
{
|
2014-07-13 16:13:19 +03:00
|
|
|
# Loop through small/large
|
|
|
|
for (my $bLarge = false; $bLarge <= defined($strRemote) && !$bSourceMissing; $bLarge++)
|
2014-06-21 19:22:25 +03:00
|
|
|
{
|
|
|
|
my $strSourcePathType = $bSourcePathType ? PATH_DB_ABSOLUTE : PATH_BACKUP_ABSOLUTE;
|
2014-09-18 18:50:27 +03:00
|
|
|
my $strSourcePath = $bSourcePathType ? 'db' : 'backup';
|
2014-06-21 19:22:25 +03:00
|
|
|
|
|
|
|
my $strDestinationPathType = $bDestinationPathType ? PATH_DB_ABSOLUTE : PATH_BACKUP_ABSOLUTE;
|
2014-09-18 18:50:27 +03:00
|
|
|
my $strDestinationPath = $bDestinationPathType ? 'db' : 'backup';
|
2014-06-21 19:22:25 +03:00
|
|
|
|
2014-07-16 05:32:41 +03:00
|
|
|
if (!BackRestTestCommon_Run(++$iRun,
|
2014-09-18 18:50:27 +03:00
|
|
|
'rmt ' .
|
2014-07-16 05:32:41 +03:00
|
|
|
(defined($strRemote) && ($strRemote eq $strSourcePath ||
|
|
|
|
$strRemote eq $strDestinationPath) ? 1 : 0) .
|
|
|
|
", lrg ${bLarge}, " .
|
2014-09-18 18:50:27 +03:00
|
|
|
'srcpth ' . (defined($strRemote) && $strRemote eq $strSourcePath ? 'rmt' : 'lcl') .
|
2014-07-16 05:32:41 +03:00
|
|
|
":${strSourcePath}, srccmp $bSourceCompressed, srcmiss ${bSourceMissing}, " .
|
|
|
|
"srcignmiss ${bSourceIgnoreMissing}, " .
|
2014-09-18 18:50:27 +03:00
|
|
|
'dstpth ' .
|
|
|
|
(defined($strRemote) && $strRemote eq $strDestinationPath ? 'rmt' : 'lcl') .
|
2014-07-16 05:32:41 +03:00
|
|
|
":${strDestinationPath}, dstcmp $bDestinationCompress")) {next}
|
2014-06-21 19:22:25 +03:00
|
|
|
|
2014-06-21 22:46:26 +03:00
|
|
|
# Setup test directory
|
2014-06-22 17:54:31 +03:00
|
|
|
BackRestTestFile_Setup(false);
|
2014-09-18 18:50:27 +03:00
|
|
|
system("mkdir ${strTestPath}/backup") == 0 or confess 'Unable to create test/backup directory';
|
|
|
|
system("mkdir ${strTestPath}/db") == 0 or confess 'Unable to create test/db directory';
|
2014-06-21 19:22:25 +03:00
|
|
|
|
2014-07-13 16:13:19 +03:00
|
|
|
my $strSourceFile = "${strTestPath}/${strSourcePath}/test-source";
|
|
|
|
my $strDestinationFile = "${strTestPath}/${strDestinationPath}/test-destination";
|
2014-06-21 19:22:25 +03:00
|
|
|
|
|
|
|
# Create the compressed or uncompressed test file
|
|
|
|
my $strSourceHash;
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
if (!$bSourceMissing)
|
2014-06-05 23:40:05 +03:00
|
|
|
{
|
2014-07-13 16:13:19 +03:00
|
|
|
if ($bLarge)
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
$strSourceFile .= '.bin';
|
|
|
|
$strDestinationFile .= '.bin';
|
2014-07-13 16:13:19 +03:00
|
|
|
|
|
|
|
BackRestTestCommon_Execute('cp ' . BackRestTestCommon_DataPathGet() . "/test.archive.bin ${strSourceFile}");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
$strSourceFile .= '.txt';
|
|
|
|
$strDestinationFile .= '.txt';
|
2014-07-13 16:13:19 +03:00
|
|
|
|
|
|
|
system("echo 'TESTDATA' > ${strSourceFile}");
|
|
|
|
}
|
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
$strSourceHash = $oFile->hash(PATH_ABSOLUTE, $strSourceFile);
|
|
|
|
|
|
|
|
if ($bSourceCompressed)
|
|
|
|
{
|
|
|
|
system("gzip ${strSourceFile}");
|
2014-09-18 18:50:27 +03:00
|
|
|
$strSourceFile .= '.gz';
|
2014-06-21 19:22:25 +03:00
|
|
|
}
|
2014-06-05 23:40:05 +03:00
|
|
|
}
|
2014-06-06 05:42:47 +03:00
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
if ($bDestinationCompress)
|
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
$strDestinationFile .= '.gz';
|
2014-06-21 19:22:25 +03:00
|
|
|
}
|
2014-06-21 15:42:30 +03:00
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
# Run file copy in an eval block because some errors are expected
|
|
|
|
my $bReturn;
|
2014-06-21 15:42:30 +03:00
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
eval
|
2014-05-14 22:07:37 +03:00
|
|
|
{
|
2014-06-21 19:22:25 +03:00
|
|
|
$bReturn = $oFile->copy($strSourcePathType, $strSourceFile,
|
|
|
|
$strDestinationPathType, $strDestinationFile,
|
|
|
|
$bSourceCompressed, $bDestinationCompress,
|
2014-06-28 21:32:34 +03:00
|
|
|
$bSourceIgnoreMissing, undef,
|
|
|
|
'0700');
|
2014-06-21 19:22:25 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
# Check for errors after copy
|
|
|
|
if ($@)
|
|
|
|
{
|
|
|
|
my $oMessage = $@;
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
if (blessed($oMessage))
|
2014-05-14 22:07:37 +03:00
|
|
|
{
|
2014-09-18 18:50:27 +03:00
|
|
|
if ($oMessage->isa('BackRest::Exception'))
|
2014-05-14 22:07:37 +03:00
|
|
|
{
|
2014-06-21 19:22:25 +03:00
|
|
|
if ($bSourceMissing && !$bSourceIgnoreMissing)
|
2014-05-14 22:07:37 +03:00
|
|
|
{
|
2014-06-21 19:22:25 +03:00
|
|
|
next;
|
2014-05-14 22:07:37 +03:00
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
confess $oMessage->message();
|
2014-05-14 22:07:37 +03:00
|
|
|
}
|
2014-06-21 19:22:25 +03:00
|
|
|
else
|
|
|
|
{
|
|
|
|
confess 'unknown error object: ' . $oMessage;
|
|
|
|
}
|
|
|
|
}
|
2014-06-28 21:32:34 +03:00
|
|
|
|
|
|
|
confess $oMessage;
|
2014-06-21 19:22:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($bSourceMissing)
|
|
|
|
{
|
|
|
|
if ($bSourceIgnoreMissing)
|
|
|
|
{
|
|
|
|
if ($bReturn)
|
|
|
|
{
|
|
|
|
confess 'copy() returned ' . $bReturn . ' when ignore missing set';
|
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
next;
|
2014-05-14 22:07:37 +03:00
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-09-18 18:50:27 +03:00
|
|
|
confess 'expected source file missing error';
|
2014-06-21 19:22:25 +03:00
|
|
|
}
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
unless (-e $strDestinationFile)
|
|
|
|
{
|
|
|
|
confess "could not find destination file ${strDestinationFile}";
|
2014-05-14 22:07:37 +03:00
|
|
|
}
|
2014-06-21 19:22:25 +03:00
|
|
|
|
2014-07-13 16:13:19 +03:00
|
|
|
my $strDestinationTest = $strDestinationFile;
|
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
if ($bDestinationCompress)
|
|
|
|
{
|
2014-07-13 16:13:19 +03:00
|
|
|
$strDestinationTest = substr($strDestinationFile, 0, length($strDestinationFile) - 3) . '.test';
|
2014-06-22 03:08:49 +03:00
|
|
|
|
2014-07-13 16:13:19 +03:00
|
|
|
system("gzip -dc ${strDestinationFile} > ${strDestinationTest}") == 0
|
|
|
|
or die "could not decompress ${strDestinationFile}";
|
2014-06-30 00:23:34 +03:00
|
|
|
}
|
|
|
|
|
2014-07-13 16:13:19 +03:00
|
|
|
my $strDestinationHash = $oFile->hash(PATH_ABSOLUTE, $strDestinationTest);
|
2014-06-30 00:23:34 +03:00
|
|
|
|
2014-06-21 19:22:25 +03:00
|
|
|
if ($strSourceHash ne $strDestinationHash)
|
|
|
|
{
|
|
|
|
confess "source ${strSourceHash} and destination ${strDestinationHash} file hashes do not match";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-05-14 22:07:37 +03:00
|
|
|
}
|
2014-06-21 19:22:25 +03:00
|
|
|
}
|
|
|
|
}
|
2014-07-13 16:13:19 +03:00
|
|
|
}
|
2014-06-21 19:22:25 +03:00
|
|
|
}
|
2014-05-14 22:07:37 +03:00
|
|
|
}
|
|
|
|
}
|
2014-07-16 05:32:41 +03:00
|
|
|
|
|
|
|
if (BackRestTestCommon_Cleanup())
|
|
|
|
{
|
|
|
|
BackRestTestFile_Setup(undef, true);
|
|
|
|
}
|
2014-05-14 22:07:37 +03:00
|
|
|
}
|
2014-06-21 21:19:03 +03:00
|
|
|
|
2014-06-22 03:08:49 +03:00
|
|
|
1;
|