[Fusionforge-commits] r14131 - in branches/Branch_5_1: . tests/config tests/func tests/func/Forums tests/func/PluginsSvnTracker tests/func/RBAC tests/func/Site tests/func/Soap tests/func/Surveys tests/func/Testing tests/scripts

Roland Mas lolando at fusionforge.org
Wed Aug 17 11:46:33 CEST 2011


Author: lolando
Date: 2011-08-17 11:46:32 +0200 (Wed, 17 Aug 2011)
New Revision: 14131

Modified:
   branches/Branch_5_1/
   branches/Branch_5_1/tests/config/default
   branches/Branch_5_1/tests/func/Forums/forumsTest.php
   branches/Branch_5_1/tests/func/PluginsSvnTracker/trackerTest.php
   branches/Branch_5_1/tests/func/RBAC/rbacTest.php
   branches/Branch_5_1/tests/func/Site/loginTest.php
   branches/Branch_5_1/tests/func/Site/projectsTest.php
   branches/Branch_5_1/tests/func/Site/troveTest.php
   branches/Branch_5_1/tests/func/Soap/checks.php
   branches/Branch_5_1/tests/func/Soap/login.php
   branches/Branch_5_1/tests/func/Soap/usergroup.php
   branches/Branch_5_1/tests/func/Surveys/surveysTest.php
   branches/Branch_5_1/tests/func/Testing/SeleniumGforge.php
   branches/Branch_5_1/tests/func/config.php.buildbot
   branches/Branch_5_1/tests/func/config.php.ffsandbox
   branches/Branch_5_1/tests/func/config.php.sample
   branches/Branch_5_1/tests/func/db_reload.php
   branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-deb.sh
   branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-rpm.sh
   branches/Branch_5_1/tests/scripts/phpunit.sh
Log:
Factor usernames and passwords in the testsuite

Modified: branches/Branch_5_1/tests/config/default
===================================================================
--- branches/Branch_5_1/tests/config/default	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/config/default	2011-08-17 09:46:32 UTC (rev 14131)
@@ -39,3 +39,6 @@
 DNSDOMAIN=local
 DEBMIRROR=http://cdn.debian.net/debian/
 DEBMIRRORSEC=http://security.debian.org/
+
+FORGE_ADMIN_PASSWORD=myadmin
+FORGE_OTHER_PASSWORD=tototata

Modified: branches/Branch_5_1/tests/func/Forums/forumsTest.php
===================================================================
--- branches/Branch_5_1/tests/func/Forums/forumsTest.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/Forums/forumsTest.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -91,7 +91,7 @@
 		$this->open( ROOT.'/forum/message.php?msg_id=6' );
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isLoginRequired());
-		$this->triggeredLogin('admin');
+		$this->triggeredLogin(FORGE_ADMIN_USERNAME);
 		$this->assertTrue($this->isTextPresent("Welcome to developers"));
 	}
 
@@ -114,7 +114,7 @@
 		$this->click("link=[ reply ]");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isLoginRequired());
-		$this->triggeredLogin('admin');
+		$this->triggeredLogin(FORGE_ADMIN_USERNAME);
 		$this->type("body", "Here is my 19823 reply");
 		$this->clickAndWait("submit");
 		$this->assertTextPresent("Message Posted Successfully");

Modified: branches/Branch_5_1/tests/func/PluginsSvnTracker/trackerTest.php
===================================================================
--- branches/Branch_5_1/tests/func/PluginsSvnTracker/trackerTest.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/PluginsSvnTracker/trackerTest.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -56,7 +56,7 @@
 		$this->populateStandardTemplate('trackers');
 		$this->initSvn();
 		$this->activatePlugin('svntracker');
-		$this->login('admin');
+		$this->login(FORGE_ADMIN_USERNAME);
 
 		$this->open(ROOT);
 		$this->clickAndWait("link=ProjectA");
@@ -87,7 +87,7 @@
 		system("rm -fr /tmp/svn.test");
 		mkdir("/tmp/svn.test");
 
-		system("cd /tmp/svn.test; $svn --username admin --password myadmin co $url >/dev/null", $ret);
+		system("cd /tmp/svn.test; $svn --username ".FORGE_ADMIN_USERNAME." --password ".FORGE_ADMIN_PASSWORD." co $url >/dev/null", $ret);
 		$this->assertEquals($ret, 0);
 
 		system("echo 'this is a simple text' > /tmp/svn.test/projecta/mytext.txt");
