diff options
author | Christian Berendt <berendt@b1-systems.de> | 2013-07-08 15:25:49 +0200 |
---|---|---|
committer | Christian Berendt <berendt@b1-systems.de> | 2013-07-08 15:25:49 +0200 |
commit | 83a1fce1a3be983126bc77ebd84f715ac43ac22e (patch) | |
tree | f559b78534f539d8909fb6bc757fef866f4d6076 /apps/files_external | |
parent | 882d5ad728348bc0428134409f60e5e26ec70d02 (diff) | |
download | nextcloud-server-83a1fce1a3be983126bc77ebd84f715ac43ac22e.tar.gz nextcloud-server-83a1fce1a3be983126bc77ebd84f715ac43ac22e.zip |
make tests workable with Amazon S3
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/tests/amazons3.php | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/apps/files_external/tests/amazons3.php b/apps/files_external/tests/amazons3.php index 06bf968b606..8dcd386341e 100644 --- a/apps/files_external/tests/amazons3.php +++ b/apps/files_external/tests/amazons3.php @@ -40,21 +40,28 @@ class AmazonS3 extends Storage { if ($this->instance) { $connection = $this->instance->getConnection(); - // NOTE(berendt): clearBucket() is not working with Ceph - $iterator = $connection->getIterator('ListObjects', array( - 'Bucket' => $this->config['amazons3']['bucket'] - )); - - foreach ($iterator as $object) { - $connection->deleteObject(array( - 'Bucket' => $this->config['amazons3']['bucket'], - 'Key' => $object['Key'] + try { + // NOTE(berendt): clearBucket() is not working with Ceph + $iterator = $connection->getIterator('ListObjects', array( + 'Bucket' => $this->config['amazons3']['bucket'] )); + + foreach ($iterator as $object) { + $connection->deleteObject(array( + 'Bucket' => $this->config['amazons3']['bucket'], + 'Key' => $object['Key'] + )); + } + } catch (S3Exception $e) { } $connection->deleteBucket(array( 'Bucket' => $this->config['amazons3']['bucket'] )); + + $connection->waitUntilBucketNotExists(array( + 'Bucket' => $this->config['amazons3']['bucket'] + )); } } } |