summaryrefslogtreecommitdiffstats
path: root/autotest.sh
blob: 06605687d1d9b30a2793b1566e53131c732b6981 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# 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

#
# mysql testing now
#
# NOTES:
#  - 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

#
# TODO: create config for postgres
#