@@ -95,12 +95,12 @@
 		system("cd /tmp/svn.test/projecta; $svn add mytext.txt >/dev/null", $ret);
 		$this->assertEquals($ret, 0);
 		
-		system("cd /tmp/svn.test/projecta; $svn --username admin --password myadmin ci -m 'Fixed [#1] added mytext' >/dev/null", $ret);
+		system("cd /tmp/svn.test/projecta; $svn --username ".FORGE_ADMIN_USERNAME." --password ".FORGE_ADMIN_PASSWORD." ci -m 'Fixed [#1] added mytext' >/dev/null", $ret);
 		$this->assertEquals($ret, 0);
 		
 		system("echo 'with a new line' >> /tmp/svn.test/projecta/mytext.txt");
 
-		system("cd /tmp/svn.test/projecta; $svn --username admin --password myadmin ci -m 'Improved [#1] updated mytext' >/dev/null", $ret);
+		system("cd /tmp/svn.test/projecta; $svn --username ".FORGE_ADMIN_USERNAME." --password ".FORGE_ADMIN_PASSWORD." ci -m 'Improved [#1] updated mytext' >/dev/null", $ret);
 		$this->assertEquals($ret, 0);
 
 		system("rm -fr /tmp/svn.test");

Modified: branches/Branch_5_1/tests/func/RBAC/rbacTest.php
===================================================================
--- branches/Branch_5_1/tests/func/RBAC/rbacTest.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/RBAC/rbacTest.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -51,7 +51,7 @@
 
 	function testGlobalRolesAndPermissions()
 	{
-		$this->login("admin");
+		$this->login(FORGE_ADMIN_USERNAME);
 
 		$this->click("link=Site Admin");
 		$this->waitForPageToLoad("30000");
@@ -216,7 +216,7 @@
 
 		// Non-regression test for Adacore ticket K802-005
 		// (Deletion of global roles)
-		$this->switchUser("admin");
+		$this->switchUser(FORGE_ADMIN_USERNAME);
 		$this->click("link=Site Admin");
 		$this->waitForPageToLoad("30000");
 		$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='role_name']", "Temporary role") ;
@@ -532,7 +532,7 @@
 
 		// Non-regression test for Adacore ticket K802-005
 		// (Deletion of project-wide roles)
-		$this->switchUser("admin");
+		$this->switchUser(FORGE_ADMIN_USERNAME);
 		$this->gotoProject ("MetaProject") ;
 		$this->click("link=Admin");
 		$this->waitForPageToLoad("30000");

Modified: branches/Branch_5_1/tests/func/Site/loginTest.php
===================================================================
--- branches/Branch_5_1/tests/func/Site/loginTest.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/Site/loginTest.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -65,8 +65,8 @@
 		$this->assertRegExp($url_regexp, $location, 
 				    "You may need to set 'HOST' setting in test suite's config file to something compatible with 'web_host' defined in ini file");
 
-		$this->type("form_loginname", "admin");
-		$this->type("form_pw", "myadmin");
+		$this->type("form_loginname", FORGE_ADMIN_USERNAME);
+		$this->type("form_pw", FORGE_ADMIN_PASSWORD);
 		$this->click("login");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("Forge Admin"));
@@ -79,7 +79,7 @@
 		$this->open( ROOT );
 		$this->click("link=Log In");
 		$this->waitForPageToLoad("30000");
-		$this->type("form_loginname", "admin");
+		$this->type("form_loginname", FORGE_ADMIN_USERNAME);
 		$this->type("form_pw", "");
 		$this->click("login");
 		$this->waitForPageToLoad("30000");
@@ -91,7 +91,7 @@
 		$this->open( ROOT );
 		$this->click("link=Log In");
 		$this->waitForPageToLoad("30000");
-		$this->type("form_loginname", "admin");
+		$this->type("form_loginname", FORGE_ADMIN_USERNAME);
 		$this->type("form_pw", "awrongpassword");
 		$this->click("login");
 		$this->waitForPageToLoad("30000");
@@ -100,7 +100,7 @@
 		$this->assertTrue($this->isTextPresent("Log In"));
 		
 		// Test factored code.
