server/autotest.sh

78 lines
1.6 KiB
Bash
Raw Normal View History

2012-07-15 10:05:48 +00:00
#
# sqlite testing now
#
echo "Setup environment for sqlite testing ..."
DATADIR=data-autotest
rm -rf $DATADIR
mkdir $DATADIR
rm -rf config/config.php
#cp autotest/config.sqlite.php config/autoconfig.php
cat > ./config/autoconfig.php <<DELIM
<?php
\$AUTOCONFIG = array (
'installed' => false,
'dbtype' => 'sqlite',
'dbtableprefix' => 'oc_',
'datadirectory' => 'data',
'adminlogin' => 'admin',
'adminpass' => 'admin',
'directory' => '$PWD/$DATADIR',
);
DELIM
php -f index.php
#test execution
echo 'Testing with sqlite ...'
cd tests
php -f index.php -- xml > autotest-results-sqlite.xml
2012-07-15 11:49:11 +00:00
cd ..
git checkout tests/data/*
2012-07-15 10:05:48 +00:00
#
# mysql testing now
#
# NOTES:
2012-07-15 11:49:11 +00:00
# - CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY 'owncloud';
2012-07-15 10:05:48 +00:00
# - grant access permissions: grant all on oc_autotest.* to 'oc_autotest'@'localhost';
#
echo "Setup environment for MySql testing ..."
DATADIR=data-autotest
rm -rf $DATADIR
mkdir $DATADIR
rm -rf config/config.php
cat > ./config/autoconfig.php <<DELIM
<?php
\$AUTOCONFIG = array (
'installed' => false,
'dbtype' => 'mysql',
'dbtableprefix' => 'oc_',
'datadirectory' => 'data',
'adminlogin' => 'admin',
'adminpass' => 'admin',
'directory' => '$PWD/$DATADIR',
'dbuser' => 'oc_autotest',
'dbname' => 'oc_autotest',
'dbhost' => 'localhost',
'dbpass' => 'owncloud',
);
DELIM
#drop the database
mysql -u oc_autotest -powncloud -e "DROP DATABASE oc_autotest"
#setup
php -f index.php
#test execution
echo 'Testing with MySql ...'
cd tests
php -f index.php -- xml > autotest-results-MySql.xml
2012-07-15 11:49:11 +00:00
cd ..
git checkout tests/data/*
#
2012-07-15 10:05:48 +00:00
# TODO: create config for postgres
#