1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-05-22 10:15:16 +02:00

Remove dependency on aws cli for testing.

This tool was only being used it a few places but was a pretty large dependency.

Rework the forceStorageMove() code using our storage layer and replace one aws cli cp with a storage put.

Also, remove the Dockerfile that was once used to build the Scality S3 test container.
This commit is contained in:
David Steele
2019-10-09 14:38:24 -04:00
parent ac870b42de
commit 528f4c4347
6 changed files with 31 additions and 116 deletions
+29 -3
View File
@@ -32,6 +32,7 @@ use pgBackRest::Storage::Base;
use pgBackRestTest::Common::ExecuteTest;
use pgBackRestTest::Common::HostGroupTest;
use pgBackRestTest::Common::LogTest;
use pgBackRestTest::Common::RunTest;
use pgBackRestTest::Common::VmTest;
use pgBackRestTest::Env::Host::HostBaseTest;
use pgBackRestTest::Env::Host::HostBackupTest;
@@ -204,9 +205,34 @@ sub forceStorageMove
# If S3 then use storage commands to remove
if ($oStorage->type() eq STORAGE_S3)
{
hostGroupGet()->hostGet(HOST_S3)->executeS3(
'mv' . ($bRecurse ? ' --recursive' : '') . ' s3://' . HOST_S3_BUCKET . $oStorage->pathGet($strSourcePathExp) .
' s3://' . HOST_S3_BUCKET . $oStorage->pathGet($strDestinationPathExp));
if ($bRecurse)
{
my $rhManifest = $oStorage->manifest($strSourcePathExp);
foreach my $strName (sort(keys(%{$rhManifest})))
{
if ($rhManifest->{$strName}{type} eq 'f')
{
$oStorage->put(
new pgBackRest::Storage::StorageWrite(
$oStorage,
pgBackRest::LibC::StorageWrite->new(
$oStorage->{oStorageC}, "${strDestinationPathExp}/${strName}", 0, undef, undef, 0, true, false)),
${$oStorage->get(
new pgBackRest::Storage::StorageRead(
$oStorage,
pgBackRest::LibC::StorageRead->new(
$oStorage->{oStorageC}, "${strSourcePathExp}/${strName}", false)))});
$oStorage->remove("${strSourcePathExp}/${strName}");
}
}
}
else
{
$oStorage->put($strDestinationPathExp, ${$oStorage->get($strSourcePathExp)});
$oStorage->remove($strSourcePathExp);
}
}
# Else remove using filesystem commands
else