-		$this->login('admin');
+		$this->login(FORGE_ADMIN_USERNAME);
 		$this->assertTrue($this->isTextPresent("Forge Admin"));
 		$this->assertTrue($this->isTextPresent("Log Out"));
 
@@ -108,16 +108,16 @@
 		$this->clickAndWait("link=Display Full User List/Edit Users");
 		$this->click("//table/tbody/tr/td/a[contains(@href,'useredit.php') and contains(.,'(admin)')]/../..//a[contains(@href, 'passedit.php?user_id=')]");
 		$this->waitForPageToLoad("30000");
-		$this->type("passwd","tototata");
-		$this->type("passwd2","tototata");
+		$this->type("passwd", FORGE_OTHER_PASSWORD);
+		$this->type("passwd2", FORGE_OTHER_PASSWORD);
 		$this->clickAndWait("submit");
 		$this->logout();
 
 		$this->open( ROOT );
 		$this->click("link=Log In");
 		$this->waitForPageToLoad("30000");
-		$this->type("form_loginname", "admin");
-		$this->type("form_pw", "tototata");
+		$this->type("form_loginname", FORGE_ADMIN_USERNAME);
+		$this->type("form_pw", FORGE_OTHER_PASSWORD);
 		$this->click("login");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("Forge Admin"));

