diff options
author | Björn Schießle <bjoern@schiessle.org> | 2014-09-23 12:24:48 +0200 |
---|---|---|
committer | Björn Schießle <bjoern@schiessle.org> | 2014-09-23 12:24:48 +0200 |
commit | 039603e10a36e476b7ee06548b0a8c62d6e9419c (patch) | |
tree | 06af547e5c4a10e764385c5ea77c8b51a588eef0 | |
parent | 2e0fbba37b130ffed5289785c34f43dabb62c466 (diff) | |
parent | 10af54f20ee38cd42074308ad73c6223f811d3b3 (diff) | |
download | nextcloud-server-039603e10a36e476b7ee06548b0a8c62d6e9419c.tar.gz nextcloud-server-039603e10a36e476b7ee06548b0a8c62d6e9419c.zip |
Merge pull request #11244 from owncloud/jenkins-stable5
Fixing Jenkins execution for stable5
-rw-r--r-- | apps/files_encryption/tests/keymanager.php | 18 | ||||
-rwxr-xr-x | autotest.sh | 32 |
2 files changed, 24 insertions, 26 deletions
diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php index 40ae1659a55..4216f51fabc 100644 --- a/apps/files_encryption/tests/keymanager.php +++ b/apps/files_encryption/tests/keymanager.php @@ -14,6 +14,7 @@ require_once realpath(dirname(__FILE__) . '/../lib/stream.php'); require_once realpath(dirname(__FILE__) . '/../lib/util.php'); require_once realpath(dirname(__FILE__) . '/../lib/helper.php'); require_once realpath(dirname(__FILE__) . '/../appinfo/app.php'); +require_once realpath(dirname(__FILE__) . '/util.php'); use OCA\Encryption; @@ -47,17 +48,8 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase { // disable file proxy by default \OC_FileProxy::$enabled = false; - // setup filesystem - \OC_Util::tearDownFS(); - \OC_User::setUserId(''); - \OC\Files\Filesystem::tearDown(); - \OC_Util::setupFS('admin'); - \OC_User::setUserId('admin'); - - // login admin - $params['uid'] = 'admin'; - $params['password'] = 'admin'; - OCA\Encryption\Hooks::login($params); + $create = (\OC_User::userExists('admin')) ? false : true; + \Test_Encryption_Util::loginHelper('admin', $create); } function setUp() { @@ -101,6 +93,8 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase { public static function tearDownAfterClass() { \OC_FileProxy::$enabled = true; + // delete admin user again + \OC_User::deleteUser('admin'); } function testGetPrivateKey() { @@ -134,7 +128,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase { function testSetFileKey() { - # NOTE: This cannot be tested until we are able to break out + # NOTE: This cannot be tested until we are able to break out # of the FileSystemView data directory root $key = Encryption\Crypt::symmetricEncryptFileContentKeyfile($this->randomKey, 'hat'); diff --git a/autotest.sh b/autotest.sh index 141b4333f97..7d6d7d52aee 100755 --- a/autotest.sh +++ b/autotest.sh @@ -6,6 +6,10 @@ # @copyright 2012 Thomas Müller thomas.mueller@tmit.eu # +#$EXECUTOR_NUMBER is set by Jenkins and allows us to run autotest in parallel +DATABASENAME=oc_autotest$EXECUTOR_NUMBER +DATABASEUSER=oc_autotest$EXECUTOR_NUMBER +ADMINLOGIN=admin$EXECUTOR_NUMBER DATADIR=data-autotest BASEDIR=$PWD @@ -28,11 +32,11 @@ cat > ./tests/autoconfig-mysql.php <<DELIM 'installed' => false, 'dbtype' => 'mysql', 'dbtableprefix' => 'oc_', - 'adminlogin' => 'admin', + 'adminlogin' => '$ADMINLOGIN', 'adminpass' => 'admin', 'directory' => '$BASEDIR/$DATADIR', - 'dbuser' => 'oc_autotest', - 'dbname' => 'oc_autotest', + 'dbuser' => '$DATABASEUSER', + 'dbname' => '$DATABASENAME', 'dbhost' => 'localhost', 'dbpass' => 'owncloud', ); @@ -44,11 +48,11 @@ cat > ./tests/autoconfig-pgsql.php <<DELIM 'installed' => false, 'dbtype' => 'pgsql', 'dbtableprefix' => 'oc_', - 'adminlogin' => 'admin', + 'adminlogin' => '$ADMINLOGIN', 'adminpass' => 'admin', 'directory' => '$BASEDIR/$DATADIR', - 'dbuser' => 'oc_autotest', - 'dbname' => 'oc_autotest', + 'dbuser' => '$DATABASEUSER', + 'dbname' => '$DATABASENAME', 'dbhost' => 'localhost', 'dbpass' => 'owncloud', ); @@ -60,10 +64,10 @@ cat > ./tests/autoconfig-oci.php <<DELIM 'installed' => false, 'dbtype' => 'oci', 'dbtableprefix' => 'oc_', - 'adminlogin' => 'admin', + 'adminlogin' => '$ADMINLOGIN', 'adminpass' => 'admin', 'directory' => '$BASEDIR/$DATADIR', - 'dbuser' => 'oc_autotest', + 'dbuser' => '$DATABASEUSER', 'dbname' => 'XE', 'dbhost' => 'localhost', 'dbpass' => 'owncloud', @@ -88,21 +92,21 @@ function execute_tests { # drop database if [ "$1" == "mysql" ] ; then - mysql -u oc_autotest -powncloud -e "DROP DATABASE oc_autotest" + mysql -u $DATABASEUSER -powncloud -e "DROP DATABASE $DATABASENAME" fi if [ "$1" == "pgsql" ] ; then - dropdb -U oc_autotest oc_autotest + dropdb -U $DATABASEUSER $DATABASENAME fi if [ "$1" == "oci" ] ; then echo "drop the database" sqlplus -s -l / as sysdba <<EOF - drop user oc_autotest cascade; + drop user $DATABASENAME cascade; EOF echo "create the database" sqlplus -s -l / as sysdba <<EOF - create user oc_autotest identified by owncloud; - alter user oc_autotest default tablespace users + create user $DATABASENAME identified by owncloud; + alter user $DATABASENAME default tablespace users temporary tablespace temp quota unlimited on users; grant create session @@ -113,7 +117,7 @@ EOF , create view , create synonym , alter session - to oc_autotest; + to $DATABASENAME; exit; EOF fi |