diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-08 14:08:56 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-08 14:08:56 +0200 |
commit | 17ffa4a244fef9d6cac453f4de9cbeb2b202c90d (patch) | |
tree | 5ef9ef9e98076c206253ce3322766f249632edb1 /tests/lib/files | |
parent | fd5636cda7b4bf752cf34648a0c2b672a586e818 (diff) | |
parent | 5646e39248d9ac2bade491dc99c88a10b3dfbc34 (diff) | |
download | nextcloud-server-17ffa4a244fef9d6cac453f4de9cbeb2b202c90d.tar.gz nextcloud-server-17ffa4a244fef9d6cac453f4de9cbeb2b202c90d.zip |
Merge pull request #19414 from owncloud/swift_primary_storage_tests
Swift primary storage tests
Diffstat (limited to 'tests/lib/files')
-rw-r--r-- | tests/lib/files/objectstore/swift.php | 32 |
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(); } |