Copy of Nextcloud richdocuments app, but with modifications so all traffic goes over clearnet/CJDNS/Tor/I2P/whatever instead of having a single default hostname.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

144 lines
3.4 KiB

  1. #!/bin/bash
  2. #
  3. # ownCloud
  4. BASEDIR=$PWD
  5. if [ "$DB" == "mysql" ] ; then
  6. DATABASENAME=documents_test
  7. DATABASEUSER=documents_test
  8. ADMINLOGIN=travis
  9. mysql -e 'CREATE DATABASE IF NOT EXISTS documents_test'
  10. mysql -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='travis' AND Host='localhost';"
  11. mysql -e "FLUSH PRIVILEGES;"
  12. fi
  13. if [ "$DB" == "sqlite" ] ; then
  14. DATABASENAME=documents_test
  15. DATABASEUSER=documents_test
  16. ADMINLOGIN=oc_autotest
  17. fi
  18. DATADIR=$BASEDIR/data-autotest
  19. echo "Using database $DATABASENAME with $DB"
  20. # create autoconfig for sqlite, mysql and postgresql
  21. cat > $BASEDIR/tests/autoconfig-sqlite.php <<DELIM
  22. <?php
  23. \$AUTOCONFIG = array (
  24. 'installed' => false,
  25. 'dbtype' => 'sqlite',
  26. 'dbtableprefix' => 'oc_',
  27. 'adminlogin' => '$ADMINLOGIN',
  28. 'adminpass' => 'admin',
  29. 'directory' => '$DATADIR',
  30. );
  31. DELIM
  32. cat > $BASEDIR/tests/autoconfig-mysql.php <<DELIM
  33. <?php
  34. \$AUTOCONFIG = array (
  35. 'installed' => false,
  36. 'dbtype' => 'mysql',
  37. 'dbtableprefix' => 'oc_',
  38. 'adminlogin' => '$ADMINLOGIN',
  39. 'adminpass' => 'travis',
  40. 'directory' => '$DATADIR',
  41. 'dbuser' => 'travis',
  42. 'dbname' => '$DATABASENAME',
  43. 'dbhost' => 'localhost',
  44. 'dbpass' => 'travis',
  45. );
  46. DELIM
  47. cat > $BASEDIR/tests/autoconfig-pgsql.php <<DELIM
  48. <?php
  49. \$AUTOCONFIG = array (
  50. 'installed' => false,
  51. 'dbtype' => 'pgsql',
  52. 'dbtableprefix' => 'oc_',
  53. 'adminlogin' => '$ADMINLOGIN',
  54. 'adminpass' => 'admin',
  55. 'directory' => '$DATADIR',
  56. 'dbuser' => '$DATABASEUSER',
  57. 'dbname' => '$DATABASENAME',
  58. 'dbhost' => 'localhost',
  59. 'dbpass' => 'owncloud',
  60. );
  61. DELIM
  62. function setup_db {
  63. echo "Setup environment for $DB testing ..."
  64. # back to root folder
  65. cd $BASEDIR
  66. # reset data directory
  67. rm -rf $DATADIR
  68. mkdir $DATADIR
  69. #rm -rf config/config.php
  70. cp $BASEDIR/tests/preseed-config.php $BASEDIR/../core/config/config.php
  71. # copy autoconfig
  72. cat $BASEDIR/tests/autoconfig-$DB.php
  73. cp $BASEDIR/tests/autoconfig-$DB.php $BASEDIR/../core/config/autoconfig.php
  74. ls -l $BASEDIR/../core/config/
  75. # trigger installation
  76. cd $BASEDIR/../core/
  77. php -f index.php
  78. cd -
  79. #test execution
  80. echo "Testing with $DB ..."
  81. cd tests
  82. }
  83. #
  84. # start test execution
  85. #
  86. setup_db '$DB'
  87. ls $BASEDIR/tests/
  88. ls $BASEDIR/../core/config/
  89. cat $BASEDIR/../core/config/config.php
  90. #ls $BASEDIR/../core/data/
  91. #cat $BASEDIR/../core/data/owncloud.log
  92. #
  93. # NOTES on mysql:
  94. # - CREATE DATABASE oc_autotest;
  95. # - CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY 'owncloud';
  96. # - grant all on oc_autotest.* to 'oc_autotest'@'localhost';
  97. #
  98. # - for parallel executor support with EXECUTOR_NUMBER=0:
  99. # - CREATE DATABASE oc_autotest0;
  100. # - CREATE USER 'oc_autotest0'@'localhost' IDENTIFIED BY 'owncloud';
  101. # - grant all on oc_autotest0.* to 'oc_autotest0'@'localhost';
  102. #
  103. # NOTES on pgsql:
  104. # - su - postgres
  105. # - createuser -P oc_autotest (enter password and enable superuser)
  106. # - to enable dropdb I decided to add following line to pg_hba.conf (this is not the safest way but I don't care for the testing machine):
  107. # local all all trust
  108. #
  109. # - for parallel executor support with EXECUTOR_NUMBER=0:
  110. # - createuser -P oc_autotest0 (enter password and enable superuser)
  111. #
  112. # NOTES on oci:
  113. # - it's a pure nightmare to install Oracle on a Linux-System
  114. # - DON'T TRY THIS AT HOME!
  115. # - if you really need it: we feel sorry for you
  116. #
  117. cd $BASEDIR
  118. cd ..
  119. git clone https://github.com/owncloud/core
  120. cd core
  121. git submodule update --init
  122. mkdir apps2
  123. ln -s $BASEDIR apps2
  124. cd -
  125. cd $BASEDIR