summaryrefslogtreecommitdiffstats
path: root/tests/lib/files/objectstore/swift.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2015-09-28 16:38:01 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2015-10-06 16:27:25 +0200
commit5646e39248d9ac2bade491dc99c88a10b3dfbc34 (patch)
treea330a10aa0979d00b3449205c95cf484af6d03b2 /tests/lib/files/objectstore/swift.php
parentbb4246c9a8dc40d844ad94492cb40ece5bd35ef6 (diff)
downloadnextcloud-server-5646e39248d9ac2bade491dc99c88a10b3dfbc34.tar.gz
nextcloud-server-5646e39248d9ac2bade491dc99c88a10b3dfbc34.zip
test objectstore with ceph docker
use default config for swift primary storage test config allow testsuite to complete fix timeout, script cleanup, enable debug for now use btrfs loopback device, requires privileged container and absolute path throw exception when storage has problems debug by echo ... sleep more, more debug
Diffstat (limited to 'tests/lib/files/objectstore/swift.php')
-rw-r--r--tests/lib/files/objectstore/swift.php32
1 files changed, 11 insertions, 21 deletions
diff --git a/tests/lib/files/objectstore/swift.php b/tests/lib/files/objectstore/swift.php
index 0aaf7d906dd..136d8d18039 100644
--- a/tests/lib/files/objectstore/swift.php
+++ b/tests/lib/files/objectstore/swift.php
@@ -23,9 +23,11 @@ namespace OCA\ObjectStore\Tests\Unit;
use OC\Files\ObjectStore\ObjectStoreStorage;
use OC\Files\ObjectStore\Swift as ObjectStoreToTest;
-//class Swift extends PHPUnit_Framework_TestCase {
class Swift extends \Test\Files\Storage\Storage {
+ /**
+ * @var ObjectStoreToTest
+ */
private $objectStorage;
protected function setUp() {
@@ -35,9 +37,6 @@ class Swift extends \Test\Files\Storage\Storage {
$this->markTestSkipped('objectstore tests are unreliable in some environments');
}
- \OC_App::disable('files_sharing');
- \OC_App::disable('files_versions');
-
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
@@ -50,28 +49,15 @@ class Swift extends \Test\Files\Storage\Storage {
}
// main test user
- $userName = 'test';
\OC_Util::tearDownFS();
\OC_User::setUserId('');
\OC\Files\Filesystem::tearDown();
\OC_User::setUserId('test');
- $testContainer = 'oc-test-container-'.substr( md5(rand()), 0, 7);
-
- $params = array(
- 'username' => 'facebook100000330192569',
- 'password' => 'Dbdj1sXnRSHxIGc4',
- 'container' => $testContainer,
- 'autocreate' => true,
- 'region' => 'RegionOne', //required, trystack defaults to 'RegionOne'
- 'url' => 'http://8.21.28.222:5000/v2.0', // The Identity / Keystone endpoint
- 'tenantName' => 'facebook100000330192569', // required on trystack
- 'serviceName' => 'swift', //trystack uses swift by default, the lib defaults to 'cloudFiles' if omitted
- 'user' => \OC_User::getManager()->get($userName)
- );
- $this->objectStorage = new ObjectStoreToTest($params);
- $params['objectstore'] = $this->objectStorage;
- $this->instance = new ObjectStoreStorage($params);
+ $config = \OC::$server->getConfig()->getSystemValue('objectstore');
+ $this->objectStorage = new ObjectStoreToTest($config['arguments']);
+ $config['objectstore'] = $this->objectStorage;
+ $this->instance = new ObjectStoreStorage($config);
}
protected function tearDown() {
@@ -81,6 +67,10 @@ class Swift extends \Test\Files\Storage\Storage {
$this->objectStorage->deleteContainer(true);
$this->instance->getCache()->clear();
+ $users = array('test');
+ foreach($users as $userName) {
+ \OC_User::deleteUser($userName);
+ }
parent::tearDown();
}