You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(66) |
Feb
(7) |
Mar
(9) |
Apr
(14) |
May
|
Jun
(14) |
Jul
(18) |
Aug
(1) |
Sep
|
Oct
|
Nov
(4) |
Dec
|
2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sebastien D. <sde...@us...> - 2005-01-27 09:06:51
|
Update of /cvsroot/tslogparser/tslogparser/package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13752/package Modified Files: tslogparser.spec Log Message: fix in %pre section Index: tslogparser.spec =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/package/tslogparser.spec,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tslogparser.spec 26 Jan 2005 17:49:09 -0000 1.6 +++ tslogparser.spec 27 Jan 2005 09:06:43 -0000 1.7 @@ -8,7 +8,7 @@ %define name tslogparser %define version 0.5 -%define release 1 +%define release 2 %define filename tslogparser-v05 %define tslp_user tslogparser @@ -63,7 +63,7 @@ # Add tslogparser user & group %pre -finger %{tslp_user}|grep "Login.*%{tslp_ser}" > /dev/null +finger %{tslp_user}|grep "Login.*%{tslp_user}" > /dev/null if [ $? -ne 0 ]; then /usr/sbin/groupadd %{tslp_group}; |
From: Sebastien D. <sde...@us...> - 2005-01-26 17:52:59
|
Update of /cvsroot/tslogparser/tslogparser/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv554/admin Added Files: tar.inc.php Log Message: New method for testsuite uploading --- NEW FILE: tar.inc.php --- <?php /* This file is copied from the PEAR package, so PEAR installation is not required on server. We try at first to include the real PEAR file, and if this fails we then define our version. */ $ok= @include("Archive/Tar.php"); if (!$ok) { /* We did not find the file, so we define the class here */ /* The rest of this file is copied from the PEAR package */ /* PEAR.php file content */ // // +----------------------------------------------------------------------+ [...2556 lines suppressed...] { if (OS_WINDOWS) { // ----- Look for potential disk letter if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) { $p_path = substr($p_path, $v_position+1); } // ----- Change potential windows directory separator if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) { $p_path = strtr($p_path, '\\', '/'); } } return $p_path; } // }}} } /* Done */ } ?> |
From: Sebastien D. <sde...@us...> - 2005-01-26 17:49:31
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32037 Modified Files: FAQ HISTORY INSTALL README USAGE Log Message: New method for testsuite uploading Index: USAGE =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/USAGE,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- USAGE 12 Jan 2005 14:00:00 -0000 1.1 +++ USAGE 26 Jan 2005 17:48:51 -0000 1.2 @@ -23,9 +23,16 @@ -> In case you're not using tslogparser on localhost, you need to upload the testsuite files on the server filesystem. - -We'll suppose that the server can access your testsuite files from /home/test/posixtestsuite-1.5.0 -WARNING: archived testsuite is not supported yet; you need a plain testsuite package. + +The tool requires the test suite to be of a specific format. We will assume +that you have a 'posixtestsuite-1.5.0' directory containing the testsuite. +(*) Rename the testsuite directory to 'ts': + mv posixtestsuite-1.5.0 ts +(*) tar and gzip the directory. With GNU tar this is done with: + tar zcf ts.tar.gz ts/ + +Future releases may handle variable directory names -- but yet the 'ts' directory name +is mandatory. -> Point your browser to the admin interface: @@ -50,8 +57,8 @@ (eg. "Release 1.5.0") New release description: You can give detailed information on the testsuite, such as the date, the origin, patchs, etc... - Path to new release : Enter the path on the filesystem to the testsuite files - (eg. "/home/test/posixtestsuite-1.5.0") + New release archive : Browse to your testsuite archive in the appropriate format. + (eg. "~/ts.tar.gz") -> Click "Send" when you're ready. The tool will parse the testsuite and tell you the errors/warnings/informations on the Index: README =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- README 10 Jan 2005 18:09:51 -0000 1.2 +++ README 26 Jan 2005 17:48:51 -0000 1.3 @@ -3,6 +3,7 @@ (*) Documentation: README : (this file) Contains the description of the other files. LICENCE: Licence text for this project (GPL). +USAGE : User's guide. (*) Installation: INSTALL : Instructions to set up the system on a new host. @@ -17,6 +18,7 @@ admin/index.php : Administration interface. admin/modules.inc.php : Wrapper class to plug-ins modules. admin/modules/*.mod.php : Plug-ins files (test-suite dependent stuff). +ts/ : Temporary files directory for testsuites parsing. (*) Generic Results browsing files: index.php : Redirector to run-browse.php @@ -27,4 +29,5 @@ (*) Diverse: functions.inc.php: Definition of widely used routines. +admin/tar.inc.php: Support files for tar files parsing. Index: FAQ =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/FAQ,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FAQ 26 Jan 2005 01:26:44 -0000 1.2 +++ FAQ 26 Jan 2005 17:48:51 -0000 1.3 @@ -7,3 +7,6 @@ This defines a subset of testcases. For Open POSIX Test Suite, for example, such a domain could be 'timers' routines, or 'mutex', or 'syncronization', ... +(3) I can't get the testsuite to be parsed! +The testsuite archive must be in a specific format described into USAGE file. + Index: INSTALL =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/INSTALL,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- INSTALL 21 Jan 2005 15:00:06 -0000 1.7 +++ INSTALL 26 Jan 2005 17:48:51 -0000 1.8 @@ -22,6 +22,7 @@ mkdir tslogparser/admin mkdir tslogparser/admin/modules mkdir tslogparser/db + mkdir tslogparser/ts cd tar zxvf tslogparser*.tar.gz @@ -42,7 +43,8 @@ Open http://localhost/tslogparser/FAQ in a web browser. You may need extra set-up to allow for PHP files execution. Check your webserver configuration file. - + You also need the web server user be able to write into tslogparser/ts dir. + (example: chmod 755 tslogparser/ts) ------------------ STEP 2: Set up the database server. ------------------------ Index: HISTORY =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/HISTORY,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- HISTORY 21 Jan 2005 15:15:27 -0000 1.16 +++ HISTORY 26 Jan 2005 17:48:51 -0000 1.17 @@ -1,3 +1,15 @@ +2005-01-26: +- New directory: ts + New file: admin/tar.inc.php + Modified file: admin/index.php + doc +- Changed the upload testsuite feature to support HTTP upload of tar.gz + archive. The format is not very souple yet: + -> the archive must be tar gzip'd. + -> it must expand into a 'ts' named directory. + Moreover, in case of concurrent access, problems can occur + (must find a better random name generator for the directory). +- Modified the tslogparser.spec file to install a writtable 'ts' directory. + 2005-01-21: tag v04b - Fix in link from database.inc.php |
From: Sebastien D. <sde...@us...> - 2005-01-26 17:49:30
|
Update of /cvsroot/tslogparser/tslogparser/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32037/admin Modified Files: index.php Log Message: New method for testsuite uploading Index: index.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/index.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- index.php 7 Jan 2005 14:28:34 -0000 1.7 +++ index.php 26 Jan 2005 17:48:52 -0000 1.8 @@ -53,6 +53,7 @@ /* We'll need functions defined in other files */ require($root."database.inc.php"); require($root."functions.inc.php"); +require($root."admin/tar.inc.php"); /* Handle tar files */ /* We'll need the database connexion */ db_init(); @@ -66,6 +67,7 @@ $modules=$tslp->list_modules(); +/* We copy some variables from the POST array to the GET array */ if (isset($_POST["action"])) { $_GET["action"]=$_POST["action"]; @@ -79,6 +81,13 @@ $_GET["run_name"] = $_POST["run_name"]; if (isset($_POST["run_descr"])) $_GET["run_descr"] = $_POST["run_descr"]; + + if (isset($_POST["add_ts"])) + $_GET["add_ts"] = $_POST["add_ts"]; + if (isset($_POST["ts_name"])) + $_GET["ts_name"] = $_POST["ts_name"]; + if (isset($_POST["ts_descr"])) + $_GET["ts_descr"] = $_POST["ts_descr"]; } /* Parse the GET parameters if any */ @@ -143,18 +152,17 @@ *****************************/ if (isset($_GET["add_ts"])) { - /* Check Step 3 parameters and eventually fall back to step 2 */ if (!isset($_GET["ts_name"])) $_GET["ts_name"]=""; if (!isset($_GET["ts_descr"])) $_GET["ts_descr"]=""; - if (!isset($_GET["ts_root"])) - $_GET["ts_root"]=""; +// if (!isset($_GET["ts_root"])) +// $_GET["ts_root"]=""; if (($_GET["action"] == 2) - && ( !trim($_GET["ts_name"]) - || !trim($_GET["ts_root"]))) + && ( !trim($_GET["ts_name"]) + || !isset($_FILES['tsarchive']))) { echo "<p>Please fill all <b>(*) fields.</b></p>\n"; $_GET["action"] = 1; @@ -162,22 +170,76 @@ if ($_GET["action"] == 2) { + /* Check the uploaded file type */ + if (!isset($_FILES['tsarchive'])) + { + echo "<b>Invalid parameters</b>\n"; + db_fini(); + require($root."footer.inc.php"); + die(); + } + if (( $_FILES['tsarchive']['type'] != "application/x-gzip-compressed") + && ($_FILES['tsarchive']['type'] != "application/x-gzip")) + { + echo "<b>You have to supply the testsuite in a tar gzip'd format.</b>\n"; + db_fini(); + require($root."footer.inc.php"); + die(); + } + + /* Try expanding the archive */ + $tar = new Archive_Tar($_FILES['tsarchive']['tmp_name']); + $tar->setErrorHandling(PEAR_ERROR_PRINT); + + $tmpdir = $root."ts/".time(); + + if (!$tar->extractModify($tmpdir, "ts")) + { + echo "<b>Archive extraction failed.</b>\n"; + + db_fini(); + require($root."footer.inc.php"); + die(); + } + /* Here we're in step 2 in process: ready to proceed */ echo "<pre>\n"; - $tmp = $tslp->TS_parse($_GET["ts_name"], $_GET["ts_descr"], $_GET["ts_root"]); + $tmp = $tslp->TS_parse($_GET["ts_name"], $_GET["ts_descr"], $tmpdir); echo "</pre>\n"; if (!$tmp) { $_GET["action"] = 1; echo "<p><b>Error:</b> <i>".$tslp->last_error."</i>.</p>\n"; } + + /* In any case, remove the extracted archive now. */ + function deldir($dir) { + $dh=opendir($dir); + while ($file=readdir($dh)) { + if($file!="." && $file!="..") { + $fullpath=$dir."/".$file; + if(!is_dir($fullpath)) { + unlink($fullpath); + } else { + deldir($fullpath); + } + } + } + + closedir($dh); + + rmdir($dir); + } + + deldir($tmpdir); } if ($_GET["action"] < 2) { /* Output the new testsuite form */ - echo "<form method=\"GET\">\n"; + echo "<form enctype=\"multipart/form-data\" method=\"POST\">\n"; + echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"2097152\">"; echo " <input type=\"hidden\" name=\"action\" value=\"2\">\n"; echo " <input type=\"hidden\" name=\"add_ts\" value=\"add\">\n"; echo " <input type=\"hidden\" name=\"module\" value=\"".$_GET["module"]."\">\n"; @@ -201,8 +263,8 @@ <td><textarea name="ts_descr" rows="3" cols="79"><?php echo $_GET["ts_descr"]; ?></textarea></td> </tr> <tr> - <td>Path to new release(*):</td> - <td><input type="text" name="ts_root" size="80" value=<?php echo "\"".$_GET["ts_root"]."\""; ?>></td> + <td>New release archive (tar.gz expanding in 'ts' directory):</td> + <td><input name="tsarchive" type="file"></td> </tr> <tr> <td colspan=2 align=center><input type="submit" name="send" value="Send"></td> @@ -216,11 +278,6 @@ die(); } - /* Here we're in step 2 in process: ready to proceed */ - - $tslp->select_module($_GET["module"]) or die("Invalid plugin"); - - $tmp = $tslp->TS_parse($_GET["ts_name"], $_GET["ts_descr"], $_GET["ts_root"]); } |
From: Sebastien D. <sde...@us...> - 2005-01-26 17:49:20
|
Update of /cvsroot/tslogparser/tslogparser/package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32037/package Modified Files: tslogparser.spec Log Message: New method for testsuite uploading Index: tslogparser.spec =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/package/tslogparser.spec,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- tslogparser.spec 21 Jan 2005 15:59:40 -0000 1.5 +++ tslogparser.spec 26 Jan 2005 17:49:09 -0000 1.6 @@ -7,9 +7,9 @@ # rpmbuild --target noarch-redhat-linux -ta tslogparser-*.tar.gz %define name tslogparser -%define version 0.4 -%define release 2 -%define filename tslogparser-v04 +%define version 0.5 +%define release 1 +%define filename tslogparser-v05 %define tslp_user tslogparser %define tslp_group tslogparser @@ -49,6 +49,7 @@ %__mkdir_p $RPM_BUILD_ROOT%{path_httpd_conf} %__mkdir_p $RPM_BUILD_ROOT%{path_tslp}/admin/modules %__mkdir_p $RPM_BUILD_ROOT%{path_tslp}/db +%__mkdir_p $RPM_BUILD_ROOT%{path_tslp}/ts %__cp *.php $RPM_BUILD_ROOT%{path_tslp} %__cp admin/*.php $RPM_BUILD_ROOT%{path_tslp}/admin %__cp admin/modules/*.php $RPM_BUILD_ROOT%{path_tslp}/admin/modules @@ -67,7 +68,7 @@ then /usr/sbin/groupadd %{tslp_group}; /usr/sbin/useradd -c 'tslogparser owner' -d %{path_tslp} -r -g %{tslp_group} %{tslp_user}; -else echo "tslogparser user already exists"; +else echo "tslogparser user already exists - skipped"; fi @@ -86,9 +87,13 @@ %config %{path_conf}/tslogparser.conf.php %{path_tslp} +%attr(0755,%{tslp_user},%{tslp_group}) %dir %{path_tslp}/ts - +# The version changes do not appear here %changelog +* Wed Jan 26 2005 Sebastien Decugis <seb...@ex...> +- Added 'ts' directory and appropriate rights. + * Fri Jan 21 2005 Sebastien Decugis <seb...@ex...> - initial spec file for tslogparser release v04 |
From: Sebastien D. <sde...@us...> - 2005-01-26 17:49:19
|
Update of /cvsroot/tslogparser/tslogparser/admin/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32037/admin/modules Modified Files: opts.mod.php Log Message: New method for testsuite uploading Index: opts.mod.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/modules/opts.mod.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- opts.mod.php 10 Jan 2005 18:09:52 -0000 1.5 +++ opts.mod.php 26 Jan 2005 17:48:52 -0000 1.6 @@ -139,7 +139,7 @@ /* Check the directory contains a coherent structure */ if ((!is_dir($path)) || (!is_dir($path."/conformance"))) { - $parent->last_error="Directory '$path' does not contain a valid source tree.\n"; + $parent->last_error="Directory '$path' does not contain a valid source tree -- check your archive format.\n"; return FALSE; } |
From: Sebastien D. <sde...@us...> - 2005-01-26 17:49:18
|
Update of /cvsroot/tslogparser/tslogparser/ts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32037/ts Added Files: README Log Message: New method for testsuite uploading --- NEW FILE: README --- This directory will be used when uploaded testsuites are expanded. Make sure the user running the web server has enough privilege to create and delete entries in this directory (execute bit). |
From: Sebastien D. <sde...@us...> - 2005-01-26 17:26:33
|
Update of /cvsroot/tslogparser/tslogparser/ts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26217/ts Log Message: Directory /cvsroot/tslogparser/tslogparser/ts added to the repository |
From: Bryce H. <br...@us...> - 2005-01-26 01:27:16
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20992 Modified Files: FAQ Log Message: typo Index: FAQ =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/FAQ,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- FAQ 22 Nov 2004 10:34:38 -0000 1.1.1.1 +++ FAQ 26 Jan 2005 01:26:44 -0000 1.2 @@ -4,6 +4,6 @@ file to open first is run-browse.php (2) What is a 'routine domain' ? -This defines a subset of testcases. For Open POSIX Test Suite, for exemple, -such a domain can be 'timers' routines, or 'mutex', or 'syncronization', ... +This defines a subset of testcases. For Open POSIX Test Suite, for example, +such a domain could be 'timers' routines, or 'mutex', or 'syncronization', ... |
From: Sebastien D. <sde...@us...> - 2005-01-21 15:59:58
|
Update of /cvsroot/tslogparser/tslogparser/package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15111/package Modified Files: tslogparser.spec Log Message: Fix in spec file when the tslogparser user already exists Index: tslogparser.spec =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/package/tslogparser.spec,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- tslogparser.spec 21 Jan 2005 15:15:27 -0000 1.4 +++ tslogparser.spec 21 Jan 2005 15:59:40 -0000 1.5 @@ -67,8 +67,10 @@ then /usr/sbin/groupadd %{tslp_group}; /usr/sbin/useradd -c 'tslogparser owner' -d %{path_tslp} -r -g %{tslp_group} %{tslp_user}; +else echo "tslogparser user already exists"; fi + # Restart Apache %post /etc/rc.d/init.d/httpd restart |
From: Sebastien D. <sde...@us...> - 2005-01-21 15:15:48
|
Update of /cvsroot/tslogparser/tslogparser/package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4939/package Modified Files: tslogparser.spec Log Message: Fix in database.inc.php Index: tslogparser.spec =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/package/tslogparser.spec,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- tslogparser.spec 21 Jan 2005 15:00:06 -0000 1.3 +++ tslogparser.spec 21 Jan 2005 15:15:27 -0000 1.4 @@ -2,6 +2,10 @@ # Rename this file to: %{name}-%{version}-%{release}.spec # example: tslogparser-0.4-1.spec # Mail to tsl...@li... for bugs & all. +# +# To regenerate an rpm, just issue: +# rpmbuild --target noarch-redhat-linux -ta tslogparser-*.tar.gz + %define name tslogparser %define version 0.4 %define release 2 |
From: Sebastien D. <sde...@us...> - 2005-01-21 15:15:36
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4939 Modified Files: HISTORY database.inc.php Log Message: Fix in database.inc.php Index: HISTORY =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/HISTORY,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- HISTORY 21 Jan 2005 15:00:06 -0000 1.15 +++ HISTORY 21 Jan 2005 15:15:27 -0000 1.16 @@ -1,3 +1,6 @@ +2005-01-21: tag v04b +- Fix in link from database.inc.php + 2005-01-21: tag v04 - Change in database.inc.php to include standard configuration file - New files: package/tslogparser.{conf,conf.php,spec} Index: database.inc.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/database.inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- database.inc.php 21 Jan 2005 10:42:39 -0000 1.6 +++ database.inc.php 21 Jan 2005 15:15:27 -0000 1.7 @@ -63,7 +63,7 @@ if ((!isset($CONFIG["version"])) || ($CONFIG["version"] < LATEST_VERSION)) { - die("<b>You need to update your database schema.</b>\n <a href='$root/admin/upgrade.php'>Click here</a>.\n"); + die("<b>You need to update your database schema.</b>\n <a href='".$root."admin/upgrade.php'>Click here</a>.\n"); } } |
From: Sebastien D. <sde...@us...> - 2005-01-21 15:00:15
|
Update of /cvsroot/tslogparser/tslogparser/package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1200/package Modified Files: tslogparser.spec Log Message: Ready to release Index: tslogparser.spec =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/package/tslogparser.spec,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tslogparser.spec 21 Jan 2005 14:44:55 -0000 1.2 +++ tslogparser.spec 21 Jan 2005 15:00:06 -0000 1.3 @@ -4,7 +4,7 @@ # Mail to tsl...@li... for bugs & all. %define name tslogparser %define version 0.4 -%define release 1 +%define release 2 %define filename tslogparser-v04 %define tslp_user tslogparser |
From: Sebastien D. <sde...@us...> - 2005-01-21 15:00:15
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1200 Modified Files: HISTORY INSTALL Log Message: Ready to release Index: INSTALL =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/INSTALL,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- INSTALL 21 Jan 2005 10:42:39 -0000 1.6 +++ INSTALL 21 Jan 2005 15:00:06 -0000 1.7 @@ -1,4 +1,4 @@ -This file describes the process for installing the tslogparser tool. +This file describes the process for installing the tslogparser tool from source. It contains the following sections: 1. Copy the files @@ -6,6 +6,12 @@ 3. Configure tslogparser 4. Initial database creation +In case you're using the RPM file, you have to: +-> Install the rpm + rpm -i tslogparser-*.rpm +-> Set up the database server (see step 2. below) +-> Configure the /etc/tslogparser.conf.php file (see step 3.) +-> Create the database data (see step 4.) ---------------------- STEP 1: Copy the files. ------------------------------- Index: HISTORY =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/HISTORY,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- HISTORY 12 Jan 2005 14:00:00 -0000 1.14 +++ HISTORY 21 Jan 2005 15:00:06 -0000 1.15 @@ -1,3 +1,8 @@ +2005-01-21: tag v04 +- Change in database.inc.php to include standard configuration file +- New files: package/tslogparser.{conf,conf.php,spec} +- These changes are meant to allow for a RPM packaging + 2005-01-12: - Update INSTALL file according to Bryce's recommandations. - New file: USAGE. |
From: Sebastien D. <sde...@us...> - 2005-01-21 14:45:07
|
Update of /cvsroot/tslogparser/tslogparser/package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30012/package Modified Files: tslogparser.conf.php tslogparser.spec Log Message: Spec file ready for packaging (v04) Index: tslogparser.spec =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/package/tslogparser.spec,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tslogparser.spec 21 Jan 2005 10:42:40 -0000 1.1 +++ tslogparser.spec 21 Jan 2005 14:44:55 -0000 1.2 @@ -0,0 +1,89 @@ +# This file is for building an RPM of the tslogparser tool. +# Rename this file to: %{name}-%{version}-%{release}.spec +# example: tslogparser-0.4-1.spec +# Mail to tsl...@li... for bugs & all. +%define name tslogparser +%define version 0.4 +%define release 1 +%define filename tslogparser-v04 + +%define tslp_user tslogparser +%define tslp_group tslogparser + +%define path_tslp /var/www/tslogparser +%define path_conf /etc +%define path_httpd_conf /etc/httpd/conf.d + +Summary: Web interface wrapper for test suites runs logfiles. +Name: %{name} +Version: %{version} +Release: %{release} +Copyright: GPL +Group: Development/Tools +Source: %{filename}.tar.gz +BuildRoot: /tmp/tslp +Url: http://tslogparser.sourceforge.net + +%description +The %{name} tool is a php/MySQL interface to store and browse some +test suites log files (such as those issued from the Open POSIX Test Suite +runs) in a more user-friendly interface. + +See http://tslogparser.sourceforge.net for more information. + + +%prep +# untar the archive +%setup -n %{filename} + +%build +# nothing to do here... + +%install +rm -rf $RPM_BUILD_ROOT +%__mkdir_p $RPM_BUILD_ROOT%{path_conf} +%__mkdir_p $RPM_BUILD_ROOT%{path_httpd_conf} +%__mkdir_p $RPM_BUILD_ROOT%{path_tslp}/admin/modules +%__mkdir_p $RPM_BUILD_ROOT%{path_tslp}/db +%__cp *.php $RPM_BUILD_ROOT%{path_tslp} +%__cp admin/*.php $RPM_BUILD_ROOT%{path_tslp}/admin +%__cp admin/modules/*.php $RPM_BUILD_ROOT%{path_tslp}/admin/modules +%__cp db/*.php $RPM_BUILD_ROOT%{path_tslp}/db +%__cp package/tslogparser.conf $RPM_BUILD_ROOT%{path_httpd_conf} +%__cp package/tslogparser.conf.php $RPM_BUILD_ROOT%{path_conf} + + +%clean +rm -rf $RPM_BUILD_ROOT + +# Add tslogparser user & group +%pre +finger %{tslp_user}|grep "Login.*%{tslp_ser}" > /dev/null +if [ $? -ne 0 ]; +then + /usr/sbin/groupadd %{tslp_group}; + /usr/sbin/useradd -c 'tslogparser owner' -d %{path_tslp} -r -g %{tslp_group} %{tslp_user}; +fi + +# Restart Apache +%post +/etc/rc.d/init.d/httpd restart + +%postun +/etc/rc.d/init.d/httpd restart + + +%files +%defattr(-,%{tslp_user},%{tslp_group}) +%doc FAQ HISTORY INSTALL LICENCE README TODO USAGE admin/modules/readme.txt admin/modules/ltp.mod.php.example +%attr(0440,root,root) %config %{path_httpd_conf}/tslogparser.conf +%config %{path_conf}/tslogparser.conf.php + +%{path_tslp} + + +%changelog +* Fri Jan 21 2005 Sebastien Decugis <seb...@ex...> +- initial spec file for tslogparser release v04 + + Index: tslogparser.conf.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/package/tslogparser.conf.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tslogparser.conf.php 21 Jan 2005 10:42:40 -0000 1.1 +++ tslogparser.conf.php 21 Jan 2005 14:44:55 -0000 1.2 @@ -2,9 +2,9 @@ // Database server name or IP: $db_server="localhost"; // Database name: -$db="results"; +$db="tslogparser"; // Database user login: -$db_user="apache"; +$db_user="tslogparser"; // Database password: -$db_pw="apache"; +$db_pw="secret"; ?> |
From: Sebastien D. <sde...@us...> - 2005-01-21 10:42:53
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9133 Modified Files: INSTALL database.inc.php Removed Files: db_inc.php Log Message: Defined a default setup configuration (1st step to rpm), updated INSTALL file accordingly to modifications. --- db_inc.php DELETED --- Index: INSTALL =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/INSTALL,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- INSTALL 12 Jan 2005 15:54:26 -0000 1.5 +++ INSTALL 21 Jan 2005 10:42:39 -0000 1.6 @@ -11,27 +11,34 @@ -> Put the tslogparser files in a suitable directory for your setup. For example: - cd /opt + cd /var/www mkdir tslogparser + mkdir tslogparser/admin + mkdir tslogparser/admin/modules + mkdir tslogparser/db cd tar zxvf tslogparser*.tar.gz cd tslogparser* - cp -R * /opt/tslogparser - + mv *.php FAQ /var/www/tslogparser + mv admin/*.php /var/www/tslogparser/admin + mv admin/modules/*.php /var/www/tslogparser/admin/modules + mv db/*.php /var/www/tslogparser/db + -> Then make this directory accessible from your web server. - cd /var/www/html - ln -s /opt/tslogparser - + In standard installation (apache 2.0), you can do this by just copying a file: + mv package/tslogparser.conf /etc/httpd/conf.d + Then restart you webserver: + /etc/rc.d/init.d/httpd restart + -> Check your web server can access the files. - Open http://localhost/tslogparser/INSTALL in a web browser. + Open http://localhost/tslogparser/FAQ in a web browser. You may need extra set-up to allow for PHP files execution. Check your webserver configuration file. - -------------------- STEP 2: Set up the database server. ------------------------- +------------------ STEP 2: Set up the database server. ------------------------ You need a working MySQL installation here. You can execute the following commands from the command line client or @@ -52,9 +59,12 @@ ------------------- STEP 3: Configure tslogparser -------------------------------- +----------------- STEP 3: Configure tslogparser ------------------------------- --> Edit the file db_inc.php with your database configuration information: +-> The default configuration file is /etc/tslogparser.conf.php + mv package/tslogparser.conf.php /etc + +-> Edit the file tslogparser.conf.php with your database configuration information: (*) server name or IP. (*) user name (*) user password @@ -72,10 +82,9 @@ $db_pw="secret"; ?> -NOTE: You may put this file anywhere for security reasons; just +NOTE: You may put this file anywhere else for security reasons; just let the file database.inc.php know where it is located, and - make sure that your web server process can access it (user apache). - + make sure that your web server process can access it (user apache or www). ------------------- STEP 4: Initial database creation ------------------------ Index: database.inc.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/database.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- database.inc.php 11 Jan 2005 10:13:43 -0000 1.5 +++ database.inc.php 21 Jan 2005 10:42:39 -0000 1.6 @@ -32,7 +32,7 @@ */ if (!isset($root)) die ("Hack attempt detected\n"); -require($root."db_inc.php"); +require("/etc/tslogparser.conf.php"); /* Define the latest version name */ require($root."db/update_db.inc.php"); |
From: Sebastien D. <sde...@us...> - 2005-01-21 10:42:53
|
Update of /cvsroot/tslogparser/tslogparser/package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9133/package Added Files: tslogparser.conf tslogparser.conf.php tslogparser.spec Log Message: Defined a default setup configuration (1st step to rpm), updated INSTALL file accordingly to modifications. --- NEW FILE: tslogparser.spec --- --- NEW FILE: tslogparser.conf --- # # This file sets an alias for the tslogparser tool # to be accessed from the web server. # It defaults to be accessable only from localhost. # Alias /tslogparser /var/www/tslogparser <Location /tslogparser> Order deny,allow Deny from all Allow from 127.0.0.1 Allow from ::1 # Allow from .example.com </Location> --- NEW FILE: tslogparser.conf.php --- <?php // Database server name or IP: $db_server="localhost"; // Database name: $db="results"; // Database user login: $db_user="apache"; // Database password: $db_pw="apache"; ?> |
From: Sebastien D. <sde...@us...> - 2005-01-21 10:41:08
|
Update of /cvsroot/tslogparser/tslogparser/package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8828/package Log Message: Directory /cvsroot/tslogparser/tslogparser/package added to the repository |
From: Sebastien D. <sde...@us...> - 2005-01-19 08:24:02
|
Update of /cvsroot/tslogparser/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18648 Modified Files: support.php Log Message: typo fix Index: support.php =================================================================== RCS file: /cvsroot/tslogparser/web/support.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- support.php 12 Jan 2005 15:49:02 -0000 1.4 +++ support.php 19 Jan 2005 08:23:46 -0000 1.5 @@ -42,7 +42,7 @@ <p>The first place where you can find support on installation or use of the <code>tslogparser</code> tool is the dedicated mailing-list.</p> - <p>Information on subscribtion can be found + <p>Information on subscription can be found <a href="https://lists.sourceforge.net/lists/listinfo/tslogparser-discuss"> <i>here</i></a>.</p> <p>The mailing list archive can be found |
From: Sebastien D. <sde...@us...> - 2005-01-12 17:22:25
|
Update of /cvsroot/tslogparser/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12712 Modified Files: footer.inc.php header.inc.php session.inc.php Log Message: Fix in sessions Index: header.inc.php =================================================================== RCS file: /cvsroot/tslogparser/web/header.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- header.inc.php 12 Jan 2005 16:57:45 -0000 1.3 +++ header.inc.php 12 Jan 2005 17:22:14 -0000 1.4 @@ -25,5 +25,4 @@ require("head.inc.php"); ?> -<p>Note: the database is restored twice an hour.</p> Index: footer.inc.php =================================================================== RCS file: /cvsroot/tslogparser/web/footer.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- footer.inc.php 12 Jan 2005 15:58:00 -0000 1.4 +++ footer.inc.php 12 Jan 2005 17:22:14 -0000 1.5 @@ -20,7 +20,7 @@ die ("Hack attempt detected\n"); ?> <hr width="100%"> - + <p>NOTE:<i>The database is restored from scratch twice an hour.</i></p> <p> <font size='-2' color='grey'> Generated with <a href="/index.php">TsLogParser</a>. Index: session.inc.php =================================================================== RCS file: /cvsroot/tslogparser/web/session.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- session.inc.php 12 Jan 2005 15:49:02 -0000 1.1 +++ session.inc.php 12 Jan 2005 17:22:14 -0000 1.2 @@ -21,6 +21,7 @@ If one want to add better security, a good start is the php manual. */ +session_save_path("/home/groups/t/ts/tslogparser/sessions"); session_start(); /* Below is a definition of authorized session variables |
From: Sebastien D. <sde...@us...> - 2005-01-12 16:58:01
|
Update of /cvsroot/tslogparser/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6692 Modified Files: header.inc.php Log Message: Added warning in demo files Index: header.inc.php =================================================================== RCS file: /cvsroot/tslogparser/web/header.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- header.inc.php 12 Jan 2005 15:49:02 -0000 1.2 +++ header.inc.php 12 Jan 2005 16:57:45 -0000 1.3 @@ -25,4 +25,5 @@ require("head.inc.php"); ?> +<p>Note: the database is restored twice an hour.</p> |
From: Sebastien D. <sde...@us...> - 2005-01-12 15:58:10
|
Update of /cvsroot/tslogparser/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25988 Modified Files: footer.inc.php menu.inc.php Log Message: Fix in path inclusions Index: menu.inc.php =================================================================== RCS file: /cvsroot/tslogparser/web/menu.inc.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- menu.inc.php 25 Nov 2004 14:26:05 -0000 1.1.1.1 +++ menu.inc.php 12 Jan 2005 15:58:00 -0000 1.2 @@ -37,7 +37,7 @@ if ($data["url"] == basename($_SERVER['PHP_SELF'])) $color = "#ffffd0"; echo "<!-- $cle --> <h3>\n"; - echo " <a href=\"".$data["url"]."\">\n"; + echo " <a href=\"".$root.$data["url"]."\">\n"; echo " <font color='".$color."'>".$data["text"]."</font>\n"; echo " </a></h3>\n"; } Index: footer.inc.php =================================================================== RCS file: /cvsroot/tslogparser/web/footer.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- footer.inc.php 12 Jan 2005 15:49:02 -0000 1.3 +++ footer.inc.php 12 Jan 2005 15:58:00 -0000 1.4 @@ -23,7 +23,7 @@ <p> <font size='-2' color='grey'> - Generated with <a href="index.php">TsLogParser</a>. + Generated with <a href="/index.php">TsLogParser</a>. </font> </p> <?php |
From: Sebastien D. <sde...@us...> - 2005-01-12 15:54:39
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25103 Modified Files: INSTALL Log Message: fin in INSTALL Index: INSTALL =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/INSTALL,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- INSTALL 12 Jan 2005 14:00:00 -0000 1.4 +++ INSTALL 12 Jan 2005 15:54:26 -0000 1.5 @@ -61,7 +61,6 @@ (*) database name. Example of such a file: -$ cat > db_inc.php <<EOF <?php // Database server name or IP: $db_server="localhost"; @@ -72,7 +71,6 @@ // Database password: $db_pw="secret"; ?> -EOF NOTE: You may put this file anywhere for security reasons; just let the file database.inc.php know where it is located, and |
From: Sebastien D. <sde...@us...> - 2005-01-12 15:49:20
|
Update of /cvsroot/tslogparser/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23666 Modified Files: downloads.php features.php footer.inc.php header.inc.php index.php internals.php run-browse.php support.php Added Files: database.inc.php detailed.php foot.inc.php functions.inc.php head.inc.php report.php session.inc.php Log Message: Include the tool on the website Index: support.php =================================================================== RCS file: /cvsroot/tslogparser/web/support.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- support.php 12 Jan 2005 14:22:37 -0000 1.3 +++ support.php 12 Jan 2005 15:49:02 -0000 1.4 @@ -1,6 +1,6 @@ <?php $_PAGE["title"] = "SUPPORT"; -require("header.inc.php"); +require("head.inc.php"); ?> <table border='0' width='100%'> <tr> @@ -58,6 +58,6 @@ <tr><td> </td></tr> </table> <?php -require("footer.inc.php"); +require("foot.inc.php"); ?> Index: run-browse.php =================================================================== RCS file: /cvsroot/tslogparser/web/run-browse.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- run-browse.php 11 Jan 2005 11:10:25 -0000 1.2 +++ run-browse.php 12 Jan 2005 15:49:02 -0000 1.3 @@ -1,29 +1,240 @@ <?php -$_PAGE["title"] = "DEMONSTRATION"; -require("header.inc.php"); +/* + * Copyright (c) 2005, Bull S.A.. All rights reserved. + * Created by: Sebastien Decugis + + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write the Free Software Foundation, Inc., 59 + * Temple Place - Suite 330, Boston MA 02111-1307, USA. + */ + +/* This file allows the user to find which runs are in the database, + and to select for details or comparison. + +It also provides an interface to enter new results or new testsuite release. + +*/ + +/* We need to find all runs inside the database */ +$root=""; +require($root."database.inc.php"); +require($root."functions.inc.php"); +db_init(); + +$_PAGE["title"]="Results browser"; + +require($root."header.inc.php"); + +echo "<p>Go to <a href=\"".$root."admin/\">Administration Interface</a></p>\n"; + +if (isset($_GET["deselect_module"])) + unset($_SESSION["module"]); + +/* Count runs by modules in the database */ +$sql = " SELECT DISTINCT ver_module, ver_id, res_run" + ." FROM opts_versions, opts_version_descriptions, opts_run_results" + ." WHERE ver_id=descr_version" + ." AND res_testcase=descr_id"; +$runs = db_execute_select($sql); + +$infos=array(); +foreach ($runs as $row) + if (isset($infos[$row["ver_module"]])) + $infos[$row["ver_module"]]++; + else + $infos[$row["ver_module"]]=1; + +if (isset($_GET["module"])) + if (isset($infos[$_GET["module"]])) + $_SESSION["module"]=$_GET["module"]; + +/* If we found no showable results */ +if (count($infos)==0) +{ + echo "<p>There is no displayable result in the database yet.\n"; + echo "You may add some from the Administration Interface.</p>"; + db_fini(); + require($root."footer.inc.php"); + die(); +} + +/* If we have only 1 module, we don't need to ask the user */ +if (count($infos)==1) + $_SESSION["module"]=$runs[0]["ver_module"]; + +/* Otherwise, the user need to choose a module */ +if (count($infos)>1) +{ + if (!isset($_SESSION["module"])) + { + /* Show modules list and let the user choose one */ + echo "<p>Please choose a module from the list:</p>\n"; + echo "<ul>\n"; + foreach ($infos as $module => $cnt) + { + echo "<li><a href=\"".$_SERVER["PHP_SELF"]."?module=$module\">"; + echo "<b>$module</b></a> ($cnt logfiles)</li>\n"; + } + echo "</ul>\n"; + db_fini(); + require($root."footer.inc.php"); + die(); + } + else + { + /* Show selected module and let the user cancel its selection */ + echo "<p>You're viewing the <i>".$_SESSION["module"]."</i> results currently.\n"; + echo "<a href=\"".$_SERVER["PHP_SELF"]."?deselect_module=1\">"; + echo "Click here</a> to change.</p>\n"; + } +} + + +/* Now, proceed to the display */ + +/* + +We could achieve the same goal with an "outer join" sql request, +but it takes more time than 2 separate requests. + +$sql= " SELECT DISTINCT ver_name,run_name " + ." FROM " + ." ((opts_run_results INNER JOIN opts_run ON run_id=res_run)" + ." RIGHT OUTER JOIN opts_version_descriptions " + ." ON descr_id=res_testcase), opts_versions" + ." WHERE " + ." ver_id=descr_version"; +*/ +$sql= " SELECT DISTINCT ver_name, ver_comment, ver_id " + ." FROM opts_versions, opts_version_descriptions" + ." WHERE ver_id = descr_version " + ." AND ver_module = ".stringToDB($_SESSION["module"]) + ." ORDER BY ver_id DESC"; +$release_table = db_execute_select($sql); + + +$sql= " SELECT DISTINCT run_name, run_comments, ver_name, run_id " + ." FROM opts_run, opts_run_results, opts_version_descriptions, opts_versions " + ." WHERE run_id=res_run" + ." AND res_testcase=descr_id" + ." AND descr_version=ver_id" + ." AND ver_module = ".stringToDB($_SESSION["module"]) + ." ORDER BY ver_name"; +$run_table = db_execute_select($sql); + +/* Merge the data from both table */ +$infos=array(); + +foreach ($release_table as $release) + $infos[$release["ver_name"]]=array( + "id"=>$release["ver_id"], + "comment"=>$release["ver_comment"], + "runs"=>array()); + +foreach ($run_table as $run) + $infos[$run["ver_name"]]["runs"][$run["run_id"]]=array( + "name"=>$run["run_name"], + "comment"=>$run["run_comments"]); + +unset($release_table); +unset($run_table); + +/* Ok, now we'll display the result on the html page */ ?> - <table border='0' width='100%'> - <tr> - <td bgcolor="#90ACC8"> - <h2><font color="#fffffe"> - Experience <code>tslogparser</code></font></h2> - </td> - </tr> - <tr><td> </td></tr> - <tr> - <td> - <p>The tool can be experienced at:<br> - <a href="http://nptl.bullopensource.org/Tests/results/"> - http://nptl.bullopensource.org - </a> (read only access to the database).</p> - <p>If you're hosting this tool on a public place, - please let us know (though the mailing list) to - publish the link here. Thanks!</p> - </td> - </tr> - <tr><td> </td></tr> - </table> + + <h3>Available results for the <?php echo $_SESSION["module"]; ?> module</h3> + + <table border="1"> + <tr> + <td valign='top' align='center'><b>TestSuite Release</b></td> + <td valign='top' align='center' colspan="2"><b>Run Designation</b></td> + <td valign='top' align='center'><b>Action</b></td> + <td valign='top'><b>Comments</b></td> + </tr> <?php -require("footer.inc.php"); + if (!$infos) + { + /* This should never happen */ ?> + <tr> + <td colspan=5><i>Sorry, no data was found.</i></td> + </tr> +<?php + } + else + { + foreach($infos as $release => $data) + { + echo " <tr>\n"; + echo " <td valign=\"top\""; + if (count($data["runs"])>1) + echo " rowspan=\"".(count($data["runs"])+2)."\""; + elseif (count($data["runs"])==1) + echo " rowspan=\"2\""; + echo ">\n"; + echo " <font color='orange'>".stringFromDB($release)."</font>\n"; + echo " </td>\n"; + echo " <td colspan='4' align=left>\n"; + echo " <i><font color='orange'>".stringFromDB($data["comment"])."</font></i>\n"; + echo " </td>\n"; + echo " </tr>\n"; + + if ($data["runs"]) + { + echo " <form method='POST' action='report.php'>\n"; + echo " <input type='hidden' name='opts_rel' value=\"".$data["id"]."\">\n"; + /* default to masking PASS and SKIP status */ + echo " <input type='hidden' name='build_PASS' value='hidden'>\n"; + echo " <input type='hidden' name='link_SKIP' value='hidden'>\n"; + echo " <input type='hidden' name='execution_PASS' value='hidden'>\n"; + + foreach ($data["runs"] as $run_id => $run_data) + { + echo " <tr>\n"; + echo " <td align=center>\n"; + if (count($data["runs"])>1) + echo " <input type='checkbox' name='chkd_runs[]' value='".$run_id."'>\n"; + else + echo " \n"; + echo " </td>\n"; + echo " <td>\n"; + echo " ".stringFromDB($run_data["name"])."\n"; + echo " </td>\n"; + echo " <td align=center>\n"; + echo " <input type='submit' name='browse[$run_id]' value='Browse'>\n"; + echo " </td>\n"; + echo " <td>\n"; + echo " <i>".stringFromDB($run_data["comment"])."</i>\n"; + echo " </td>\n"; + echo " </tr>\n"; + } + if (count($data["runs"])>1) + { + echo " <tr>\n"; + echo " <td colspan='3' align=center>\n"; + echo " <input type='submit' name='compare' value='Compare selected'>\n"; + echo " </td>\n"; + echo " <td>\n"; + echo " \n"; + echo " </td>\n"; + echo " </tr>\n"; + } + echo " </form>\n"; + } + } + } +?> + </table> +<?php +db_fini(); +require($root."footer.inc.php"); +?> --- NEW FILE: detailed.php --- <?php /* * Copyright (c) 2005, Bull S.A.. All rights reserved. * Created by: Sebastien Decugis * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. */ /* This file gives the full information for a testcase Inputs: -> database identification of the testcase (run_id + testcase_id) Inputs are passed through GET variables, i.e.: detailed.php?run_id=2&testcase_id=17 Outputs: -> html text only */ $root=""; require($root."database.inc.php"); require($root."functions.inc.php"); $_PAGE["title"]="Testcase Detail"; require($root."header.inc.php"); if (!isset($_GET["run_id"]) || (!isset($_GET["testcase_id"]))) die("<p><b>Wrong parameter format.</b></p>\n</body></html>\n"); db_init(); /* We need to find this record in the database -- and get some more infos */ $sql = " SELECT res_log, res_status, run_name, run_comments, ver_name, ver_comment, " ." descr_info, assert_text, rou_name, rou_comment " ." FROM opts_run, opts_run_results, opts_version_descriptions, " ." opts_versions, opts_assertions, opts_routines " ." WHERE " ." opts_run.run_id = opts_run_results.res_run" ." AND opts_run_results.res_testcase = opts_version_descriptions.descr_id" ." AND opts_version_descriptions.descr_version = opts_versions.ver_id" ." AND opts_version_descriptions.descr_assert = opts_assertions.assert_id" ." AND opts_assertions.assert_routine = opts_routines.rou_id" ." AND res_run=".$_GET["run_id"]." AND res_testcase=".$_GET["testcase_id"]; $restotal = db_execute_select($sql); if (!$restotal) die("<p><b>No corresponding testcase found.</b></p>\n</body></html>\n"); $res=$restotal[0]; ?> <table border="1" width="100%"> <tr> <td valign="top" align="center"><b>Testsuite</b></td> <td valign="top" align="center"><?php echo stringFromDB($res["ver_name"]); ?></td> <td valign="top"><i><?php echo stringFromDB($res["ver_comment"]); ?></i> </td> </tr> <tr> <td valign="top" align="center"><b>Run</b></td> <td valign="top" align="center"><?php echo stringFromDB($res["run_name"]); ?></td> <td valign="top"><i><?php echo stringFromDB($res["run_comments"]); ?></i> </td> </tr> <tr> <td valign="top" align="center"><b>Routine</b></td> <td valign="top" align="center"><?php echo stringFromDB($res["rou_name"]); ?></td> <td valign="top"><i><?php echo stringFromDB($res["rou_comment"]); ?></i> </td> </tr> <tr> <td valign="top" align="center"><b>Testcase</b></td> <td valign="top" align="center"><?php echo stringFromDB($res["descr_info"]); ?></td> <td valign="top"><?php echo stringFromDB($res["assert_text"]); ?> </td> </tr> <tr> <td valign="top" align="center"><b>Status</b></td> <td valign="top" align="center"><?php $font=0; if (ereg("PASS", $res["res_status"])) { echo "<font color='green'>"; $font=1; } if (ereg("FAIL", $res["res_status"])) { echo "<font color='red'>"; $font=1; } echo stringFromDB($res["res_status"]); if ($font) echo "</font>"; ?></td> <td valign="top"><pre><?php echo strip_tags(stringFromDB($res["res_log"])); ?> </pre></td> </tr> </table> <?php db_fini(); require($root."footer.inc.php"); ?> --- NEW FILE: head.inc.php --- <?php if (!isset($_PAGE["title"])) die("Incorrect page inclusion.\n"); if (!isset($root)) $root=""; ?> <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>TsLogParser Project</title> <?php echo " <link rel=\"stylesheet\" type=\"text/css\" href=\"".$root."my.css\">\n"; ?> </head> <body link="#1c3388" vlink="#1c3388" alink="#1c3388"> <table align="center" bgcolor="#fefefe" border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td height="30" bgcolor="#A2C0DF" colspan="2"> <center> <h1><font color="#fffffe">TestSuite Log Parser and Browser</font></h1> </center> </td> </tr> <tr> <td colspan="2" align="center"> <table border='0' cellspacing='0' cellpadding='0' width='100%'> <tr> <?php echo " <td width=300 align=left><img src=\"".$root."bos.jpg\" height=112></td>\n"; echo " <td align=\"center\"><h2>".$_PAGE["title"]."</h2></td>\n"; echo " <td width=300 align=right><img src=\"".$root."bos-rev.jpg\" height=112></td>\n"; ?> </tr> </table> </td> </tr> <tr> <td width="91" bgcolor="#A2C0DF" valign="top"> <?php require($root."menu.inc.php"); ?> </td> <td valign="top"> <table border="0" width="100%"> <tr> <td colspan=3> </td> </tr> <tr> <td> </td> <td width='100%'> Index: index.php =================================================================== RCS file: /cvsroot/tslogparser/web/index.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- index.php 25 Nov 2004 14:26:06 -0000 1.1.1.1 +++ index.php 12 Jan 2005 15:49:02 -0000 1.2 @@ -1,6 +1,6 @@ <?php $_PAGE["title"] = "PROJECT HOME"; -require("header.inc.php"); +require("head.inc.php"); ?> <table border='0' width='100%'> <tr> @@ -65,6 +65,6 @@ <tr><td> </td></tr> </table> <?php -require("footer.inc.php"); +require("foot.inc.php"); ?> Index: features.php =================================================================== RCS file: /cvsroot/tslogparser/web/features.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- features.php 11 Jan 2005 11:10:25 -0000 1.2 +++ features.php 12 Jan 2005 15:49:02 -0000 1.3 @@ -1,6 +1,6 @@ <?php $_PAGE["title"] = "FEATURES"; -require("header.inc.php"); +require("head.inc.php"); ?> <table border='0' width='100%'> <tr> @@ -99,6 +99,6 @@ <tr><td> </td></tr> </table> <?php -require("footer.inc.php"); +require("foot.inc.php"); ?> --- NEW FILE: session.inc.php --- <?php /* * Copyright (c) 2005, Bull S.A.. All rights reserved. * Created by: Sebastien Decugis * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. */ /* We don't really care about security yet, so the default session handler is suitable for us. If one want to add better security, a good start is the php manual. */ session_start(); /* Below is a definition of authorized session variables for each user page. If a session variable is found out of this definition, it is unset. The format is $authorized_session_vars["variable"]=array("page1","page2"...); where variable is the session variable name (key in $_SESSION) and page1, page2 the pages where this variable is allowed. */ $authorized_session_vars=array( "module"=>array("run-browse.php"), ); /* Below is the mechanism which will delete unauthorized sessions vars */ foreach ($_SESSION as $var => $authorization) { if (!isset($authorized_session_vars[$var])) { unset($_SESSION[$var]); continue; } if (!in_array(basename($_SERVER["PHP_SELF"]),$authorized_session_vars[$var])) { unset($_SESSION[$var]); } } ?> Index: internals.php =================================================================== RCS file: /cvsroot/tslogparser/web/internals.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- internals.php 11 Jan 2005 10:48:20 -0000 1.2 +++ internals.php 12 Jan 2005 15:49:02 -0000 1.3 @@ -1,6 +1,6 @@ <?php $_PAGE["title"] = "INTERNALS"; -require("header.inc.php"); +require("head.inc.php"); ?> <table border='0' width='100%'> <tr> @@ -82,6 +82,6 @@ <tr><td> </td></tr> </table> <?php -require("footer.inc.php"); +require("foot.inc.php"); ?> --- NEW FILE: database.inc.php --- <?php /* * Copyright (c) 2005, Bull S.A.. All rights reserved. * Created by: Sebastien Decugis * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. */ /* This file contains the functions to connect to the database and to execute queries */ /* database settings * * (These are separated for security reasons) * * The included file must define * $db_server * $db_user * $db_pw * $db */ if (!isset($root)) die ("Hack attempt detected\n"); require($root."../db/db_inc.php"); /* Define the latest version name */ require($root."db/update_db.inc.php"); /* Database connection handler */ $db_link=0; /* Configuration data */ $CONFIG=array(); /* Initialize link to the db and grep configuration */ function db_init() { global $db_server,$db_user,$db_pw, $db, $db_link, $CONFIG, $root; $db_link = mysql_connect($db_server,$db_user,$db_pw) or die("Failed to connect to MySQL: ".mysql_error()."\n"); mysql_select_db($db) or die("Failed selecting the database\n"); $tmp = @mysql_query("SELECT * FROM opts_config"); if ($tmp) { while ($row = mysql_fetch_assoc($tmp)) $CONFIG[$row["cfg_key"]]=$row["cfg_val"]; } if ((!isset($CONFIG["version"])) || ($CONFIG["version"] < LATEST_VERSION)) { die("<b>You need to update your database schema.</b>\n <a href='$root/admin/upgrade.php'>Click here</a>.\n"); } } /* Close link to the db */ function db_fini() { global $db_link; if ($db_link) mysql_close($db_link); } /* Check DB link */ function is_db_init() { global $db_link; return ($db_link != false); } function db_execute_select($sql) { $rows=array(); $res = mysql_query($sql) or die("Database access error: ".mysql_error()); while ($row = mysql_fetch_assoc($res)) $rows[]=$row; mysql_free_result($res); return ($rows); } function db_query($sql, &$res) { $res = mysql_query($sql) or die("Database access error: ".mysql_error()); } function db_getline($rs) { return mysql_fetch_assoc($rs); } function db_execute_insert($sql) { mysql_query($sql) or die("Database access error: ".mysql_error()); return mysql_affected_rows(); } ?> Index: downloads.php =================================================================== RCS file: /cvsroot/tslogparser/web/downloads.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- downloads.php 11 Jan 2005 11:10:25 -0000 1.2 +++ downloads.php 12 Jan 2005 15:49:02 -0000 1.3 @@ -1,6 +1,6 @@ <?php $_PAGE["title"] = "DOWNLOADS"; -require("header.inc.php"); +require("head.inc.php"); ?> <table border='0' width='100%'> <tr> @@ -43,6 +43,6 @@ </tr> </table> <?php -require("footer.inc.php"); +require("foot.inc.php"); ?> --- NEW FILE: functions.inc.php --- <?php /* * Copyright (c) 2005, Bull S.A.. All rights reserved. * Created by: Sebastien Decugis * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. */ /* This file provides several functions used in other files. -> interface to database -> pre-built queries */ /* The next function will seek for a particular routine into the database. * * Input: * $routine_name: Name of the routine being searched. If $exact_match is false, this name can be partial. * $exact_match: if true, only routines with exact name are returned. * * Output: * An array of found routines is returned: * Array( * <routine_name> = Array( * "routine_id" => <routine_id> * "routine_comment" => <routine_comment> * ) * ) */ function query_routines($routine_name="", $exact_match=0) { $sql = "SELECT rou_id, rou_name, rou_comment FROM opts_routines"; if ($routine_name != "") { $sql .= " WHERE rou_name LIKE "; if ($exact_match) $sql .= "'$routine_name'"; else $sql .= "'%$routine_name%'"; } $res = db_execute_select($sql); $result=array(); foreach ($res as $data) { $result[$data["rou_name"]]=array( "routine_id"=>$data["rou_id"], "routine_comment"=>$data["rou_comment"]); } return $result; } /* The next function will retrieve assertions from the database (not bound to a particular OPTS release). * * Input: * $routine_name: Name of the routine being searched. If $exact_match is false, this name can be partial. * $exact_match: if true, only routines with exact name are returned. * * Output: * An array of found assertions is returned: * Array( * <routine_name> = Array( * <assert_id> => <assert_text> * ) * ) */ function query_all_asserts($routine_name="", $exact_match=0) { $sql = "SELECT rou_name, assert_id, assert_text FROM opts_routines, opts_assertions WHERE rou_id=assert_routine"; if ($routine_name != "") { $sql .= " AND rou_name LIKE "; if ($exact_match) $sql .= "'$routine_name'"; else $sql .= "'%$routine_name%'"; } $res = db_execute_select($sql); $result=array(); foreach ($res as $data) { if (!isset($result[$data["rou_name"]])) $result[$data["rou_name"]]=array(); $result[$data["rou_name"]][$data["assert_id"]]=$data["assert_text"]; } return $result; } /* The next function will retrieve OPTS release names from the database * * Input: * $release_name: Name of the release being searched. If $exact_match is false, this name can be partial. * $exact_match: if true, only releases with exact name are returned. * * Output: * An array of found releases is returned: * Array( * <version_name> = Array( * "ver_id" => <version_id>, * "ver_comment" => <version_comment> * ) * ) */ function query_version($release_name="", $exact_match=0) { $sql = "SELECT ver_id, ver_name, ver_comment, ver_module FROM opts_versions"; if ($release_name != "") { $sql .= " WHERE ver_name LIKE "; if ($exact_match) $sql .= "'".addslashes($release_name)."'"; else $sql .= "'%".addslashes($release_name)."%'"; } $res = db_execute_select($sql); $result=array(); foreach ($res as $data) { $result[$data["ver_name"]]= array( "ver_id"=>$data["ver_id"], "ver_comment"=>$data["ver_comment"], "ver_module" =>$data["ver_module"]); } return $result; } /* The next 2 functions are used to protect text data inserted and extracted from database. It prevents user from putting malicious HTML code, for example. A basic version will forbid all tags. Later a refined support can be developped. */ function stringToDB($string) { return "'".addslashes($string)."'"; } function stringFromDB($string) { return nl2br(htmlentities($string)); } ?> Index: footer.inc.php =================================================================== RCS file: /cvsroot/tslogparser/web/footer.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- footer.inc.php 11 Jan 2005 10:34:40 -0000 1.2 +++ footer.inc.php 12 Jan 2005 15:49:02 -0000 1.3 @@ -1,6 +1,6 @@ <?php /* - * Copyright (c) 2004, Bull S.A.. All rights reserved. + * Copyright (c) 2005, Bull S.A.. All rights reserved. * Created by: Sebastien Decugis * This program is free software; you can redistribute it and/or modify it @@ -15,30 +15,20 @@ * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. */ - - -if (!isset($_PAGE["title"])) - die("Incorrect page inclusion.\n"); +/* Check there is no hack attempt */ +if (!isset($root)) + die ("Hack attempt detected\n"); ?> - </td> - <td> </td> - </tr> - </table> - </td> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - </table> - <hr width="100%"> - <p>Page hosted by : <br> - <a href="http://sourceforge.net"> - <img src="http://sourceforge.net/sflogo.php?group_id=124567&type=5" - width="210" height="62" border="0" alt="SourceForge.net Logo"> - </a> + <p> + <font size='-2' color='grey'> + Generated with <a href="index.php">TsLogParser</a>. + </font> </p> - </body> -</html> +<?php + +require("foot.inc.php"); + +?> Index: header.inc.php =================================================================== RCS file: /cvsroot/tslogparser/web/header.inc.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- header.inc.php 25 Nov 2004 14:26:05 -0000 1.1.1.1 +++ header.inc.php 12 Jan 2005 15:49:02 -0000 1.2 @@ -1,47 +1,28 @@ <?php -if (!isset($_PAGE["title"])) - die("Incorrect page inclusion.\n"); -?> -<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>TsLogParser Project</title> - <link rel="stylesheet" type="text/css" href="my.css"> - </head> - <body link="#1c3388" vlink="#1c3388" alink="#1c3388"> - <table align="center" bgcolor="#fefefe" border="0" width="100%" cellspacing="0" cellpadding="0"> - <tr> - <td height="30" bgcolor="#A2C0DF" colspan="2"> - <center> - <h1><font color="#fffffe">TestSuite Log Parser and Browser</font></h1> - </center> - </td> - </tr> - <tr> - <td colspan="2" align="center"> - <table border='0' cellspacing='0' cellpadding='0' width='100%'> - <tr> - <td width=300 align=left><img src="bos.jpg" height=112></td> - <td align="center"><h2><?php echo $_PAGE["title"]; ?></h2></td> - <td width=300 align=right><img src="bos-rev.jpg" height=112></td> - </tr> - </table> - </td> - </tr> - <tr> - <td width="91" bgcolor="#A2C0DF" valign="top"> -<?php -require("menu.inc.php"); -?> - </td> - <td valign="top"> +/* + * Copyright (c) 2005, Bull S.A.. All rights reserved. + * Created by: Sebastien Decugis - <table border="0" width="100%"> - <tr> - <td colspan=3> </td> - </tr> - <tr> - <td> </td> - <td width='100%'> + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write the Free Software Foundation, Inc., 59 + * Temple Place - Suite 330, Boston MA 02111-1307, USA. + */ + +/* We load the session module here */ +require_once($root."session.inc.php"); + +/* The L&F is grabbed from the website's */ +$_PAGE["title"] = "DEMO: ".$_PAGE["title"]; + +require("head.inc.php"); + +?> --- NEW FILE: foot.inc.php --- <?php /* * Copyright (c) 2004, Bull S.A.. All rights reserved. * Created by: Sebastien Decugis * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. */ if (!isset($_PAGE["title"])) die("Incorrect page inclusion.\n"); ?> </td> <td> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> </td> </tr> </table> <hr width="100%"> <p>Page hosted by : <br> <a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=124567&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo"> </a> </p> </body> </html> --- NEW FILE: report.php --- <?php /* * Copyright (c) 2005, Bull S.A.. All rights reserved. * Created by: Sebastien Decugis * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. */ /* The goal of this file is to give detailed content of OPTS runs. Inputs: -> run ID(s). If one run ID is given, the full detail of the run is given. If 2 or more run IDs are given, a comparison is made. Output: -> html report of the differences between all the runs. Future extensions: -> ability to select a subset of the routines only (with domains in the database) -> Summary of the results (X tests passed, Y test FAILED, ...) -> Ability to show only the summary -> Extend the "hide passed" function to something like "show only PASSED, show only HUNG" ... with the possibility to select what status to display (select from the summary, for example) */ //echo "<pre>\n"; //print_r($_POST); //echo "</pre>\n"; $root=""; require($root."database.inc.php"); require($root."functions.inc.php"); $_PAGE["title"]="Reporting Tool"; require($root."header.inc.php"); /* Verify that the page was not opened directly */ if (!isset($_POST["opts_rel"])) die("<p>No valid parameter found. Please use <a href='run-browse.php'>this page</a>.</p>\n</body></html>\n"); /* We check for correct parameters */ $mode=""; if (isset($_POST["compare"]) && isset($_POST["chkd_runs"])) { if (count($_POST["chkd_runs"]) <= 1) die("<p>Multiple releases comparison not implemented yet. <a href='run-browse.php'>Back</a></p>\n</body></html>\n"); $mode="COMPARE"; } $run_id = 0; if (isset($_POST["browse"])) { if (count($_POST["browse"]) != 1) die("<p>Invalid parameter supplied. <a href='run-browse.php'>Back</a></p>\n</body></html>\n"); $mode="BROWSE"; foreach ($_POST["browse"] as $key => $trash) $run_id = $key; } if ($mode =="") die("<p>No valid parameter found. Please use <a href='run-browse.php'>this page</a>.</p>\n</body></html>\n"); /* Remove unusefull POST variables */ if (isset($_POST["noasserts"])) { unset($_POST["asserts"]); unset($_POST["noasserts"]); } if (isset($_POST["nodetails"])) { unset($_POST["details"]); unset($_POST["nodetails"]); } if (isset($_POST["filter"]) && ($_POST["filter"]=="Show")) { unset($_POST[$_POST["filtered"]]); } if (isset($_POST["filter"])) unset($_POST["filter"]); if (isset($_POST["filtered"])) unset($_POST["filtered"]); if (isset($_POST["nologs"]) || ($mode!="BROWSE")) { unset($_POST["logs"]); unset($_POST["nologs"]); } /* Save the useful variables to allow page re-generation */ $POST_context=""; foreach ($_POST as $key => $val) if (is_array($_POST[$key])) foreach ($val as $subkey => $subval) $POST_context .=" <input type='hidden' name='".$key."[".$subkey."]' value='$subval'>\n"; else $POST_context.=" <input type='hidden' name='$key' value='$val'>\n"; /* We have a correct set of parameters, so we show the control panel */ echo " <form method=POST>\n"; echo $POST_context; // simplified session management echo " <table border=0 width=\"100%\">\n"; echo " <tr>\n"; echo " <td>Commands:</td>\n"; echo " <td><input type='submit' name='reload' value='Reload'></td>\n"; /* Displayed only for mode COMPARE */ if ($mode == "COMPARE") { if (isset($_POST["details"])) echo " <td><input type='submit' name='nodetails' value='Hide common results'></td>\n"; else echo " <td><input type='submit' name='details' value='Show common results'></td>\n"; } /* Displayed only for mode BROWSE */ if ($mode == "BROWSE") { if (isset($_POST["logs"])) echo " <td><input type='submit' name='nologs' value='Hide logs'></td>\n"; else echo " <td><input type='submit' name='logs' value='Show logs'></td>\n"; } /* Displayed in both modes */ if (isset($_POST["asserts"])) echo " <td><input type='submit' name='noasserts' value='Hide assertions'></td>\n"; else echo " <td><input type='submit' name='asserts' value='Show assertions'></td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </form>\n"; /* Whatever the mode is, we need to query the database with the same informations */ db_init(); $cond = ""; if ($mode == "BROWSE") $cond .= "res_run=$run_id"; if ($mode == "COMPARE") { $cond .= " ( (0) "; foreach ($_POST["chkd_runs"] as $run_id) $cond .= " OR (res_run=$run_id) "; $cond .= " ) "; } $sql = " SELECT run_name, res_status, count(res_status) as cnt_status" ." FROM opts_run, opts_run_results " ." WHERE opts_run.run_id = opts_run_results.res_run" ." AND ". $cond ." GROUP BY run_name, res_status"; db_query($sql, $stats_rs); $stats=array(); while ($row = db_getline($stats_rs)) $stats[$row["res_status"]][$row["run_name"]] = $row["cnt_status"]; $sql = " SELECT ver_name, run_name, res_run, assert_id, descr_id, rou_name, descr_info, res_status, " .(isset($_POST["logs"])?"res_log ":"res_log<>\"\" as is_res_log ") .(isset($_POST["asserts"])?", assert_text":"") ." FROM opts_versions, opts_run, opts_routines, opts_run_results, opts_version_descriptions, " ." opts_assertions " ." WHERE " ." opts_run.run_id = opts_run_results.res_run" ." AND opts_run_results.res_testcase = opts_version_descriptions.descr_id" ." AND opts_version_descriptions.descr_version = opts_versions.ver_id" ." AND opts_version_descriptions.descr_assert = opts_assertions.assert_id" ." AND opts_assertions.assert_routine = opts_routines.rou_id " ." AND ". $cond; //$res = db_execute_select($sql); db_query($sql, $res); /* Hash the results */ $data=array(); $asserts=array(); $runs=array(); //foreach ($res as $key => $row) $displayed=0; while ($row = db_getline($res)) { if ($mode != "BROWSE" || !isset($_POST[str_replace (' ','_',$row["res_status"])])) { $data[$row["rou_name"]][$row["assert_id"]][$row["descr_info"]][$row["descr_id"]][$row["run_name"]]=array( "status" => $row["res_status"], "log" => isset($_POST["logs"])?trim($row["res_log"]):$row["is_res_log"]); $displayed++; } $runs[$row["run_name"]]=array("id"=>$row["res_run"],"testsuite"=>$row["ver_name"]); if (isset($_POST["asserts"])) $asserts[$row["rou_name"]][$row["assert_id"]]=$row["assert_text"]; } db_fini(); /* In case we are comparing several runs, we filter out the results which are the same for all runs */ if (($mode == "COMPARE") && !(isset($_POST["details"]))) { foreach ($data as $routine => $assertsdata) foreach ($assertsdata as $assert_id => $testdata) foreach ($testdata as $testname => $desc_data) foreach ($desc_data as $desc_id => $run_data) { $tmpres=""; $diff=0; foreach ($run_data as $run_name => $detail) { if (!$tmpres) $tmpres=$detail["status"]; // save the status of the 1st test elseif ($tmpres != $detail["status"]) $diff=1; // we found a difference, we must not delete this one } if (!$diff) { unset ($data[$routine][$assert_id][$testname][$desc_id]); // No difference in this testcase $displayed--; } // we cascade-delete the empty tree branchs if (!$data[$routine][$assert_id][$testname]) unset($data[$routine][$assert_id][$testname]); if (!$data[$routine][$assert_id]) unset($data[$routine][$assert_id]); if (!$data[$routine]) unset($data[$routine]); if (!$data) die("The runs are identical -- aborted"); } } ksort($runs); ksort($data); //echo "<pre>\n"; //print_r($data); //echo "</pre>\n"; /* Print the statistics and filter command panel */ echo " <table border='1'>\n"; echo " <tr>\n"; echo " <td align='center'><b><i>Statistics / status</i></b></td>\n"; foreach ($runs as $run => $dummy) echo " <td align='center'><b>".stringFromDB($run)."</b></td>\n"; if ($mode == "BROWSE") echo " <td align='center'><b>Filtering</b></td>\n"; echo " </tr>\n"; foreach ($stats as $status => $stats_data) { echo " <tr>\n"; echo " <td align='center'>"; $font=0; if (ereg("(PASS|SKIP)", $status)) { echo "<font color='green'>"; $font=1; } if (ereg("(FAIL|INTERRUPTED|HUNG)", $status)) { echo "<font color='red'>"; $font=1; } if (ereg("(UNRESOLVED)", $status)) { echo "<font color='orange'>"; $font=1; } if (ereg("(UNSUPPORTED|UNTESTED)", $status)) { echo "<font color='black'>"; $font=1; } echo stringFromDB($status); if ($font) echo "</font>"; echo "</td>\n"; foreach ($runs as $run => $dummy) { echo " <td align='center'>"; if (isset($stats_data[$run])) echo $stats_data[$run]; else echo "0"; echo "</td>\n"; } if ($mode == "BROWSE") { echo " <td align='center'>\n"; echo " <form method='POST'>\n"; echo $POST_context; echo " <input type='hidden' name='".str_replace (' ','_',$status)."' value='hidden'>\n"; echo " <input type='hidden' name='filtered' value='".str_replace (' ','_',$status)."'>\n"; echo " <input type='submit' name='filter' value='"; if (isset($_POST[str_replace (' ','_',$status)])) echo "Show"; else echo "Hide"; echo "'>\n"; echo " </form>\n"; echo " </td>\n"; } echo " </tr>\n"; } echo " <tr>\n"; echo " <td colspan='".(count($runs)+(($mode=="BROWSE")?2:1))."'>"; echo " <i>Currently displayed: <b>$displayed</b></td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </form>\n"; echo " <hr width='30%'>\n"; /* Print the run details */ echo " <table border='1'>\n"; echo " <tr>\n"; echo " <td><b>Routine</b></td>\n"; echo " <td><b>File</b></td>\n"; foreach ($runs as $run => $trash) echo " <td><b>".stringFromDB($run)."</b></td>\n"; if (isset($_POST["logs"])) echo " <td><b>Log</b></td>\n"; if (isset($_POST["asserts"])) echo " <td><b>Assertion detail</b></td>\n"; echo " </tr>\n"; /* Display results */ $anomalies=0; foreach ($data as $routine => $rou_data) { echo " <tr>\n"; echo " <td"; $count=0; foreach($rou_data as $assert_data) $count += count($assert_data); if ($count > 1) echo " rowspan='".$count."'"; echo ">".stringFromDB($routine)."</td>\n"; $first=1; $anomalie=0; foreach ($rou_data as $assert_id => $assert_data) { $assert_first=1; $countTC = count($assert_data); foreach ($assert_data as $testcase => $test_data) { if (count($test_data) > 1) { $anomalie=1; $anomalies++; } foreach ($test_data as $testid => $run_data) { if (!$first) echo " <tr>\n"; echo " <td>".stringFromDB($testcase).($anomalie?" (*)":"")."</td>\n"; foreach ($runs as $run => $run_data_bis) { echo " <td>"; if (!isset($run_data[$run])) echo " "; else { $font=0; echo "<a href=\"detailed.php?run_id=".$run_data_bis["id"]."&testcase_id=".$testid."\">"; if (ereg("(PASS|SKIP)", $run_data[$run]["status"])) { echo "<font color='green'>"; $font=1; } if (ereg("(FAIL|INTERRUPTED|HUNG)", $run_data[$run]["status"])) { echo "<font color='red'>"; $font=1; } if (ereg("(UNRESOLVED)", $run_data[$run]["status"])) { echo "<font color='orange'>"; $font=1; } if (ereg("(UNSUPPORTED|UNTESTED)", $run_data[$run]["status"])) { echo "<font color='black'>"; $font=1; } echo stringFromDB($run_data[$run]["status"]); if ((!isset($_POST["logs"])) && $run_data[$run]["log"]) echo " (log)"; if ($font) echo "</font>"; echo "</a>"; } echo "</td>\n"; if (isset($_POST["logs"])) { echo " <td><pre>"; echo strip_tags(stringFromDB($run_data[$run]["log"])); echo " </pre></td>\n"; } } if (isset($_POST["asserts"]) && $assert_first) echo " <td".($countTC>1?" rowspan=$countTC":"")."><pre>".strip_tags(stringFromDB(wordwrap($asserts[$routine][$assert_id])))."</pre></td>\n"; echo " </tr>\n"; $first=0; $assert_first=0; } } } } echo " </table>\n"; unset($data); unset($runs); require($root."footer.inc.php"); ?> |
From: Sebastien D. <sde...@us...> - 2005-01-12 15:49:17
|
Update of /cvsroot/tslogparser/web/admin/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23666/admin/modules Added Files: opts.mod.php Log Message: Include the tool on the website --- NEW FILE: opts.mod.php --- <?php /* * Copyright (c) 2005, Bull S.A.. All rights reserved. * Created by: Sebastien Decugis * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. */ /* This module is for use with the Open POSIX Test Suite. Based on code from earlier TSLogParser releases. */ /* The following class contains the routines for the XML parser used later */ class opts_xml_routines { var $assertion; var $xml_parser; var $debug=0; /* The functions below are used within the XML parser -- see PHP doc for more info */ function startElement($parser, $name, $attrs) { if ($this->debug) echo "startElement($name)\n"; if ($name == "ASSERTION") { $this->assertion["cur"]=$attrs["ID"]; $this->assertion[$attrs["ID"]]=""; } } function endElement($parser, $name) { if ($this->debug) echo "endElement($name)\n"; if ($name == "ASSERTION") $this->assertion["cur"]=-1; } function characterData($parser, $data) { if ($this->debug) echo $data; if (($this->assertion["cur"] != -1) && (trim($data))) $this->assertion[$this->assertion["cur"]] .= $data."\n"; } /* This function is called for each assertions.xml file */ function parse_assertions($file) { /* Open the file for reading */ if ($this->debug) echo "Opening <i>$file</i>\n"; if (!($fp = fopen($file, "r"))) { die("could not open XML input"); } /* Create the XML parser */ $this->assertion = array("cur"=>-1); $this->xml_parser = xml_parser_create(); xml_set_object($this->xml_parser, $this); xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, true); xml_set_element_handler($this->xml_parser, "startElement", "endElement"); xml_set_character_data_handler($this->xml_parser, "characterData"); /* Parse the file */ while ($data = fread($fp, 4096)) { if ($this->debug) echo "Raw:<hr>".htmlentities($data)."<hr>\n"; if (!xml_parse($this->xml_parser, $data, feof($fp))) { die(sprintf("XML error: %s at line %d<br>\nin ".$file, xml_error_string(xml_get_error_code($this->xml_parser)), xml_get_current_line_number($this->xml_parser))); } } /* Clean up the XML parser */ xml_parser_free($this->xml_parser); unset($this->assertion["cur"]); /* return */ return $this->assertion; } } class opts { /* module_info will return an HTML-formated text (enclosed in <p> and </p> tags) describing the module and the testsuite it supports. All information related to the module (version, known bugs, ...) are suitable for this function (think of it as the only documentation for the module). */ function module_info($what="") { $title = "<b>Open POSIX Test Suite</b> parser module for <b>TSLogParser</b>"; $text = "<p>$title</p>\n"; $text.= "<p>Release: <b>0.1</b> 2004/12/31</p>\n"; $text.= "<p>Limitations and known problems: \n"; $text.= "<ul>\n<li>In case an assertion.xml file is malformed, the XML parser will fail\n"; $text.= " For this reason, you need a recent Open POSIX Test Suite release (1.5.0 is OK)\n"; $text.= "</li></ul></p>\n"; $text.= "<p>See the <a href='http://posixtest.sourceforge.net/'>test suite homepage</a> for more information.</p>\n"; if ($what == "title") return $title; /* default to all */ return $text; } /* TS_parse will check for the directory TS_path and analyse its content. In case a correct testsuite structure is found, the testsuite is parsed and put into the database with name and description as provided. The return value is $true if success and $false otherwise. */ function TS_parse(&$parent, $TS_name, $TS_description, $path) { if ( $parent->debug ) echo "opts->TS_parse($TS_name, $TS_description, $path)\n"; $xmlparser = new opts_xml_routines(); $opts_tree=array(); $regexp_testcase="^([0-9]*)-([0-9]*|.*buildonly)\.(c|sh)$"; /* Check the directory contains a coherent structure */ if ((!is_dir($path)) || (!is_dir($path."/conformance"))) { $parent->last_error="Directory '$path' does not contain a valid source tree.\n"; return FALSE; } /* Open and browse the tree */ $dh = opendir($path."/conformance/"); if (!$dh) { $parent->last_error="Failed to open directory $path/conformance/ for reading.\n"; return FALSE; } while (($file = readdir($dh)) !== false) { if (($file == ".") || ($file == "..") || ($file == "CVS")) continue; if (is_dir($path."/conformance/".$file)) { $dh2 = opendir($path."/conformance/".$file); if (!$dh2) { $parent->last_error= "Failed to open directory $path/conformance/$file for reading.\n"; return FALSE; } while (($file2 = readdir($dh2)) !== false) { if (($file2 == ".") || ($file2 == "..") || ($file2 == "CVS")) continue; $file2array=array($file2); /* Special case: headers sys/mman.h etc... */ if (($file == "definitions") && ($file2 == "sys")) { $dh2b = opendir($path."/conformance/definitions/sys"); if (!$dh2b) { $parent->last_error= "Failed to open dir $path/conformance/definitions/sys for reading.\n"; return FALSE; } $file2array=array(); while (($file2b = readdir($dh2b)) !== false) { if (($file2b == ".") || ($file2b == "..") || ($file2b == "CVS")) continue; $file2array[]="sys/".$file2b; } closedir($dh2b); } foreach ($file2array as $file2) { if (is_dir($path."/conformance/".$file."/".$file2)) { $dh3 = opendir($path."/conformance/".$file."/".$file2); if (!$dh3) { $parent->last_error= "Failed to open directory $path/conformance/$file/$file2 for reading.\n"; return FALSE; } $assertion_file = 0; while (($file3 = readdir($dh3)) !== false) { if (($file3 == ".") || ($file3 == "..") || ($file3 == "CVS")) continue; /* We're looking for "assertions.xml" files */ if ($file3 == "assertions.xml") { $assertion_file = 1; continue; } /* We also keep track of every testcase file */ if (ereg($regexp_testcase, $file3, $regs)) $opts_tree[$file][$file2]["testcase"][$regs[1]][(int)$regs[2]]=$regs[1]."-".$regs[2].".".$regs[3]; /* Last but not least, we want the speculative tests in the database */ if ($file3 == "speculative") { $dh4 = opendir($path."/conformance/".$file."/".$file2."/".$file3); if (!$dh4) { $parent->last_error= "Failed to open directory $path/conformance/$file/$file2/speculative for reading.\n"; return FALSE; } while (($file4 = readdir($dh4)) !== false) { if (($file4 == ".") || ($file4 == "..") || ($file4 == "CVS")) continue; if (ereg($regexp_testcase, $file4, $regs)) $opts_tree[$file][$file2]["testcase"][$regs[1]][(int)$regs[2]]="speculative/".$regs[1]."-".$regs[2].".".$regs[3]; } closedir($dh4); } } closedir($dh3); /* We now parse the assertions */ if ($assertion_file) { $opts_tree[$file][$file2]["assertions"]=$xmlparser->parse_assertions($path."/conformance/".$file."/".$file2."/assertions.xml"); } } } } closedir ($dh2); } } closedir($dh); /* We've parsed the whole tree */ if ($parent->debug > 1) print_r($opts_tree); /* The database shall be initialized here */ if (!is_db_init()) { $parent->last_error="Database was not initialized\n"; return FALSE; } /* Check no release with the same name already exist */ $releases=query_version($TS_name, 1); if ($releases) { $parent->last_error= "The release '$TS_name' is already in the database \n". "<i>".stringFromDB($releases[$TS_name]["ver_comment"])."</i>\n"; return FALSE; } /* Now, compare the $opts_tree with the $current_asserts and build up the list of assertions to be added to the database.*/ $current_routines=query_routines(); /* We start with looking for missing routines */ $missing_routines=array(); /* browse the new release assertions */ foreach ($opts_tree as $domain) { foreach ($domain as $routine=>$asserts) { /* If the routine name is missing from opts_routines table, we'll add it */ if (!isset($current_routines[$routine])) $missing_routines[]=$routine; } } if ($parent->debug > 1) print_r($missing_routines); /* If any routine is missing, it must be added previously to further processing */ if ($missing_routines) { echo "New routines are being added to the database...\n"; $counter=0; foreach ($missing_routines as $routine) { $sql = "INSERT INTO opts_routines ( rou_name, rou_comment ) " ."VALUES ( ".stringToDB($routine)."," .stringToDB("Added on ".date("F j, Y")." with release '$TS_name'")." )"; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; if (db_execute_insert($sql)) $counter++; else echo "Failed to add $routine to the database...\n"; } echo "Done. <b>$counter</b> routine have been added.\n\n"; $current_routines=query_routines(); } $current_asserts=query_all_asserts(); $missing_assertions=array(); /* browse the new release assertions */ foreach ($opts_tree as $domain) { foreach ($domain as $routine=>$asserts) { /* Check if the routine is already in the database */ if (!isset($current_asserts[$routine])) { if (!isset($current_routines[$routine])) { $parent->last_error="Internal script error: routine $routine was not added in 1st pass"; return FALSE; } /* We now schedule addition of the assertions for this routine, as none was already defined */ foreach ($asserts["assertions"] as $id => $assert) { $missing_assertions[]=array( "routine"=>$routine, "assert"=>$assert, "oldid"=>$id); } } else { foreach ($asserts["assertions"] as $id => $assert) { /* Check if this assertion text was already in the database */ if(!in_array($assert, $current_asserts[$routine])) $missing_assertions[]=array( "routine"=>$routine, "assert"=>$assert, "oldid"=>$id); } } } } if ($parent->debug > 1) print_r($missing_assertions); /* If any assertion is missing, it must be added previously to further processing */ if ($missing_assertions) { echo "New assertions are being added to the database...\n"; $counter=0; foreach ($missing_assertions as $assertion) { $sql = "INSERT INTO opts_assertions ( assert_routine, assert_text ) " ."VALUES ( ".$current_routines[$assertion["routine"]]["routine_id"]."," .stringToDB($assertion["assert"])." )"; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; if (db_execute_insert($sql)) $counter++; else echo "Failed to add assertion ".$assertion["oldid"]." of ".$assertion["routine"]." to the database...\n"; } echo "Done. <b>$counter</b> assertions have been added.\n\n"; $current_asserts=query_all_asserts(); } /* OK, we can now create the new release of OPTS in the database */ $sql="INSERT INTO opts_versions (ver_name, ver_comment) " . "VALUES ( ".stringToDB($TS_name).", " . stringToDB($TS_description)." )"; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; if (!db_execute_insert($sql)) { $parent->last_error= "Failed to insert new version in the database\n"; return FALSE; } /* We retrieve the new release uniqueID */ $releases=query_version($TS_name, 1); if (!$releases) { $parent->last_error= "Internal error: the new OPTS version was not created\n"; return FALSE; } if ($parent->debug > 1) print_r($current_asserts); /* We can create the full release description */ $release_description = array(); $missing_test=0; foreach ($opts_tree as $domain) { foreach ($domain as $routine=>$asserts) { if (!isset($current_asserts[$routine]) || !isset($current_routines[$routine])) { $parent->last_error= "Internal script error: routine $routine was not added in 1st pass"; return FALSE; } /* We now schedule addition of the assertions for this routine, as none was already defined */ foreach ($asserts["assertions"] as $id => $assert) { if (!isset($asserts["testcase"][$id])) $missing_test++; else { foreach ($asserts["testcase"][$id] as $number => $infos) { $release_description[]=array( "descr_assert" => array_search($assert, $current_asserts[$routine]), "descr_num_assert" => $id, "descr_num_test" => $number, "descr_info" => $infos); } unset($asserts["testcase"][$id]); } } if (isset($asserts["testcase"])) foreach($asserts["testcase"] as $id => $tcinfos) echo "<b>Warning</b>, $routine's test $id-* has no matching assertions and therefore will be ignored.\n"; } } if ($missing_test) echo "\n<i>Info:</i> $missing_test assertions are not tested.\n\n"; /* We've enough information now; we can create the release */ reset($releases); $rlstmp=current($releases); $release_id=$rlstmp["ver_id"]; $counter=0; foreach ($release_description as $testcase) { $sql = "INSERT INTO opts_version_descriptions " ." (descr_version, descr_assert, descr_num_assert, descr_num_test, descr_info)" ." VALUES (".$release_id.", " .$testcase["descr_assert"].", " .$testcase["descr_num_assert"].", " .$testcase["descr_num_test"].", " .stringToDB($testcase["descr_info"])." )"; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; if (db_execute_insert($sql)) $counter++; else echo "Failed to execute: ".htmlentities($sql)."\n"; } echo "<b><i>$counter testcases have been added</i></b>\n\n"; echo "Process terminated.\n"; return TRUE; } function TS_delete(&$parent, $TS_id) { if ( $parent->debug ) echo "opts->TS_delete($TS_id)\n"; /* Check there is no run within this testsuite */ $sql = "SELECT * from opts_run_results, opts_version_descriptions" ." WHERE res_testcase=descr_id" ." AND descr_version=".$TS_id; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $tmp = db_execute_select($sql); if ($tmp) { $parent->last_error="The testsuite contains runs -- cannot be deleted.\n Delete the runs first.\n"; return FALSE; } /* Check the testsuite is an OPTS one */ $sql = "SELECT ver_module from opts_versions" ." WHERE ver_id=".$TS_id; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $tmp = db_execute_select($sql); if (!$tmp) { $parent->last_error="The testsuite cannot be found in the database.\n"; return FALSE; } if ($tmp[0]["ver_module"] != "opts") { $parent->last_error="The testsuite is not an OPTS -- cannot be deleted within the current module.\n"; return FALSE; } /* Now, delete the testsuite description */ $sql = "DELETE from opts_version_descriptions" ." WHERE descr_version=".$TS_id; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $tmp = db_execute_insert($sql); echo "$tmp rows deleted from opts_version_descriptions<br>\n"; /* and the testsuite name */ $sql = "DELETE from opts_versions" ." WHERE ver_id=".$TS_id; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $tmp = db_execute_insert($sql); if ($tmp == 0) { $parent->last_error="No row deleted in opts_version\n"; return FALSE; } if ($parent->debug > 1) echo "$tmp rows deleted from opts_version<br>\n"; return true; } function RUN_parse(&$parent, $RUN_name, $RUN_description, $TS_id, &$CONTENT) { if ( $parent->debug ) echo "opts->RUN_parse($RUN_name, $RUN_description, $TS_id, ...".strlen($CONTENT)."c...)\n"; /* Check this TS id first */ $sql = "SELECT ver_id, ver_name, ver_comment, ver_module FROM opts_versions WHERE ver_id=$TS_id"; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $release = db_execute_select($sql); if (!$release) { $parent->last_error="The provided testsuite ID was not found in database\n"; return false; } if ($release[0]["ver_module"] != "opts") { $parent->last_error="This testsuite's ID is not of type Open POSIX Test Suite. Aborted.\n"; return false; } /* Check that run name is free */ $sql = "SELECT run_id, run_name, run_comments FROM opts_run WHERE run_name LIKE ".stringToDB($RUN_name); if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $res = db_execute_select($sql); if ($res) { $elem=$res[0]; $parent->last_error ="The test run '$RUN_name' is already in the database\n"; $parent->last_error.="<i>".stringFromDB($elem["run_comments"])."</i>\n"; return false; } /* The trick for parsing the logfile is matching with a perl regexp */ $log_data=array(); $regexp = "/conformance\/" ."\w+\/" /* definition, interface, ... */ ."((sys\/)?" /* special case for headers <sys/...> */ ."\w+)\/" /* routine name matching */ ."(speculative\/)?" /* we also want speculative tests */ ."(\d*)-(\d*):" /* test name */ ."\s*(build|link|execution):" /* Status type */ ."\s*(FAILED|PASS|SKIP|UNSUPPORTED|UNTESTED|HUNG|INTERRUPTED|UNRESOLVED)" /* status */ ."\s*:*\s*/"; $num_match = 7; /* This is the number of grouping directives in this regexp */ /* Actually parse the logfile */ $temp_array=preg_split($regexp, $CONTENT, -1, PREG_SPLIT_DELIM_CAPTURE); if ( $parent->debug > 4 ) print_r($temp_array); if (count($temp_array) % ($num_match+1) != 1) { $parent->last_error="Regexp match error.\nInvalid logfile format -- expecting opts."; return false; } /* See preg_split documentation for more information on the data here */ for ($idx=1; isset($temp_array[$idx]); $idx+=($num_match+1)) { $log_data[]=array( "routine" => $temp_array[$idx+0], "assert_num" => $temp_array[$idx+3], "test_num" => $temp_array[$idx+4], "status" => $temp_array[$idx+5]." ".$temp_array[$idx+6], "log" => $temp_array[$idx+7] ); } /* free some resources */ unset($CONTENT); unset($temp_array); if ( $parent->debug > 1 ) print_r($log_data); /* We're done with the file parsing. */ /* Next step is to eliminate duplicates and match testcases with database definition */ /* We'll need the routine list */ $routines=query_routines(); if (!$routines) { $parent->last_error="Failed to get routines list from database"; return false; } /* We also need this testsuite complete definition */ $sql = "SELECT descr_id, assert_routine, descr_num_assert, descr_num_test" ." FROM opts_version_descriptions, opts_assertions" ." WHERE opts_version_descriptions.descr_assert=opts_assertions.assert_id" ." AND descr_version=$TS_id"; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $opts_definition_tmp = db_execute_select($sql); if (!$opts_definition_tmp) { $parent->last_error="The OPTS release description was not found in database.\n"; return false; } /* We hash the result for efficiency */ $opts_definition = array(); foreach($opts_definition_tmp as $record) $opts_definition [$record["assert_routine"]] [$record["descr_num_assert"]] [$record["descr_num_test"]] =$record["descr_id"]; unset($opts_definition_tmp); /* We're ready to proceed: * -> walk through the log file (analyzed) * -> foreach test, find the corresponding description ID * -> save a record with the information: description ID, test status, test log. * -> this will then be used to generate the database entries. */ $result = array(); foreach ($log_data as $record) { if (!isset($opts_definition [$routines[$record["routine"]]["routine_id"]] [$record["assert_num"]] [$record["test_num"]])) echo "The test ".$record["routine"]."/".$record["assert_num"]."-".$record["test_num"]." was not found in the database -- ignored\n"; else $result[$opts_definition [$routines[$record["routine"]]["routine_id"]] [$record["assert_num"]] [$record["test_num"]] ]=array( "status"=>$record["status"], "log" =>$record["log"]); } /* We can trash everything else :) */ unset ($routines); unset ($opts_definition); unset ($log_data); echo "\n<b>".count($result)."</b> test results can be inserted in the results database.\n\n"; /* Now we've got to add the new run name in the database and get its ID */ $sql = "INSERT INTO opts_run ( run_name, run_comments )" ." VALUES ( ".stringToDB($RUN_name).", ".stringToDB($RUN_description)." )"; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $res = db_execute_insert($sql); if (!$res) { $parent->last_error="Failed to insert new run name"; return false; } $sql = "SELECT run_id, run_name, run_comments FROM opts_run WHERE run_name LIKE ".stringToDB($RUN_name); if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $res = db_execute_select($sql); if (!$res) { $parent->last_error="Internal error: the run was inserted but disappeared\n"; return false; } $run_id=$res[0]["run_id"]; $counter=0; foreach($result as $desc_id => $testdata) { $sql = "INSERT INTO opts_run_results ( res_run, res_testcase, res_status, res_log )" ." VALUES ( $run_id, $desc_id, ".stringToDB($testdata["status"]).", " .stringToDB($testdata["log"])." )"; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; if (db_execute_insert($sql)) $counter++; else echo "<b><i>Failed to execute the following instruction</i></b>; skipping.\n$sql\n"; } echo "<b>$counter</b> records added to the database!\n"; return true; } function RUN_delete(&$parent, $RUN_id) { if ( $parent->debug ) echo "opts->RUN_delete($RUN_id)\n"; /* Check this run belongs to an OPTS testsuite */ $sql = "SELECT ver_module FROM opts_versions, opts_version_descriptions, opts_run_results" ." WHERE res_run=$RUN_id" ." AND res_testcase=descr_id AND descr_version=ver_id" ." GROUP BY ver_module"; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $tmp = db_execute_select($sql); if (!$tmp) { $parent->last_error="The run ID or corresponding testsuite cannot be found in the database.\n"; return FALSE; } if ($tmp[0]["ver_module"] != "opts") { $parent->last_error="The testsuite is not an OPTS -- cannot be deleted within the current module.\n"; return FALSE; } /* We can delete everything related to this run */ $sql = "DELETE from opts_run_results " ."WHERE res_run=$RUN_id"; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $tmp = db_execute_insert($sql); if ($tmp == 0) { $parent->last_error="No row deleted in opts_run_results\n"; return FALSE; } if ($parent->debug > 1) echo "$tmp rows deleted from opts_run_results<br>\n"; $sql = "DELETE from opts_run " ."WHERE run_id=$RUN_id"; if ($parent->debug > 1) echo htmlentities($sql)."<br>\n"; $tmp = db_execute_insert($sql); if ($tmp == 0) { $parent->last_error="No row deleted in opts_run\n"; return FALSE; } if ($parent->debug > 1) echo "$tmp row deleted from opts_run<br>\n"; return true; } } /* Return the class name so it is added to the catalog */ return("opts"); ?> |