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-06-29 14:37:41
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15780 Modified Files: HISTORY report.php run-browse.php Log Message: New feature: comparison between different testsuites Index: run-browse.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/run-browse.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- run-browse.php 12 Jan 2005 15:25:13 -0000 1.6 +++ run-browse.php 29 Jun 2005 14:37:30 -0000 1.7 @@ -171,14 +171,20 @@ } else { + echo " <form method='POST' action='report2.php'>\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($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 " rowspan=\"".(count($data["runs"])+1)."\""; echo ">\n"; echo " <font color='orange'>".stringFromDB($release)."</font>\n"; echo " </td>\n"; @@ -189,22 +195,11 @@ 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 " <input type='checkbox' name='chkd_runs[]' value='".$run_id."'>\n"; echo " </td>\n"; echo " <td>\n"; echo " ".stringFromDB($run_data["name"])."\n"; @@ -217,20 +212,20 @@ 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"; } } + echo " <tr>\n"; + echo " <td>\n"; + echo " \n"; + echo " </td>\n"; + echo " <td colspan='3' align=left>\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> Index: report.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/report.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- report.php 12 Jan 2005 15:25:13 -0000 1.5 +++ report.php 29 Jun 2005 14:37:30 -0000 1.6 @@ -37,9 +37,6 @@ */ -//echo "<pre>\n"; -//print_r($_POST); -//echo "</pre>\n"; $root=""; require($root."database.inc.php"); @@ -49,17 +46,17 @@ 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"); +//echo "<pre>\n"; +//print_r($_POST); +//echo "</pre>\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"; } @@ -209,7 +206,7 @@ { 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( + $data[$row["rou_name"]][$row["descr_info"]][$row["assert_id"]][$row["descr_id"]][$row["run_name"]]=array( "status" => $row["res_status"], "log" => isset($_POST["logs"])?trim($row["res_log"]):$row["is_res_log"]); $displayed++; @@ -225,35 +222,42 @@ /* 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 ($data as $routine => $testdata) + foreach ($testdata as $testname => $assertsdata) + { + $tmpres=""; + $diff=0; + $count = 0; + foreach ($assertsdata as $assert_id => $desc_data) foreach ($desc_data as $desc_id => $run_data) - { - $tmpres=""; - $diff=0; foreach ($run_data as $run_name => $detail) { + $count++; 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) + + if ((!$diff) && ($count == count($runs))) + { + foreach ($assertsdata as $assert_id => $desc_data) + foreach ($desc_data as $desc_id => $run_data) { - unset ($data[$routine][$assert_id][$testname][$desc_id]); // No difference in this testcase + unset ($data[$routine][$testname][$assert_id][$desc_id]); // No difference in this testcase $displayed--; + // we cascade-delete the empty tree branchs + if (!$data[$routine][$testname][$assert_id]) unset($data[$routine][$testname][$assert_id]); + if (!$data[$routine][$testname]) unset($data[$routine][$testname]); + if (!$data[$routine]) unset($data[$routine]); + if (!$data) + die("The runs are identical -- aborted"); } - // 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($runs); ksort($data); //echo "<pre>\n"; @@ -362,29 +366,38 @@ echo " <tr>\n"; echo " <td"; $count=0; - foreach($rou_data as $assert_data) - $count += count($assert_data); + foreach($rou_data as $test_data) + $count += count($test_data); if ($count > 1) echo " rowspan='".$count."'"; echo ">".stringFromDB($routine)."</td>\n"; $first=1; $anomalie=0; - foreach ($rou_data as $assert_id => $assert_data) + foreach ($rou_data as $testcase => $test_data) { - $assert_first=1; - $countTC = count($assert_data); - foreach ($assert_data as $testcase => $test_data) + $test_first=1; + + if (!$first) + echo " <tr>\n"; + if ($test_first) { + echo " <td"; if (count($test_data) > 1) + echo " rowspan=".count($test_data); + echo ">".stringFromDB($testcase).($anomalie?" (*)":"")."</td>\n"; + } + + foreach ($test_data as $assert_id => $assert_data) + { + $assert_first=1; + $countTC = count($assert_data); + if ($countTC > 1) { $anomalie=1; $anomalies++; } - foreach ($test_data as $testid => $run_data) + foreach ($assert_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>"; @@ -433,6 +446,7 @@ echo " </tr>\n"; $first=0; $assert_first=0; + $test_first=0; } } } Index: HISTORY =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/HISTORY,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- HISTORY 14 Jun 2005 12:42:46 -0000 1.28 +++ HISTORY 29 Jun 2005 14:37:30 -0000 1.29 @@ -1,3 +1,8 @@ +2005-06-29: +- Mods in run-browse.php and report.php to allow comparison + between several test suite releases. This has to be tested with the OPTS + module (OK with TAHI). + 2005-06-14: - Fix in detailed.php: add <pre> tags around assertion text and remove strip_tags around log details. |
From: Sebastien D. <sde...@us...> - 2005-06-14 13:30:42
|
Update of /cvsroot/tslogparser/tslogparser/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2264 Modified Files: index.php Log Message: Fix upload size for large HA results Index: index.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/index.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- index.php 14 Jun 2005 12:42:47 -0000 1.14 +++ index.php 14 Jun 2005 13:30:31 -0000 1.15 @@ -277,7 +277,7 @@ { /* Output the new testsuite form */ echo "<form enctype=\"multipart/form-data\" method=\"POST\">\n"; - echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"8388608\">"; + echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"16777216\">"; 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"; @@ -536,7 +536,7 @@ { /* Output the new testsuite form */ echo "<form enctype=\"multipart/form-data\" method=\"POST\">\n"; - echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"8388608\">"; + echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"16777216\">"; echo " <input type=\"hidden\" name=\"action\" value=\"2\">\n"; echo " <input type=\"hidden\" name=\"add_run\" value=\"add\">\n"; echo " <input type=\"hidden\" name=\"tsid\" value=\"".$_GET["tsid"]."\">\n"; |
From: Sebastien D. <sde...@us...> - 2005-06-14 13:11:43
|
Update of /cvsroot/tslogparser/tslogparser/admin/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25458/admin/modules Modified Files: tahi.mod.php Log Message: Fix for HA functions Index: tahi.mod.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/modules/tahi.mod.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- tahi.mod.php 14 Jun 2005 12:42:47 -0000 1.3 +++ tahi.mod.php 14 Jun 2005 13:11:34 -0000 1.4 @@ -150,7 +150,7 @@ /* The format should be either &print:<B>(test category hierarchy)</B> or - (file):(anything):(anything):(anything):(test name): + (file):(anything):(anything):(anything):(test name):(anything) */ $regs=array(); if (preg_match("/^&print:\s*<B>(.*)\<\/B>$/", $ligne, $regs)) @@ -188,7 +188,7 @@ } - if (preg_match("/^([^:]+):[^:]*:[^:]*:[^:]*:([^:]+):?$/",$ligne,$regs)) + if (preg_match("/^(?:&#)?([^:]+):[^:]*:[^:]*:[^:]*:([^:]+)(:.*)?$/",$ligne,$regs)) { $match = TRUE; //if ($debug) |
From: Sebastien D. <sde...@us...> - 2005-06-14 13:11:43
|
Update of /cvsroot/tslogparser/tslogparser/package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25458/package Modified Files: tslogparser.spec Log Message: Fix for HA functions Index: tslogparser.spec =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/package/tslogparser.spec,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- tslogparser.spec 14 Mar 2005 14:56:06 -0000 1.9 +++ tslogparser.spec 14 Jun 2005 13:11:34 -0000 1.10 @@ -7,9 +7,9 @@ # rpmbuild --target noarch-redhat-linux -ta tslogparser-*.tar.gz %define name tslogparser -%define version 0.6 -%define release 2 -%define filename tslogparser-v06 +%define version 0.7 +%define release 1 +%define filename tslogparser-v07 %define tslp_user tslogparser %define tslp_group tslogparser |
From: Sebastien D. <sde...@us...> - 2005-06-14 13:11:42
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25458 Modified Files: PACKAGING Log Message: Fix for HA functions Index: PACKAGING =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/PACKAGING,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- PACKAGING 2 Feb 2005 01:20:32 -0000 1.1 +++ PACKAGING 14 Jun 2005 13:11:33 -0000 1.2 @@ -1,5 +1,7 @@ This file describes how to create packages for TsLogParser. +See also package/tslogparser.spec file for more information. + RPM Packaging ============= These directions may require some adaptation to your distro. They were |
From: Sebastien D. <sde...@us...> - 2005-06-14 12:42:57
|
Update of /cvsroot/tslogparser/tslogparser/admin/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6286/admin/modules Modified Files: tahi.mod.php Log Message: Changes for TAHI support Index: tahi.mod.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/modules/tahi.mod.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tahi.mod.php 10 Jun 2005 14:50:32 -0000 1.2 +++ tahi.mod.php 14 Jun 2005 12:42:47 -0000 1.3 @@ -46,11 +46,9 @@ === Table opts_routines rou_id : 198 - rou_name : Normal Operations - Registration - rou_comment: NULL + rou_name : 2.2 + rou_comment: Processing Mobility Headers -- Receiving CoTI - Note: the rou_comment could contain complete hierarchy of test categories. - === Table opts_assertions assert_id : 1466 assert_routine : 198 @@ -71,30 +69,68 @@ descr_assert : 1466 descr_num_asser : 1 descr_num_test : 1 - descr_info : CN-1-1 + descr_info : ./CN-1-1.seq Note: descr_num_assert is not usefull for this module - we put dummy values. descr_num_test is obtained from the INDEX file (# of test) + === Table opts_run + run_id : 20 + run_name : Mipl2-rc2 without IPsec + run comment : configuration file available at http://... + + === Table opts_run_results + res_run : 20 + res_testcase : 6435 + res_status : PASS + res_log : (contenu du fichier 1.html) + + */ -/* The following function parses the file $complete_path/INDEX and saves the +/* The following function parses the file $root/$ts_type/INDEX and saves the result into $tahi_tree. It returns TRUE on success and FALSE on failure. */ -function parse_INDEX(&$tahi_tree, $complete_path, $debug) +function parse_INDEX(&$tahi_tree, $root, $ts_type, $debug) { - /* The format of $tahi_tree is as follows: */ + /* The format of $tahi_tree is as follows: + + $tahi_tree=array( + "mipv6-mn-0" => array( + "name" => "Basic Sequence" + "tests" => array( + 1 => array( + "filename" => "./MN-0-0-0-1-001.seq" + "testname" => "MN-0-0-0-1-001 - Mobile Node Operation-1" + "content" => (file content) + ) + 2 => array( + "filename" => ... + ) + ) + ) + "mipv6-mn-14/4" => array( + "name" => "Mobile to Mobile / Binding Error" + "tests" => array( + 116 => ... + ) + + + */ if ($debug) - echo "parse_INDEX($complete_path)\n"; + echo "parse_INDEX($root/$ts_type)\n"; /* Read the file */ - $fichier = file($complete_path."/INDEX"); + $fichier = file("$root/$ts_type/INDEX"); - $hierarchy = "default"; + $cur_hierarchy = $ts_type; + $cur_level = 0; + $tab_hierarchy=array(); + $counter = 0; /* Browse the file content */ foreach ($fichier as $ligne) @@ -120,21 +156,36 @@ if (preg_match("/^&print:\s*<B>(.*)\<\/B>$/", $ligne, $regs)) { $match = TRUE; - //if ($debug) - // echo "Hierarchy: ".htmlentities($regs[1])."\n"; $hierarchy = str_replace(" ", " ", trim(strip_tags($regs[1]))); + //if ($debug) + // echo "Hierarchy: ".htmlentities($hierarchy)."\n"; /* We are looking for hierarchical information: n. <blablah> => level 1 n.m. <blablah> => level 2 (n) <blabla> => sublevel */ + if (preg_match("/^(\d+)\.\s(.*)$/", $hierarchy,$regs)) + { + $cur_level=$regs[1]; + $cur_hierarchy=$regs[2]; + $tab_hierarchy[$cur_level]=$cur_hierarchy; + } + if (preg_match("/^(\d+)\.(\d+)\.\s(.*)$/", $hierarchy,$regs)) + { + $cur_level=$regs[1].".".$regs[2]; + $cur_hierarchy=$tab_hierarchy[$regs[1]]." -- ".$regs[3]; + $tab_hierarchy[$cur_level]=$cur_hierarchy; + } + $tmp_level = $cur_level; + $tmp_hierarchy=$cur_hierarchy; + + if (preg_match("/^\((\d+)\)\s(.*)$/", $hierarchy,$regs)) + { + $tmp_level=$cur_level."/".$regs[1]; + $tmp_hierarchy=$cur_hierarchy." / ".$regs[2]; + } - // TEMP: at this time, we only keep the top of the stack - $tahi_tree[]=array( - "hierarchy" => $hierarchy - "tests" => array() - ); } if (preg_match("/^([^:]+):[^:]*:[^:]*:[^:]*:([^:]+):?$/",$ligne,$regs)) @@ -142,13 +193,31 @@ $match = TRUE; //if ($debug) // echo "Test info: ".htmlentities($regs[1]." => ".$regs[2])."\n"; + + $counter++; + + if (!isset($tahi_tree[$ts_type."-".$tmp_level])) + $tahi_tree[$ts_type."-".$tmp_level]=array( + "name" => $tmp_hierarchy, + "tests" => array() + ); + + $tahi_tree[$ts_type."-".$tmp_level]["tests"][$counter]=array( + "filename" => $regs[1], + "testname" => $regs[2], + "content" => file_get_contents("$root/$ts_type/".$regs[1]) + ); + } if (!$match) echo "Ignored the following line: ".htmlentities($ligne)."\n"; } - return FALSE; +// if ($debug) +// print_r($tahi_tree); + + return TRUE; } @@ -229,12 +298,11 @@ $found = TRUE; /* Now we found the file we were looking for: $path/$file/INDEX */ - if (! parse_INDEX($tahi_tree, $path."/".$file, $parent->debug)) + if (! parse_INDEX($tahi_tree, $path, $file, $parent->debug)) { $parent->last_error= "Parsing of INDEX failed\n"; return FALSE; } - } closedir ($dh2); } @@ -248,7 +316,7 @@ /* We've parsed the whole tree */ - if ($parent->debug > 1) + if ($parent->debug > 2) print_r($tahi_tree); /* The database shall be initialized here */ @@ -263,26 +331,136 @@ if ($releases) { $parent->last_error= "The release '$TS_name' is already in the database \n". - "<i>".stringFromDB($releases[$TS_name]["ver_comment"])."</i>\n"; + "<i>(".stringFromDB($releases[$TS_name]["ver_comment"]).")</i>\n"; return FALSE; } /* Now, compare the $tahi_tree with the $current_tests and build up the list of tests to be added to the database.*/ + + + $current_categories=query_routines(); + + /* We start with looking for missing routines */ + $missing_category=array(); + /* browse the new release assertions */ + foreach ($tahi_tree as $category=>$data) + { + /* If the category is missing from opts_routines table, we'll add it */ + if (!isset($current_categories[$category])) + $missing_category[]=$category; + else /* check the category was not renumbered from the previous entered version */ + if ($data["name"] != $current_categories[$category]["routine_comment"]) + { + echo "Inconsistency found for category <b>$category</b><br>\n"; + echo "Old name: ".$current_categories[$category]["routine_comment"]."<br>\n"; + echo "New name: ".$data["name"]."\n"; + + $parent->last_error= "Unable to add $category to the database\n"; + return FALSE; + } + + } - /* If any routine is missing, it must be added previously to further processing */ + if ($parent->debug > 1) + print_r($missing_category); - /* browse the new release assertions */ + /* If any category is missing, it must be added previously to further processing */ + if ($missing_category) + { + echo "New categories of tests are being added to the database...\n"; + $counter=0; + foreach ($missing_category as $cat) + { + $sql = "INSERT INTO opts_routines ( rou_name, rou_comment ) " + ."VALUES ( ".stringToDB($cat)."," + .stringToDB($tahi_tree[$cat]["name"])." )"; + if ($parent->debug > 1) + echo htmlentities($sql)."<br>\n"; + if (db_execute_insert($sql)) + $counter++; + else + echo "Failed to add $cat to the database...\n"; + } + echo "Done. <b>$counter</b> categories have been added.\n\n"; + $current_categories=query_routines(); + } + + /* Now we are adding new tests if any */ + + $current_tests=query_all_asserts(); + $missing_tests=array(); + /* Check for existing tests */ + foreach ($tahi_tree as $cat => $cat_data) + { + if (!isset($current_tests[$cat])) + { + if (!isset($current_categories[$cat])) + { + $parent->last_error="Internal script error: category $cat was not added in 1st pass"; + return FALSE; + } + + /* We now schedule addition of these tests for this category, as none was already defined */ + foreach ($cat_data["tests"] as $test_data) + { + $missing_tests[]=array( + "cat"=>$cat, + "name"=>$test_data["testname"], + "file"=>$test_data["filename"], + "content"=>&$test_data["content"]); + } + } + else /* some tests were already defined in this category */ + { + foreach ($cat_data["tests"] as $test_data) + { + /* Check if this test content was already in the database */ + if(!in_array($test_data["content"], $current_tests[$cat])) + $missing_tests[]=array( + "cat"=>$cat, + "name"=>$test_data["testname"], + "file"=>$test_data["filename"], + "content"=>&$test_data["content"] + ); + } + } + } + if ($parent->debug > 1) + print_r($missing_tests); + /* If any assertion is missing, it must be added previously to further processing */ + if ($missing_tests) + { + echo "New tests are being added to the database...\n"; + $counter=0; + foreach ($missing_tests as $test) + { + $sql = "INSERT INTO opts_assertions ( assert_routine, assert_text ) " + ."VALUES ( ".$current_categories[$test["cat"]]["routine_id"]."," + .stringToDB($test["content"])." )"; + if ($parent->debug > 1) + echo htmlentities($sql)."<br>\n"; + if (db_execute_insert($sql)) + $counter++; + else + echo "Failed to add test ".$test["testname"]." (".$test["filename"].") to the database...\n"; + } + echo "Done. <b>$counter</b> tests have been added.\n\n"; + $current_tests=query_all_asserts(); + } + /* OK, we can now create the new release of TAHI in the database */ - $sql="INSERT INTO opts_versions (ver_name, ver_comment) " + $sql="INSERT INTO opts_versions (ver_name, ver_comment, ver_module) " . "VALUES ( ".stringToDB($TS_name).", " - . stringToDB($TS_description)." )"; + . stringToDB($TS_description).", " + . "'tahi' )"; 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"; @@ -297,12 +475,53 @@ $parent->last_error= "Internal error: the new TAHI version was not created\n"; return FALSE; } - if ($parent->debug > 1) - print_r($current_asserts); + if ($parent->debug > 2) + print_r($current_tests); /* We can create the full release description */ + $release_description = array(); + foreach ($tahi_tree as $cat => $cat_data) + { + if (!isset($current_tests[$cat]) || !isset($current_categories[$cat])) + { + $parent->last_error= "Internal script error: category $cat was not added in 1st pass"; + return FALSE; + } + + foreach ($cat_data["tests"] as $test_nr => $test_data) + { + $release_description[]=array( + "descr_assert" => array_search($test_data["content"], $current_tests[$cat]), + "descr_num_test" => $test_nr, + "descr_info" => $test_data["filename"]); + } + } /* 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"].", " + ."0, " + .$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; } @@ -376,6 +595,9 @@ { if ( $parent->debug ) echo "tahi->RUN_parse($RUN_name, $RUN_description, $TS_id, ...".strlen($CONTENT)."c...)\n"; + + /* We won't need the CONTENT var here -- we free some memory */ + unset($CONTENT); /* Check this TS id first */ $sql = "SELECT ver_id, ver_name, ver_comment, ver_module FROM opts_versions WHERE ver_id=$TS_id"; @@ -406,17 +628,195 @@ return false; } - /* Parse the results files */ + /* Parse the results files -- which shall be a tar.gz file. + -> uncompress the file into a temp directory + -> look for the results + -> parse these results + */ + + /* Set a longer execution time */ + set_time_limit(60); + + /* This is quite dirty... we simply ignore the CONTENT string. */ + $tar = new Archive_Tar($_FILES['logfile']['tmp_name']); + $tar->setErrorHandling(PEAR_ERROR_PRINT); + + $tmpdir = "../ts/".time(); + + if (!$tar->extractModify($tmpdir, "")) + { + $parent->last_error ="Archive extraction failed. Please provide the results as a 'tar.gz' file.\n"; + return false; + } + + /* Find directory name from inside archive, if any */ + /* 1 - check the files are inside a subdirectory */ + if (!is_file($tmpdir."/report.html")) + { + /* 2 - open the directory where files were extracted */ + if ($dh = opendir($tmpdir)) + { + /* 3 - list the files. We assume there is only 1 directory here */ + while (($file = readdir($dh)) !== false) + { + if (($file == ".") || ($file == "..")) + continue; + if (is_dir($tmpdir."/".$file)) + { + $tmpdir .= "/".$file; + break; + } + $parent->last_error ="Unexpected entry in archive: $file"; + return false; + } + /* 4 - close the directory */ + closedir($dh); + } + else + { + $parent->last_error = "Unable to open temporary directory $tmpdir"; + return FALSE; + } + } + + if (!is_file($tmpdir."/report.html")) + { + $parent->last_error = "Unable to find 'report.html' file in uploaded results."; + return FALSE; + } + + $log = file($tmpdir."/report.html"); + if (!$log) + { + $parent->last_error = "Unable to read '$tmpdir/report.html' file."; + return FALSE; + } + + /* Example of a tests status: + <TD>7</TD><TD><A HREF="./MN-3-3-1-1-003.html">MN-3-3-1-1-003 - Use Neighbor Unreachability Detection (Target Address=global)</A></TD><TD ALIGN="CENTER">PASS</TD><TD ALIGN="CENTER"><A HREF="7.html">X</A></TD><TD ALIGN="CENTER"><A HREF="./MN-3-3-1-1-003.seq">X</A></TD><TD ALIGN="CENTER"><A HREF="./mip6_mn_common.def">X</A></TD><TD ALIGN="CENTER"><A HREF="7.html.Link0.dump">Link0</A> </TD></TR> + <TD>4</TD><TD>CN-2-1-1 - Receiving HoTI - Invalid Mobility Option (Nonce Indices option)</TD><TD ALIGN="CENTER">PASS</TD><TD ALIGN="CENTER"><A HREF="4.html">X</A></TD><TD ALIGN="CENTER"><A HREF="./CN-2-1-1.seq">X</A></TD><TD ALIGN="CENTER"><A HREF="./mip6cnt.def">X</A></TD><TD ALIGN="CENTER"><A HREF="4.html.Link0.dump">Link0</A> </TD></TR> - /* Next step is to eliminate duplicates and match testcases with database definition */ + + What we try and match is: + <TD>(param1)</TD><TD><A HREF="(*)">(param2)</A></TD><TD ALIGN="CENTER">(param3)</TD><TD ALIGN="CENTER"><A HREF="(param4)">X</A></TD><TD ALIGN="CENTER"><A HREF="(param5)">X</A></TD><TD ALIGN="CENTER">(*)</TD><TD ALIGN="CENTER">(*)</TD></TR> + where: + param1: # of the test (format: numeric) + param2: Name of the test. + param3: Status + param4: log file + param5: filename of the testcase + */ + $test_results=array(); + + $regex = "/^<TD>" + ."(\d+)" // param1 + ."<\/TD>" + ."<TD>(?:<A HREF=\"[^\"]*\">)?" + ."(.*?)" // param2 + ."(?:<\/A>)?<\/TD>" + ."<TD ALIGN=\"CENTER\">" + ."(.*?)" // param3 + ."<\/TD>" + ."<TD ALIGN=\"CENTER\"><A HREF=\"" + ."(.*?)" // param4 + ."\">X<\/A><\/TD>" + ."<TD ALIGN=\"CENTER\"><A HREF=\"" + ."(.*?)" // param5 + ."\">X<\/A><\/TD>" + ."<TD ALIGN=\"CENTER\">.*?<\/TD>" + ."<TD ALIGN=\"CENTER\">.*?<\/TD>" + ."<\/TR>$/"; + + foreach ($log as $nr => $ligne) + { + /* Line parsing */ + if (preg_match($regex, $ligne, $regs)) + { + $test_results[$regs[1]]=array( + "name" => trim($regs[2]), + "status" => trim(strip_tags($regs[3])), + "log" => $tmpdir."/".$regs[4], + "filename" => trim($regs[5]) + ); + } + else + { + if ($parent->debug) + echo "Discarded: ".htmlentities($ligne)."\n"; + } + } + + /* We also need the release description from the database */ + $sql = "SELECT descr_id, descr_num_test, descr_info" + ." FROM opts_version_descriptions" + ." WHERE descr_version=$TS_id"; + if ($parent->debug > 1) + echo htmlentities($sql)."<br>\n"; + $version_description = db_execute_select($sql); + if (!$version_description) + { + $parent->last_error="The TAHI release description was not found in database.\n"; + return false; + } /* We're ready to proceed: - * -> walk through the log file (analyzed) - * -> foreach test, find the corresponding description ID + * -> walk through the release description + * -> foreach test, find the corresponding result * -> save a record with the information: description ID, test status, test log. * -> this will then be used to generate the database entries. */ + $parsed_results=array(); + $missing_results=array(); + foreach ($version_description as $record) + { + if (!isset($test_results[$record["descr_num_test"]])) + { + $missing_results[]=$record["descr_num_test"]; + continue; + } + if ($test_results[$record["descr_num_test"]]["filename"] != $record["descr_info"]) + { + echo "Test ".$record["descr_num_test"]." does not match database description (" + .$test_results[$record["descr_num_test"]]["filename"]." != " . $record["descr_info"].".\n" + ."Result ignored"; + continue; + } + /* Ok we found a corrsponding entry */ + $parsed_results[]=array( + "res_testcase" => $record["descr_id"], + "res_status" => $test_results[$record["descr_num_test"]]["status"], + "res_log" => $test_results[$record["descr_num_test"]]["log"] + ); + + /* remove this test result */ + unset($test_results[$record["descr_num_test"]]); + } + + if ($missing_results) + { + echo count($missing_results)." tests are missing from analyzed logfile.\n"; + if ($parent->debug) + { + echo "Missing tests results:\n"; + print_r($missing_results); + } + } + unset ($missing_results); + + if ($test_results) + { + echo count($test_results)." tests are missing from release description in database.\n"; + if ($parent->debug) + { + echo "Missing tests description:\n"; + print_r($test_results); + } + } + + unset($test_results); + + /* 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)." )"; @@ -440,8 +840,47 @@ } $run_id=$res[0]["run_id"]; + /* Add the records in opts_run_results */ - + $count=0; + foreach ($parsed_results as $entry) + { + $sql = "INSERT INTO opts_run_results " + ."(res_run, res_testcase, res_status, res_log) " + ." VALUES (" + .$run_id.", " + .$entry["res_testcase"].", " + .stringToDB($entry["res_status"]).", " + .stringToDB(html_entity_decode(file_get_contents($entry["res_log"]))).")"; + if ($parent->debug > 1) + echo htmlentities($sql)."<br>\n"; + $res = db_execute_insert($sql); + if (!$res) + echo "Failed to add record for test ".$entry["res_testcase"]."\n"; + else + $count++; + } + echo "$count results were inserted in the database.\n"; + + /* Delete the extracted tarball */ + 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); + return true; } @@ -481,8 +920,7 @@ $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"; + echo "$tmp rows deleted from opts_run_results<br>\n"; $sql = "DELETE from opts_run " ."WHERE run_id=$RUN_id"; @@ -494,8 +932,7 @@ $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"; + echo "$tmp row deleted from opts_run<br>\n"; return true; } |
From: Sebastien D. <sde...@us...> - 2005-06-14 12:42:57
|
Update of /cvsroot/tslogparser/tslogparser/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6286/db Modified Files: update_db.inc.php Log Message: Changes for TAHI support Index: update_db.inc.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/db/update_db.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- update_db.inc.php 10 Jan 2005 18:09:54 -0000 1.1 +++ update_db.inc.php 14 Jun 2005 12:42:47 -0000 1.2 @@ -18,7 +18,7 @@ /* This file defines the function update_db() */ -define('LATEST_VERSION', "1"); +define('LATEST_VERSION', "2"); /* Example of update routine */ // function db_v1_to_v2() @@ -30,13 +30,24 @@ // } +function db_v1_to_v2() +{ + $queries=array(); + $queries[]="ALTER TABLE `opts_run_results` CHANGE `res_log` `res_log` LONGTEXT DEFAULT NULL"; + $queries[]="UPDATE opts_config SET cfg_val='2' WHERE cfg_key='version'"; + execute_update_queries($queries); +} + + + + function update_db( $curver = 1 ) { $tmpver = $curver; /* This is the template for future database updates */ -// if ($tmpver == 1) -// $tmpver = db_v1_to_v2(); + if ($tmpver == 1) + $tmpver = db_v1_to_v2(); // if ($tmpver == 2) // $tmpver = db_v2_to_v3(); // ... |
From: Sebastien D. <sde...@us...> - 2005-06-14 12:42:57
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6286 Modified Files: HISTORY detailed.php functions.inc.php Log Message: Changes for TAHI support Index: functions.inc.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/functions.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- functions.inc.php 4 Jan 2005 17:46:13 -0000 1.3 +++ functions.inc.php 14 Jun 2005 12:42:46 -0000 1.4 @@ -154,7 +154,57 @@ function stringFromDB($string) { - return nl2br(htmlentities($string)); + $ret = htmlentities($string); + + $pattern=array(); + $replacement=array(); + + /* We want to authorize some tags */ + + /* First format: + * <TABLE ...></TABLE> + * <TR ...></TR> + * <TD ...></TD> + * <A ...></A> + * <FONT ...></FONT> + * <PRE ...></PRE> + */ + $pattern[]="/<(TABLE|TR|TD|A|FONT|PRE)(\s+.*?)?>(.*?)<\/\\1>/is"; + $replacement[]="<$1$2>$3</$1>"; + + /* Second format: + * <B></B> + * <H1></H1> + * <H2></H2> + * ... + * <I></I> + */ + $pattern[]="/<(B|I|U|H\d+|UL|OL|BLOCKQUOTE|TT|TBODY)>(.*?)<\/\\1>/is"; + $replacement[]="<$1>$2</$1>"; + + /* Third format: + * <BR> + * <HR> + */ + $pattern[]="/<(BR|HR|LI|\/LI)>/is"; + $replacement[]="<$1>"; + + /* Fourth format: + * + */ + $pattern[]="/&nbsp;/i"; + $replacement[]=" "; + + for (;;) + { + $tmp = preg_replace($pattern,$replacement,$ret); + if ($tmp == $ret) + break; + $ret = $tmp; + } + + + return $ret; } ?> Index: detailed.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/detailed.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- detailed.php 12 Jan 2005 15:25:08 -0000 1.4 +++ detailed.php 14 Jun 2005 12:42:46 -0000 1.5 @@ -82,7 +82,7 @@ <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> + <td valign="top"><pre><?php echo stringFromDB($res["assert_text"]); ?> </pre></td> </tr> <tr> <td valign="top" align="center"><b>Status</b></td> @@ -101,7 +101,7 @@ echo stringFromDB($res["res_status"]); if ($font) echo "</font>"; ?></td> - <td valign="top"><pre><?php echo strip_tags(stringFromDB($res["res_log"])); ?> </pre></td> + <td valign="top"><pre><?php echo stringFromDB($res["res_log"]); ?> </pre></td> </tr> </table> <?php Index: HISTORY =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/HISTORY,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- HISTORY 10 Jun 2005 12:45:42 -0000 1.27 +++ HISTORY 14 Jun 2005 12:42:46 -0000 1.28 @@ -1,3 +1,12 @@ +2005-06-14: +- Fix in detailed.php: add <pre> tags around assertion text and remove + strip_tags around log details. +- New feature in functions.inc.php: stringFromDB now accepts some HTML tags. +- Changed MAX_FILE_SIZE in admin/index.php from 2MB to 8MB. +- admin/modules/tahi.mod.php now almost complete (all features are here). +- Database upgrade: now version 2. Change opts_run_results.res_log type + from TEXT to LONGTEXT. Change is in db/update_db.inc.php. + 2005-06-10: - New file: admin/modules/tahi.mod.php (plugin for TAHI testsuite) - Fix in admin/index.php |
From: Sebastien D. <sde...@us...> - 2005-06-14 12:42:56
|
Update of /cvsroot/tslogparser/tslogparser/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6286/admin Modified Files: index.php Log Message: Changes for TAHI support Index: index.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/index.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- index.php 10 Jun 2005 12:41:56 -0000 1.13 +++ index.php 14 Jun 2005 12:42:47 -0000 1.14 @@ -277,7 +277,7 @@ { /* Output the new testsuite form */ echo "<form enctype=\"multipart/form-data\" method=\"POST\">\n"; - echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"2097152\">"; + echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"8388608\">"; 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"; @@ -536,7 +536,7 @@ { /* Output the new testsuite form */ echo "<form enctype=\"multipart/form-data\" method=\"POST\">\n"; - echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1048576\">"; + echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"8388608\">"; echo " <input type=\"hidden\" name=\"action\" value=\"2\">\n"; echo " <input type=\"hidden\" name=\"add_run\" value=\"add\">\n"; echo " <input type=\"hidden\" name=\"tsid\" value=\"".$_GET["tsid"]."\">\n"; |
From: Sebastien D. <sde...@us...> - 2005-06-10 14:50:40
|
Update of /cvsroot/tslogparser/tslogparser/admin/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26318 Modified Files: tahi.mod.php Log Message: tahi.mod.php to be continued... Index: tahi.mod.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/modules/tahi.mod.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tahi.mod.php 10 Jun 2005 12:45:43 -0000 1.1 +++ tahi.mod.php 10 Jun 2005 14:50:32 -0000 1.2 @@ -79,7 +79,78 @@ */ + +/* The following function parses the file $complete_path/INDEX and saves the + result into $tahi_tree. It returns TRUE on success and FALSE on failure. */ +function parse_INDEX(&$tahi_tree, $complete_path, $debug) +{ + /* The format of $tahi_tree is as follows: */ + + + if ($debug) + echo "parse_INDEX($complete_path)\n"; + + /* Read the file */ + $fichier = file($complete_path."/INDEX"); + + $hierarchy = "default"; + + /* Browse the file content */ + foreach ($fichier as $ligne) + { + /* Strip empty lines */ + if (!($ligne = trim($ligne))) + continue; + + /* Strip comments -- files starting with # or // as their first non-blank characters */ + if (preg_match("/^(#|\/\/)/", $ligne)) + continue; + + $match = FALSE; + //if ($debug) + // echo htmlentities($ligne)."\n"; + + /* The format should be either + &print:<B>(test category hierarchy)</B> + or + (file):(anything):(anything):(anything):(test name): + */ + $regs=array(); + if (preg_match("/^&print:\s*<B>(.*)\<\/B>$/", $ligne, $regs)) + { + $match = TRUE; + //if ($debug) + // echo "Hierarchy: ".htmlentities($regs[1])."\n"; + $hierarchy = str_replace(" ", " ", trim(strip_tags($regs[1]))); + + /* We are looking for hierarchical information: + n. <blablah> => level 1 + n.m. <blablah> => level 2 + (n) <blabla> => sublevel + */ + + // TEMP: at this time, we only keep the top of the stack + $tahi_tree[]=array( + "hierarchy" => $hierarchy + "tests" => array() + ); + } + + if (preg_match("/^([^:]+):[^:]*:[^:]*:[^:]*:([^:]+):?$/",$ligne,$regs)) + { + $match = TRUE; + //if ($debug) + // echo "Test info: ".htmlentities($regs[1]." => ".$regs[2])."\n"; + } + + if (!$match) + echo "Ignored the following line: ".htmlentities($ligne)."\n"; + } + + return FALSE; +} + class tahi { /* @@ -121,13 +192,64 @@ if ( $parent->debug ) echo "tahi->TS_parse($TS_name, $TS_description, $path)\n"; - /* Check the directory contains a coherent structure */ + $tahi_tree=array(); + $found=FALSE; + + /* Check the directory contains a coherent structure + We are looking for a file something/INDEX -- and are interested + in this something :) + + We browse each subdirectory until we find the file we + are looking for... + */ + + if (!is_dir($path) || !($dh = opendir($path))) + { + $parent->last_error="Directory '$path' is not readable -- check your archive format.\n"; + return FALSE; + } + + while (($file = readdir($dh)) !== false) + { + if (($file == ".") || ($file == "..") || ($file == "CVS") || !is_dir($path."/".$file)) + continue; + + $dh2 = opendir($path."/".$file); + if (!$dh2) + { + $parent->last_error= "Failed to open directory $path/$file for reading.\n"; + return FALSE; + } + + while (($file2 = readdir($dh2)) !== false) + { + if ($file2 != "INDEX") + continue; + + $found = TRUE; + + /* Now we found the file we were looking for: $path/$file/INDEX */ + if (! parse_INDEX($tahi_tree, $path."/".$file, $parent->debug)) + { + $parent->last_error= "Parsing of INDEX failed\n"; + return FALSE; + } + + } + closedir ($dh2); + } + closedir($dh); + + if (!$found) + { + $parent->last_error="Directory '$path' does not contain a file */INDEX -- unable to parse.\n"; + return FALSE; + } - /* Open and browse the tree */ /* We've parsed the whole tree */ if ($parent->debug > 1) - print_r($opts_tree); + print_r($tahi_tree); /* The database shall be initialized here */ if (!is_db_init()) |
From: Sebastien D. <sde...@us...> - 2005-06-10 12:46:10
|
Update of /cvsroot/tslogparser/tslogparser/admin/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24369/admin/modules Added Files: tahi.mod.php Log Message: New plugin file for TAHI tests results (incomplete) --- NEW FILE: tahi.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 TAHI Conformance Test Suite. It has been tested against the IPv6 Mobility test suite results: ct-mipv6-cn-3.1.2.tar.gz ct-mipv6-ha-3.1.2.tar.gz ct-mipv6-mn-3.1.1.tar.gz */ /* Here is a bit of design, for integration purpose. This is needed because the OPTS and TAHI do not have an exact same structure. Here is the mapping for information between TAHI and tslogparser database. -------------------- TAHI Test Suite description ----------------------- The testsuite description is extracted from the INDEX file. Also, the *.seq files are used. Here is the description of the process: The INDEX file has the following format: #, // starting lines are comments and are ignored. &print: lines are test categories, and are mapped to tslogparser routines concept. ./CN-1-1.seq: lines are test cases, and are mapped to tslogparser assertions concept. As an example here is a sample entry of a TAHI testsuite description: === Table opts_routines rou_id : 198 rou_name : Normal Operations - Registration rou_comment: NULL Note: the rou_comment could contain complete hierarchy of test categories. === Table opts_assertions assert_id : 1466 assert_routine : 198 asser_text : (here goes the full content of file CN-1-1.seq) Note: the CN-1-1.seq file contains the full description of the test, when available. === Table opts_versions ver_id : 4 ver_name : ct-mipv6-cn-3.1.2 ver_comment : IPv6 Mobility TAHI Test Suite for Correspondant Node functions + URL ver_module : tahi === Table opts_version_descriptions descr_id : 6435 descr_version : 4 descr_assert : 1466 descr_num_asser : 1 descr_num_test : 1 descr_info : CN-1-1 Note: descr_num_assert is not usefull for this module - we put dummy values. descr_num_test is obtained from the INDEX file (# of test) */ class tahi { /* 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>TAHI Conformance Test Suite</b> parser module for <b>TSLogParser</b>"; $text = "<p>$title</p>\n"; $text.= "<p>Release: <b>0.1</b> 2005/06/10</p>\n"; $text.= "<p>Limitations and known problems: \n"; $text.= "<ul>\n<li>Under development\n"; $text.= "<li>Tested only with :<ul>\n"; $text.= "<li>ct-mipv6-cn-3.1.2.tar.gz\n"; $text.= "<li>ct-mipv6-ha-3.1.2.tar.gz\n"; $text.= "<li>ct-mipv6-mn-3.1.1.tar.gz</ul>\n"; $text.= "</ul></p>\n"; $text.= "<p>See the <a href='http://www.tahi.org/mipv6/index.html'>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 "tahi->TS_parse($TS_name, $TS_description, $path)\n"; /* Check the directory contains a coherent structure */ /* Open and browse the tree */ /* 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 $tahi_tree with the $current_tests and build up the list of tests to be added to the database.*/ /* If any routine is missing, it must be added previously to further processing */ /* browse the new release assertions */ /* If any assertion is missing, it must be added previously to further processing */ /* OK, we can now create the new release of TAHI 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 TAHI version was not created\n"; return FALSE; } if ($parent->debug > 1) print_r($current_asserts); /* We can create the full release description */ /* We've enough information now; we can create the release */ return TRUE; } function TS_delete(&$parent, $TS_id) { if ( $parent->debug ) echo "tahi->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 a TAHI 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"] != "tahi") { $parent->last_error="The testsuite is not TAHI -- 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 "tahi->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"] != "tahi") { $parent->last_error="This testsuite's ID is not of type TAHI Conformance 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; } /* Parse the results files */ /* Next step is to eliminate duplicates and match testcases with database definition */ /* 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. */ /* 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"]; /* Add the records in opts_run_results */ return true; } function RUN_delete(&$parent, $RUN_id) { if ( $parent->debug ) echo "tahi->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"] != "tahi") { $parent->last_error="The testsuite is not TAHI -- 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("tahi"); ?> |
From: Sebastien D. <sde...@us...> - 2005-06-10 12:46:00
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24369 Modified Files: HISTORY Log Message: New plugin file for TAHI tests results (incomplete) Index: HISTORY =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/HISTORY,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- HISTORY 22 Apr 2005 08:47:42 -0000 1.26 +++ HISTORY 10 Jun 2005 12:45:42 -0000 1.27 @@ -1,3 +1,7 @@ +2005-06-10: +- New file: admin/modules/tahi.mod.php (plugin for TAHI testsuite) +- Fix in admin/index.php + 2005-04-22: - New file: admin/purge.php - set_time_limit(60) when adding new testsuite release. |
From: Sebastien D. <sde...@us...> - 2005-06-10 12:42:36
|
Update of /cvsroot/tslogparser/tslogparser/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21937 Modified Files: index.php Log Message: Fix bug when multiple modules defined Index: index.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/index.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- index.php 22 Apr 2005 08:47:52 -0000 1.12 +++ index.php 10 Jun 2005 12:41:56 -0000 1.13 @@ -803,8 +803,8 @@ $DATA[$run["ver_module"]]["TS"][$run["ver_name"]]["RUNS"][$run["run_id"]]= array( "run_name"=>$run["run_name"], "run_comments"=>$run["run_comments"]); - $DATA[$release["ver_module"]]["count"] += 1; - $DATA[$release["ver_module"]]["TS"][$run["ver_name"]]["count"] += 1; + $DATA[$run["ver_module"]]["count"] += 1; + $DATA[$run["ver_module"]]["TS"][$run["ver_name"]]["count"] += 1; } //echo "<hr><pre>\n"; |
From: Sebastien D. <sde...@us...> - 2005-04-25 07:42:31
|
Update of /cvsroot/tslogparser/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12738 Modified Files: footer.inc.php Log Message: Changed update frequency Index: footer.inc.php =================================================================== RCS file: /cvsroot/tslogparser/web/footer.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- footer.inc.php 12 Jan 2005 17:22:14 -0000 1.5 +++ footer.inc.php 25 Apr 2005 07:42:21 -0000 1.6 @@ -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>NOTE:<i>The database is restored from scratch every hour.</i></p> <p> <font size='-2' color='grey'> Generated with <a href="/index.php">TsLogParser</a>. |
From: Sebastien D. <sde...@us...> - 2005-04-22 09:15:11
|
Update of /cvsroot/tslogparser/web/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24457 Modified Files: index.php Log Message: Undid previous commit Index: index.php =================================================================== RCS file: /cvsroot/tslogparser/web/admin/index.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- index.php 22 Apr 2005 09:00:03 -0000 1.6 +++ index.php 22 Apr 2005 09:15:02 -0000 1.7 @@ -1,70 +1,954 @@ <?php -$_PAGE["title"] = "PROJECT HOME"; -require("head.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. + * [...988 lines suppressed...] + echo " </td>\n"; + echo " <td valign=\"top\" align=\"center\">\n"; + echo " <p><font size='-1'>".$run_data["run_comments"]."</font></p>\n"; + echo " <p><input type=\"submit\" name=\"edit_run\" value=\"Edit\"></p>\n"; + echo " </td>\n"; + echo " </form>\n"; + echo " </tr>\n"; + $tags = 2; + } + + $tags = 1; + } + } + +echo "</table>\n"; + +/* End of file */ +db_fini(); +require($root."footer.inc.php"); +?> |
From: Sebastien D. <sde...@us...> - 2005-04-22 09:00:13
|
Update of /cvsroot/tslogparser/web/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16990/admin Modified Files: index.php Log Message: fix index.php files Index: index.php =================================================================== RCS file: /cvsroot/tslogparser/web/admin/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- index.php 22 Apr 2005 08:48:03 -0000 1.5 +++ index.php 22 Apr 2005 09:00:03 -0000 1.6 @@ -1,954 +1,70 @@ <?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 [...988 lines suppressed...] - echo " </td>\n"; - echo " <td valign=\"top\" align=\"center\">\n"; - echo " <p><font size='-1'>".$run_data["run_comments"]."</font></p>\n"; - echo " <p><input type=\"submit\" name=\"edit_run\" value=\"Edit\"></p>\n"; - echo " </td>\n"; - echo " </form>\n"; - echo " </tr>\n"; - $tags = 2; - } - - $tags = 1; - } - } - -echo "</table>\n"; -/* End of file */ -db_fini(); -require($root."footer.inc.php"); -?> |
From: Sebastien D. <sde...@us...> - 2005-04-22 08:48:12
|
Update of /cvsroot/tslogparser/web/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10401 Modified Files: index.php Log Message: timelimit extended Index: index.php =================================================================== RCS file: /cvsroot/tslogparser/web/admin/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- index.php 14 Mar 2005 16:58:01 -0000 1.4 +++ index.php 22 Apr 2005 08:48:03 -0000 1.5 @@ -188,6 +188,9 @@ die(); } + /* Set a longer execution time */ + set_time_limit(60); + /* Try expanding the archive */ $tar = new Archive_Tar($_FILES['tsarchive']['tmp_name']); $tar->setErrorHandling(PEAR_ERROR_PRINT); |
From: Sebastien D. <sde...@us...> - 2005-04-22 08:48:02
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10305 Modified Files: HISTORY Log Message: New time limit on TS upload Index: HISTORY =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/HISTORY,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- HISTORY 22 Apr 2005 08:21:47 -0000 1.25 +++ HISTORY 22 Apr 2005 08:47:42 -0000 1.26 @@ -1,5 +1,6 @@ 2005-04-22: - New file: admin/purge.php +- set_time_limit(60) when adding new testsuite release. 2005-03-14: tag v06 - update tar.inc.php to match Tar 1.3.0 from PEAR. |
From: Sebastien D. <sde...@us...> - 2005-04-22 08:48:02
|
Update of /cvsroot/tslogparser/tslogparser/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10305/admin Modified Files: index.php Log Message: New time limit on TS upload Index: index.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/index.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- index.php 14 Mar 2005 14:55:06 -0000 1.11 +++ index.php 22 Apr 2005 08:47:52 -0000 1.12 @@ -188,6 +188,9 @@ die(); } + /* Set a longer execution time */ + set_time_limit(60); + /* Try expanding the archive */ $tar = new Archive_Tar($_FILES['tsarchive']['tmp_name']); $tar->setErrorHandling(PEAR_ERROR_PRINT); |
From: Sebastien D. <sde...@us...> - 2005-04-22 08:34:41
|
Update of /cvsroot/tslogparser/web/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3651 Modified Files: purge.php Log Message: purge.php fix Index: purge.php =================================================================== RCS file: /cvsroot/tslogparser/web/admin/purge.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- purge.php 22 Apr 2005 08:30:33 -0000 1.2 +++ purge.php 22 Apr 2005 08:34:32 -0000 1.3 @@ -30,8 +30,8 @@ /* We'll need functions defined in other files */ require($root."functions.inc.php"); -function rmdirRecursive($path,$followLinks=false) { - +function rmdirRecursive($path,$racine=false) { + $dir = opendir($path) ; while ( $entry = readdir($dir) ) { @@ -39,14 +39,16 @@ unlink( "$path/$entry" ); } elseif ( is_dir( "$path/$entry" ) && $entry!='.' && $entry!='..' ) { rmdirRecursive( "$path/$entry" ) ; + if ($racine) + echo "Removed ".$path/$entry."<br>\n"; } } closedir($dir) ; - if ($path != $root."ts/") + if (!$racine) return rmdir($path); } -rmdirRecursive($root."ts/"); +rmdirRecursive($root."ts/", true); require($root."footer.inc.php"); |
From: Sebastien D. <sde...@us...> - 2005-04-22 08:34:27
|
Update of /cvsroot/tslogparser/tslogparser/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3578/admin Modified Files: purge.php Log Message: Index: purge.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/purge.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- purge.php 22 Apr 2005 08:30:18 -0000 1.3 +++ purge.php 22 Apr 2005 08:34:15 -0000 1.4 @@ -30,8 +30,8 @@ /* We'll need functions defined in other files */ require($root."functions.inc.php"); -function rmdirRecursive($path,$followLinks=false) { - +function rmdirRecursive($path,$racine=false) { + $dir = opendir($path) ; while ( $entry = readdir($dir) ) { @@ -39,14 +39,16 @@ unlink( "$path/$entry" ); } elseif ( is_dir( "$path/$entry" ) && $entry!='.' && $entry!='..' ) { rmdirRecursive( "$path/$entry" ) ; + if ($racine) + echo "Removed ".$path/$entry."<br>\n"; } } closedir($dir) ; - if ($path != $root."ts/") + if (!$racine) return rmdir($path); } -rmdirRecursive($root."ts/"); +rmdirRecursive($root."ts/", true); require($root."footer.inc.php"); |
From: Sebastien D. <sde...@us...> - 2005-04-22 08:30:43
|
Update of /cvsroot/tslogparser/web/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2346 Modified Files: purge.php Log Message: purge.php fix Index: purge.php =================================================================== RCS file: /cvsroot/tslogparser/web/admin/purge.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- purge.php 22 Apr 2005 08:23:20 -0000 1.1 +++ purge.php 22 Apr 2005 08:30:33 -0000 1.2 @@ -36,14 +36,14 @@ while ( $entry = readdir($dir) ) { if ( is_file( "$path/$entry" ) || ((!$followLinks) && is_link("$path/$entry")) ) { - echo ( "unlink $path/$entry;\n" ); - // Uncomment when happy! - //unlink( "$path/$entry" ); + unlink( "$path/$entry" ); } elseif ( is_dir( "$path/$entry" ) && $entry!='.' && $entry!='..' ) { rmdirRecursive( "$path/$entry" ) ; } } closedir($dir) ; + if ($path != $root."ts/") + return rmdir($path); } rmdirRecursive($root."ts/"); |
From: Sebastien D. <sde...@us...> - 2005-04-22 08:30:31
|
Update of /cvsroot/tslogparser/tslogparser/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2115/admin Modified Files: purge.php Log Message: Index: purge.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/purge.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- purge.php 22 Apr 2005 08:23:32 -0000 1.2 +++ purge.php 22 Apr 2005 08:30:18 -0000 1.3 @@ -36,14 +36,14 @@ while ( $entry = readdir($dir) ) { if ( is_file( "$path/$entry" ) || ((!$followLinks) && is_link("$path/$entry")) ) { - echo ( "unlink $path/$entry;\n" ); - // Uncomment when happy! - //unlink( "$path/$entry" ); + unlink( "$path/$entry" ); } elseif ( is_dir( "$path/$entry" ) && $entry!='.' && $entry!='..' ) { rmdirRecursive( "$path/$entry" ) ; } } closedir($dir) ; + if ($path != $root."ts/") + return rmdir($path); } rmdirRecursive($root."ts/"); |
From: Sebastien D. <sde...@us...> - 2005-04-22 08:24:09
|
Update of /cvsroot/tslogparser/tslogparser/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32107/admin Modified Files: purge.php Log Message: Index: purge.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/purge.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- purge.php 22 Apr 2005 08:21:48 -0000 1.1 +++ purge.php 22 Apr 2005 08:23:32 -0000 1.2 @@ -44,9 +44,6 @@ } } closedir($dir) ; - echo "rmdir $path;\n"; - // Uncomment when happy! - // return rmdir($path); } rmdirRecursive($root."ts/"); |
From: Sebastien D. <sde...@us...> - 2005-04-22 08:23:28
|
Update of /cvsroot/tslogparser/web/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32035 Added Files: purge.php Log Message: purge.php added --- NEW FILE: purge.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 empties the upload directory. Use with care! */ $root="../"; $_PAGE["title"]="TSLP purge"; /* Output header page */ require($root."header.inc.php"); /* We'll need functions defined in other files */ require($root."functions.inc.php"); function rmdirRecursive($path,$followLinks=false) { $dir = opendir($path) ; while ( $entry = readdir($dir) ) { if ( is_file( "$path/$entry" ) || ((!$followLinks) && is_link("$path/$entry")) ) { echo ( "unlink $path/$entry;\n" ); // Uncomment when happy! //unlink( "$path/$entry" ); } elseif ( is_dir( "$path/$entry" ) && $entry!='.' && $entry!='..' ) { rmdirRecursive( "$path/$entry" ) ; } } closedir($dir) ; } rmdirRecursive($root."ts/"); require($root."footer.inc.php"); ?> |