8 echo "You must give the testsuite to run :"
9 echo " - DEBDebian70Tests.php"
10 echo " - RPMCentosTests.php"
11 echo " - TarCentosTests.php"
13 if [ "x$testsuite" = "x" ]
15 echo "Forge test suite not found"
19 scriptdir=$(dirname $0)
20 FORGE_HOME=$(cd $scriptdir/../..; pwd)
22 [ ! -f tests/config/default ] || . tests/config/default
23 [ ! -f tests/config/phpunit ] || . tests/config/phpunit
24 SELENIUM_RC_DIR=/var/log
25 SELENIUM_RC_URL=${HUDSON_URL}job/${JOB_NAME}/ws/reports
26 SELENIUM_RC_HOST=`hostname -f`
28 CONFIG_PHP=func/config.php
29 export SELENIUM_RC_DIR SELENIUM_RC_URL SELENIUM_RC_HOST HOST DB_NAME DB_USER CONFIG_PHP
31 cat <<-EOF >tests/func/config.php
33 // Host where selenium-rc is running
34 define ('SELENIUM_RC_HOST', getenv('SELENIUM_RC_HOST'));
35 define ('SELENIUM_RC_DIR', getenv('SELENIUM_RC_DIR'));
37 // The forge's hostname
38 define ('HOST', getenv('HOST'));
40 // Base URL where FusionForge is installed
43 // Database connection parameters.
44 define('DB_NAME', getenv('DB_NAME'));
45 define('DB_USER', getenv('DB_USER'));
46 define('DB_PASSWORD', '@@FFDB_PASS@@');
47 define('DB_INIT_CMD', "$FORGE_HOME/tests/func/db_reload.sh >>/var/log/db_reload_selenium.log 2>>/var/log/db_reload_selenium.errlog");
49 // this should be an existing user of the forge together with its password
50 // (the password should be different from 'myadmin')
51 define ('FORGE_ADMIN_USERNAME', '$FORGE_ADMIN_USERNAME');
52 define ('FORGE_ADMIN_PASSWORD', '$FORGE_ADMIN_PASSWORD');
53 define ('FORGE_OTHER_PASSWORD', '$FORGE_OTHER_PASSWORD');
55 // Where CLI is installed
56 define ('CLI_CMD', '$FORGE_HOME/acde/tools/gforge-cli/gforge.php');
58 // Where Java CLI is installed
59 define ('JAGOSI_CMD', '$FORGE_HOME/acde/tools/gforge-java-cli/');
61 // Enter true when file is configured.
62 define('CONFIGURED', getenv('CONFIGURED'));
65 // DON'T MODIFY BELOW THIS LINE UNLESS YOU KNOW WHAT YOU DO
68 // These are deduced from the previous definitions.
70 // URL to access the application
71 define ('URL', 'http://'.HOST.'/');
73 // WSDL of the forges SOAP API
74 define ('WSDL_URL', URL.'soap/index.php?wsdl');
78 echo "Starting Selenium"
80 PATH=/usr/lib/iceweasel:$PATH LANG=C java -jar $FORGE_HOME/tests/selenium-server.jar -singleWindow >/dev/null &
83 while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 ; do
87 if [ $i = $timeout ] ; then
88 echo "Selenium failed to start within $timeout seconds"
92 echo "Running PHPunit tests"
95 phpunit --verbose --log-junit $SELENIUM_RC_DIR/phpunit-selenium.xml $@ $testsuite || retcode=$?
98 killall -9 firefox-bin