Modified: branches/Branch_5_1/tests/func/Site/projectsTest.php
===================================================================
--- branches/Branch_5_1/tests/func/Site/projectsTest.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/Site/projectsTest.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -52,7 +52,7 @@
 	function testSimpleCreate()
 	{
 		// "Manual" procedure
-		$this->login ('admin');
+		$this->login (FORGE_ADMIN_USERNAME);
 		$this->click("link=My Page");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Register Project");
@@ -84,7 +84,7 @@
 
 	function testCharsCreateTestCase()
 	{
-		$this->login('admin');
+		$this->login(FORGE_ADMIN_USERNAME);
 		$this->click("link=My Page");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Register Project");
@@ -225,7 +225,7 @@
 	// Test removal of project.
 	function testRemoveProject()
 	{
-		$this->login('admin');
+		$this->login(FORGE_ADMIN_USERNAME);
 
 		// Create project as a different user
 		// Non-regression test for Adacore ticket K720-005
@@ -242,7 +242,7 @@
 		$this->assertTrue($this->isTextPresent("toto Lastname"));
 
 		$this->registerProject('testal1','toto');
-		$this->approveProject('testal1','admin');
+		$this->approveProject('testal1',FORGE_ADMIN_USERNAME);
 
 		$this->click("link=Site Admin");
 		$this->waitForPageToLoad("30000");

Modified: branches/Branch_5_1/tests/func/Site/troveTest.php
===================================================================
--- branches/Branch_5_1/tests/func/Site/troveTest.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/Site/troveTest.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -26,7 +26,7 @@
 	function testTroveAdmin()
 	{
 		$this->open( ROOT );
-		$this->login('admin');
+		$this->login(FORGE_ADMIN_USERNAME);
 		$this->click("link=Site Admin");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Display Trove Map");

Modified: branches/Branch_5_1/tests/func/Soap/checks.php
===================================================================
--- branches/Branch_5_1/tests/func/Soap/checks.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/Soap/checks.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -41,7 +41,7 @@
   function testExistingUserPasswordConfigured()
   {
     
-    $this->assertNotEquals('xxxxx', PASSWD_OF_EXISTING_USER);
+    $this->assertNotEquals('xxxxx', FORGE_ADMIN_PASSWORD);
     
   }
   

Modified: branches/Branch_5_1/tests/func/Soap/login.php
===================================================================
--- branches/Branch_5_1/tests/func/Soap/login.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/Soap/login.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -156,7 +156,7 @@
 	{
 	  $this->assertNotNull($this->soapclient);
 
-	  $userid = EXISTING_USER;
+	  $userid = FORGE_ADMIN_USERNAME;
 	  
 	  try {
 	    $response = $this->soapclient->login($userid, 'xxxxxx');
@@ -177,8 +177,8 @@
 	 */
 	function testLoginSuccesful()
 	{
-	  $userid = EXISTING_USER;
-	  $passwd = PASSWD_OF_EXISTING_USER;
+	  $userid = FORGE_ADMIN_USERNAME;
+	  $passwd = FORGE_ADMIN_PASSWORD;
 
 	  $response = $this->login($userid, $passwd);
 

Modified: branches/Branch_5_1/tests/func/Soap/usergroup.php
===================================================================
--- branches/Branch_5_1/tests/func/Soap/usergroup.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/Soap/usergroup.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -77,8 +77,8 @@
 
 	function testLoginSuccesful()
 	{
-		$userid = EXISTING_USER;
-		$passwd = PASSWD_OF_EXISTING_USER;
+		$userid = FORGE_ADMIN_USERNAME;
+		$passwd = FORGE_ADMIN_PASSWORD;
 
 		$response = $this->login($userid, $passwd);
 
@@ -122,7 +122,7 @@
 	function testGetGroupsByNameEmpty()
 	{
 
-		$this->login(EXISTING_USER, PASSWD_OF_EXISTING_USER);
+		$this->login(FORGE_ADMIN_USERNAME, FORGE_ADMIN_PASSWORD);
 
 		$this->assertNotNull($this->session);
 
@@ -147,7 +147,7 @@
 	 */
 	function testGetGroupsByName()
 	{
-		$this->login(EXISTING_USER, PASSWD_OF_EXISTING_USER);
+		$this->login(FORGE_ADMIN_USERNAME, FORGE_ADMIN_PASSWORD);
 
 		$this->assertNotNull($this->session);
 
@@ -223,7 +223,7 @@
 	// function testGetPublicProjectNamesLoggedIn()
 	// {
 
-	// 	$this->login(EXISTING_USER, PASSWD_OF_EXISTING_USER);
+	// 	$this->login(FORGE_ADMIN_USERNAME, FORGE_ADMIN_PASSWORD);
 	// 	$this->assertNotNull($this->loggedIn);
 	// 	$this->assertNotNull($this->session);
 
@@ -288,7 +288,7 @@
 	 */
 	function testGetUsersByNameEmpty()
 	{
-		$this->login(EXISTING_USER, PASSWD_OF_EXISTING_USER);
+		$this->login(FORGE_ADMIN_USERNAME, FORGE_ADMIN_PASSWORD);
 
 		$this->assertNotNull($this->session);
 
@@ -313,7 +313,7 @@
 	 */
 	function testGetUsersByNameBug63()
 	{
-	  $this->login(EXISTING_USER, PASSWD_OF_EXISTING_USER);
+	  $this->login(FORGE_ADMIN_USERNAME, FORGE_ADMIN_PASSWORD);
 
 	  $this->assertNotNull($this->session);
 
@@ -321,7 +321,7 @@
 	  // server works allow to trick it in returning several
 	  // values at a time : this one may be fixed some day and we'd then
 	  $users = array('admin", "None' => array( 'count' => 2, 
-						   'user_names' => array('admin', 'None')));
+						   'user_names' => array(FORGE_ADMIN_USERNAME, 'None')));
 
 	  foreach (array_keys($users) as $user_name) {
 	    $response = $this->soapclient->getUsersByName($this->session,array($user_name));
@@ -340,13 +340,12 @@
 	 */
 	function testGetUsersByName()
 	{
-		$this->login(EXISTING_USER, PASSWD_OF_EXISTING_USER);
+		$this->login(FORGE_ADMIN_USERNAME, FORGE_ADMIN_PASSWORD);
 
 		$this->assertNotNull($this->session);
 
-		$users = array('admin'=>'admin',
-			       'None'=>'None', 
-			       EXISTING_USER => EXISTING_USER);
+		$users = array('None'=>'None', 
+			       FORGE_ADMIN_USERNAME => FORGE_ADMIN_USERNAME);
 
 		foreach (array_keys($users) as $user_name) {
 			//	    print_r($user_name);
@@ -378,7 +377,7 @@
 				$this->assertEquals(0,count($response));
 			}
 
-			if ($user->user_name == 'admin') {
+			if ($user->user_name == FORGE_ADMIN_USERNAME) {
 
 				$adminGroups = array('template','stats','peerrating','siteadmin','newsadmin');
 

Modified: branches/Branch_5_1/tests/func/Surveys/surveysTest.php
===================================================================
--- branches/Branch_5_1/tests/func/Surveys/surveysTest.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/Surveys/surveysTest.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -144,7 +144,7 @@
 		$this->assertTextPresent("My first survey: L'année dernière à Noël, 3 < 4, 中国 \" <em>, père & fils");
 
 //		// Set survey to private
-//		$this->login("admin");
+//		$this->login(FORGE_ADMIN_USERNAME);
 //
 //		$this->open("/survey/?group_id=6");
 //		$this->clickAndWait("link=Surveys");

Modified: branches/Branch_5_1/tests/func/Testing/SeleniumGforge.php
===================================================================
--- branches/Branch_5_1/tests/func/Testing/SeleniumGforge.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/Testing/SeleniumGforge.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -94,9 +94,9 @@
 		} elseif (!is_array($what)) {
 			$what = array($what) ;
 		}
-		$this->switchUser ('admin') ;
+		$this->switchUser (FORGE_ADMIN_USERNAME) ;
 
-		$this->approveProject ('Template', 'admin');
+		$this->approveProject ('Template', FORGE_ADMIN_USERNAME);
 		$this->open( ROOT . '/projects/template') ;
 		$this->waitForPageToLoad("30000");
 
@@ -227,7 +227,7 @@
 		}
 	}
 
-	protected function initSvn($project='ProjectA', $user='admin')
+	protected function initSvn($project='ProjectA', $user=FORGE_ADMIN_USERNAME)
 	{
 		// Remove svnroot directory before creating the project.
 		$repo = '/var/lib/gforge/chroot/scmrepos/svn/'.strtolower($project);
@@ -253,10 +253,10 @@
 
 	protected function triggeredLogin($username)
 	{
-		if ($username == 'admin') {
-			$password = 'myadmin';
+		if ($username == FORGE_ADMIN_USERNAME) {
+			$password = FORGE_ADMIN_PASSWORD;
 		} else {
-			$password = 'password';
+			$password = FORGE_OTHER_PASSWORD;
 		}
 		
 		$this->type("form_loginname", $username);
@@ -333,12 +333,12 @@
 	protected function createProject ($name) {
 		$unix_name = strtolower($name);
 
-		$this->switchUser ('admin') ;
+		$this->switchUser (FORGE_ADMIN_USERNAME) ;
 		
 		// Create a simple project.
 		if ((!defined('PROJECTA')) || ($unix_name != "projecta")) {
-			$this->registerProject ($name, 'admin') ;
-			$this->approveProject ($name, 'admin') ;
+			$this->registerProject ($name, FORGE_ADMIN_USERNAME) ;
+			$this->approveProject ($name, FORGE_ADMIN_USERNAME) ;
 		}
 	}
 	
@@ -353,8 +353,8 @@
 		$this->clickAndWait("link=Site Admin");
 		$this->clickAndWait("link=Register a New User");
 		$this->type("unix_name", $login);
-		$this->type("password1", "password");
-		$this->type("password2", "password");
+		$this->type("password1", FORGE_OTHER_PASSWORD);
+		$this->type("password2", FORGE_OTHER_PASSWORD);
 		$this->type("firstname", $login);
 		$this->type("lastname", "Lastname");
 		$this->type("email", $login."@debug.log");
@@ -366,7 +366,7 @@
 	}
 
 	protected function activatePlugin($pluginName) {
-		$this->switchUser('admin');
+		$this->switchUser(FORGE_ADMIN_USERNAME);
 		$this->open( ROOT . '/admin/pluginman.php?update='.$pluginName.'&action=deactivate');
 		$this->waitForPageToLoad("30000");
 		$this->open( ROOT . '/admin/pluginman.php?update='.$pluginName.'&action=activate');

Modified: branches/Branch_5_1/tests/func/config.php.buildbot
===================================================================
--- branches/Branch_5_1/tests/func/config.php.buildbot	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/config.php.buildbot	2011-08-17 09:46:32 UTC (rev 14131)
@@ -27,9 +27,9 @@
 define('DB_INIT_CMD', "ssh root@".HOST." '/root/tests/func/db_reload.sh ".DB_NAME." >/dev/null;'");
 
 // this should be an existing user of the forge together with its password
-// (the password should be different from 'myadmin')
-define ('EXISTING_USER', 'admin');
-define ('PASSWD_OF_EXISTING_USER', 'myadmin');
+define ('FORGE_ADMIN_USERNAME', 'admin');
+define ('FORGE_ADMIN_PASSWORD', 'myadmin');
+define ('FORGE_OTHER_PASSWORD', 'myotherpass');
 
 // Where CLI is installed
 define ('CLI_CMD', '/opt/gforge/acde/tools/gforge-cli/gforge.php');

Modified: branches/Branch_5_1/tests/func/config.php.ffsandbox
===================================================================
--- branches/Branch_5_1/tests/func/config.php.ffsandbox	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/config.php.ffsandbox	2011-08-17 09:46:32 UTC (rev 14131)
@@ -25,9 +25,9 @@
 define('DB_INIT_CMD', "/root/scripts/reload-db.sh > /dev/null 2> /dev/null");
 
 // this should be an existing user of the forge together with its password
-// (the password should be different from 'myadmin')
-define ('EXISTING_USER', 'admin');
-define ('PASSWD_OF_EXISTING_USER', 'myadmin');
+define ('FORGE_ADMIN_USERNAME', 'admin');
+define ('FORGE_ADMIN_PASSWORD', 'myadmin');
+define ('FORGE_OTHER_PASSWORD', 'myotherpass');
 
 // Where CLI is installed
 define ('CLI_CMD', '/opt/gforge/acde/tools/gforge-cli/gforge.php');

Modified: branches/Branch_5_1/tests/func/config.php.sample
===================================================================
--- branches/Branch_5_1/tests/func/config.php.sample	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/config.php.sample	2011-08-17 09:46:32 UTC (rev 14131)
@@ -27,9 +27,9 @@
 define('DB_INIT_CMD', 'php '.dirname(__FILE__).'/db_reload.php');
 
 // this should be an existing user of the forge together with its password
-// (the password should be different from 'xxxxxx')
-define ('EXISTING_USER', 'admin');
-define ('PASSWD_OF_EXISTING_USER', 'xxxxx');
+define ('FORGE_ADMIN_USERNAME', 'admin');
+define ('FORGE_ADMIN_PASSWORD', 'xxxxx');
+define ('FORGE_OTHER_PASSWORD', 'yyyyy');
 
 // Enter true when file is configured.
 define('CONFIGURED', false);

Modified: branches/Branch_5_1/tests/func/db_reload.php
===================================================================
--- branches/Branch_5_1/tests/func/db_reload.php	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/func/db_reload.php	2011-08-17 09:46:32 UTC (rev 14131)
@@ -87,9 +87,6 @@
 system("psql -q -U".DB_USER." ".DB_NAME." -f $forge_root/db/gforge.sql >> /var/log/fusionforge-init.log 2>&1");
 system("php $forge_root/db/upgrade-db.php >> /var/log/gforge-upgrade-db.log 2>&1");
 
-$adminPassword = 'myadmin';
-$adminEmail = 'nobody at nowhere.com';
-
 $session_hash = '000TESTSUITE000';
 
 require_once $forge_root.'/www/env.inc.php';
@@ -106,9 +103,10 @@
 // Create the initial admin account and activate it directly.
 //
 $user = new GFUser();
-$user_id = $user->create('admin', 'Forge', 'Admin', $adminPassword, $adminPassword,
-	$adminEmail, 1, 1, 1,'GMT','',0,1,'', '','','','','','US',false);
 
+$user_id = $user->create(FORGE_ADMIN_USERNAME, 'Forge', 'Admin', FORGE_ADMIN_PASSWORD, FORGE_ADMIN_PASSWORD, 
+	'nobody at nowhere.com', 1, 1, 1,'GMT','',0,1,'', '','','','','','US',false);
+
 if (!$user_id) {
 	print "ERROR: Creating user: ".$user->getErrorMessage().':'.db_error()."\n";
 	exit(1);

Modified: branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-deb.sh
===================================================================
--- branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-deb.sh	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-deb.sh	2011-08-17 09:46:32 UTC (rev 14131)
@@ -110,7 +110,7 @@
 ssh root@$HOST "apt-get update"
 ssh root@$HOST "UCF_FORCE_CONFFNEW=yes DEBIAN_FRONTEND=noninteractive LANG=C apt-get -y --force-yes install postgresql-contrib fusionforge-full"
 echo "Set forge admin password"
-ssh root@$HOST "/usr/share/gforge/bin/forge_set_password admin myadmin"
+ssh root@$HOST "/usr/share/gforge/bin/forge_set_password admin $ADMIN_PASSWORD"
 #ssh root@$HOST "LANG=C a2dissite default ; LANG=C invoke-rc.d apache2 reload ; LANG=C touch /tmp/fusionforge-use-pfo-rbac"
 ssh root@$HOST "(echo [core];echo use_ssl=no) > /etc/gforge/config.ini.d/zzz-builbot.ini"
 #ssh root@$HOST "su - postgres -c \"pg_dump -Fc $DB_NAME\" > /root/dump"

Modified: branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-rpm.sh
===================================================================
--- branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-rpm.sh	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/scripts/fusionforge-build-and-test-rpm.sh	2011-08-17 09:46:32 UTC (rev 14131)
@@ -107,7 +107,7 @@
 
 sleep 5
 [ ! -e "/tmp/timedhosts.txt" ] || scp -p /tmp/timedhosts.txt root@$HOST:/var/cache/yum/timedhosts.txt
-ssh root@$HOST "FFORGE_DB=$DB_NAME FFORGE_USER=gforge FFORGE_ADMIN_USER=admin FFORGE_ADMIN_PASSWORD=myadmin export FFORGE_DB FFORGE_USER FFORGE_ADMIN_USER FFORGE_ADMIN_PASSWORD; yum install -y --skip-broken fusionforge fusionforge-plugin-scmsvn fusionforge-plugin-online_help fusionforge-plugin-extratabs fusionforge-plugin-ldapextauth fusionforge-plugin-scmgit fusionforge-plugin-blocks"
+ssh root@$HOST "FFORGE_DB=$DB_NAME FFORGE_USER=gforge FFORGE_ADMIN_USER=$FORGE_ADMIN_USERNAME FFORGE_ADMIN_PASSWORD=$FORGE_ADMIN_PASSWORD export FFORGE_DB FFORGE_USER FFORGE_ADMIN_USER FFORGE_ADMIN_PASSWORD; yum install -y --skip-broken fusionforge fusionforge-plugin-scmsvn fusionforge-plugin-online_help fusionforge-plugin-extratabs fusionforge-plugin-ldapextauth fusionforge-plugin-scmgit fusionforge-plugin-blocks"
 scp -p root@$HOST:/var/cache/yum/timedhosts.txt /tmp/timedhosts.txt || true
 ssh root@$HOST '(echo [core];echo use_ssl=no) > /etc/gforge/config.ini.d/zzz-builbot.ini'
 #ssh root@$HOST "cd /root/tests/func; CONFIGURED=true CONFIG_PHP=config.php.buildbot DB_NAME=$DB_NAME php db_reload.php"

Modified: branches/Branch_5_1/tests/scripts/phpunit.sh
===================================================================
--- branches/Branch_5_1/tests/scripts/phpunit.sh	2011-08-17 09:35:10 UTC (rev 14130)
+++ branches/Branch_5_1/tests/scripts/phpunit.sh	2011-08-17 09:46:32 UTC (rev 14131)
@@ -16,7 +16,8 @@
 fi
 
 WORKSPACE=/root
-[ ! -f $WORKSPACE/config/phpunit ] || . $WORKSPACE/config/phpunit 
+[ ! -f $WORKSPACE/config/default ] || . $WORKSPACE/config/default
+[ ! -f $WORKSPACE/config/phpunit ] || . $WORKSPACE/config/phpunit
 SELENIUM_RC_DIR=/var/log
 SELENIUM_RC_URL=${HUDSON_URL}job/${JOB_NAME}/ws/reports
 SELENIUM_RC_HOST=`hostname -f`
@@ -44,8 +45,9 @@
 
 // this should be an existing user of the forge together with its password
 // (the password should be different from 'myadmin')
-define ('EXISTING_USER', 'admin');
-define ('PASSWD_OF_EXISTING_USER', 'myadmin');
+define ('FORGE_ADMIN_USERNAME', 'admin');
+define ('FORGE_ADMIN_PASSWORD', $ADMIN_PASSWORD);
+define ('FORGE_OTHER_PASSWORD', $OTHER_PASSWORD);
 
 // Where CLI is installed
 define ('CLI_CMD', '/opt/gforge/acde/tools/gforge-cli/gforge.php');




More information about the Fusionforge-commits mailing list