[Fusionforge-commits] r10408 - trunk/tests/func

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Fri Sep 3 23:50:55 CEST 2010


Author: aljeux
Date: 2010-09-03 23:50:55 +0200 (Fri, 03 Sep 2010)
New Revision: 10408

Modified:
   trunk/tests/func/db_reload.php
Log:
Test relative path for db_reload script

Modified: trunk/tests/func/db_reload.php
===================================================================
--- trunk/tests/func/db_reload.php	2010-09-03 12:09:40 UTC (rev 10407)
+++ trunk/tests/func/db_reload.php	2010-09-03 21:50:55 UTC (rev 10408)
@@ -66,12 +66,14 @@
 	$opt_restart = false;
 }
 
+$forge_root = dirname(dirname(dirname(__FILE__))).'/src';
+
 if ( DB_TYPE == 'mysql') {
 	// Reload a fresh database before running this test suite.
 	system("mysqladmin -f -u".DB_USER." -p".DB_PASSWORD." drop ".DB_NAME." &>/dev/null");
 	system("mysqladmin -u".DB_USER." -p".DB_PASSWORD." create ".DB_NAME);
-	system("mysql -u".DB_USER." -p".DB_PASSWORD." ".DB_NAME." < ".dirname(dirname(__FILE__))."/src/db/gforge-struct-mysql.sql");
-	system("mysql -u".DB_USER." -p".DB_PASSWORD." ".DB_NAME." < ".dirname(dirname(__FILE__))."/src/db/gforge-data-mysql.sql");
+	system("mysql -u".DB_USER." -p".DB_PASSWORD." ".DB_NAME." < $forge_root/db/gforge-struct-mysql.sql");
+	system("mysql -u".DB_USER." -p".DB_PASSWORD." ".DB_NAME." < $forge_root/db/gforge-data-mysql.sql");
 } elseif ( DB_TYPE == 'pgsql') {
 	if (!function_exists('pg_connect')) {
 		print "ERROR: Missing pgsql on PHP to run tests on PostgreSQL.\n";
@@ -84,8 +86,8 @@
 	system("service postgresql restart 2>&1 >/dev/null");
 	system("su - postgres -c 'dropdb -q ".DB_NAME."'");
 	system("su - postgres -c 'createdb -q --encoding UNICODE ".DB_NAME."'");
-	system("psql -q -U".DB_USER." ".DB_NAME." -f /opt/gforge/db/gforge.sql >> /var/log/gforge-import.log 2>&1");
-	system("php /opt/gforge/db/upgrade-db.php >> /var/log/gforge-upgrade-db.log 2>&1");
+	system("psql -q -U".DB_USER." ".DB_NAME." -f $forge_root/db/gforge.sql >> /var/log/gforge-import.log 2>&1");
+	system("php $forge_root/db/upgrade-db.php >> /var/log/gforge-upgrade-db.log 2>&1");
 } else {
 	print "Unsupported database type: ".DB_TYPE. "\n";
 	exit;




More information about the Fusionforge-commits mailing list