Initial add of defaria.com
[clearscm.git] / defaria.com / GD / Rantest / index.php
1 <?php
2 ////////////////////////////////////////////////////////////////////////////////
3 //
4 // File:        index.php
5 // Revision:    1.2
6 // Description: Main index page for Rantest
7 // Author:      Andrew@ClearSCM.com
8 // Created:     Mon Apr 28 15:20:06 MST 2008
9 // Modified:    
10 // Language:    PHP
11 //
12 // (c) Copyright 2008, General Dynamics, all rights reserved.
13 //
14 // All rights reserved except as subject to DFARS 252.227-7014 of contract
15 // number CP02H8901N issued under prime contract N00039-04-C-2009.
16 //
17 // Warning: This document contains technical data whose export is restricted
18 // by the Arms Export Control Act (Title 22, U.S.C., Sec 2751, et seq.) or the
19 // Export Administration Act of 1979, as amended, Title, 50, U.S.C., App. 2401
20 // et seq. Violations of these export laws are subject to severe criminal
21 // penalties. Disseminate in accordance with provisions of DoD Directive
22 // 5230.25.
23 //
24 ////////////////////////////////////////////////////////////////////////////////
25 $script = basename ($_SERVER["PHP_SELF"]);
26 include_once "$_SERVER[DOCUMENT_ROOT]/php/Utils.php";
27 include_once "$_SERVER[DOCUMENT_ROOT]/php/RantestDB.php";
28 OpenDB();
29
30 $testNames              = getTestNames();
31 $days                   = getdays();
32 $ran_versions           = getVersions ("ran_version");
33 $latestDate             = YMD2MDY (getLatestDate ());
34 $earliestDate           = YMD2MDY (getEarliestDate ());
35 ?>
36 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
37    "http://www.w3.org/TR/html4/strict.dtd">
38 <html>
39 <head>
40   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
41   <link rel="stylesheet" type="text/css" media="screen" href="/css/Testing.css">
42   <link rel="stylesheet" type="text/css" media="screen" href="/css/Tables.nohover.css">
43   <title>RANTEST: RAN Tool for Execution of System Tests</title>
44 </head>
45
46 <body>
47
48 <?php
49   print banner ();
50 ?>
51
52   <h1 align=center><font class="standout">RAN T</font>ool for <font class="standout">E</font>xecution of <font class="standout">S</font>ystem <font class="standout">T</font>ests</h1>
53
54   <table width="95%" align="center">
55     <thead>
56       <tr>
57         <th colspan=2 class="top"><big>Execution Reports</big><br>
58 <?php
59 print "Status for $latestDate: ";
60 print stats();
61 ?>
62 </th>
63       </tr>
64     </thead>
65     <tbody>
66       <tr>
67         <td class="shaded" width=50%>
68           <b>Test History</b><br>
69           <small>How often a test case has run, with pass/fail status<br><br>
70           <form action="TestHistory.php">
71           <table class="shaded" align="center">
72             <thead>
73               <tr>
74                 <th class="left">Build</th>
75                 <th>Level</th>
76                 <th>DUT</th>
77                 <th class="right">Test</th>
78               </tr>
79             </thead>
80             <tbody>
81               <tr class="white">
82                 <td>
83                   <select name=build class=inputfield>
84                     <option selected=selected>*</option>
85                     <option>b1</option>
86                     <option>b2</option>
87                     <option>b3</option>
88                   </select>
89                 </td>
90                 <td>
91                   <select name=level class=inputfield>
92                     <option selected=selected>*</option>
93                     <option>l3</option>
94                     <option>l4</option>
95                     <option>fqt</option>
96                   </select>
97                 </td>
98                 <td>
99                   <select name=DUT class=inputfield>
100                     <option selected=selected>*</option>
101                     <option>ran</option>
102                     <option>rnc</option>
103                     <option>rbs</option>
104                     <option>rcg</option>
105                   </select>
106                 </td>
107                 <td><input type=text name=test size=10 class=inputfield value="*"></input></td>
108               </tr>
109               <tr class="white">
110                 <td colspan=4 align=center>
111                   <input type=submit value="Report">
112                 </td>
113               </tr>
114             </tbody>
115           </table>
116           </form>
117         </td>
118         <td class="shaded">
119           <b>Version per Testcase</b><br>
120           <small>For a given test case, what was the test environment (software version of each of the test equipment and RBS/RNC)</small><br><br>
121           <form action="VersionPerTestcase.php">
122           <table class="shaded" align="center">
123             <thead>
124               <tr>
125                 <th class=left>Build</th>
126                 <th>Level</th>
127                 <th>DUT</th>
128                 <th class=right>Test</th>
129               </tr>
130             </thead>
131             <tbody>
132               <tr class="white">
133                 <td>
134                   <select name=build class=inputfield>
135                     <option selected=selected>*</option>
136                     <option>b1</option>
137                     <option>b2</option>
138                     <option>b3</option>
139                   </select>
140                 </td>
141                 <td>
142                   <select name=level class=inputfield>
143                     <option selected=selected>*</option>
144                     <option>l3</option>
145                     <option>l4</option>
146                     <option>fqt</option>
147                   </select>
148                 </td>
149                 <td>
150                   <select name=DUT class=inputfield>
151                     <option selected=selected>*</option>
152                     <option>ran</option>
153                     <option>rnc</option>
154                     <option>rbs</option>
155                     <option>rcg</option>
156                   </select>
157                 </td>
158                 <td><input type=text name=test size=10 class=inputfield value="*"></input></td>
159               </tr>
160               <tr class="white">
161                 <td colspan=4 align=center>
162                   <input type=submit value="Report">
163                 </td>
164               </tr>
165             </tbody>
166           </table>
167           </form>
168         </td>
169       </tr>
170       <tr class="white">
171         <td>
172           <b>Testcase per Version</b><br>
173           <small>What test cases have run against a given RBS/RNC/RAN software version<br><br>
174           <form action="TestcasePerVersion.php">
175             RAN Version:
176             <select name=version class=inputfield>
177 <?php
178   foreach ($ran_versions as $version) {
179     print "<option>$version</option>\n";
180   } // foreach
181 ?>
182             </select>
183             <input type=submit value="Report">
184           </form>
185           </small>
186         </td>
187         <td width=50%>
188           <b>Test Statistics</b><br>
189           <small>Number of test cases run over a given period with pass/fail status<br><br>
190           <form action="TestStats.php">
191             From: 
192             <select name=start class=inputfield>
193 <?php
194   foreach ($days as $day) {
195     print "<option";
196
197     if ($day == $earliestDate) {
198       print " selected=selected";
199     } // if
200
201     print ">$day</option>\n";
202   } // foreach
203 ?>
204             </select>
205             To: 
206             <select name=end class=inputfield>
207 <?php
208   foreach ($days as $day) {
209     print "<option";
210
211     if ($day == $latestDate) {
212       print " selected=selected";
213     } // if
214
215     print ">$day</option>\n";
216   } // foreach
217 ?>          </select>
218             <input type=submit name="action" value="Report">&nbsp;
219             <input type=submit name="action" value="Graph">
220             </small>
221           </form>
222         </td>
223       </tr>
224       <tr>
225         <td class="shaded" width=50%>
226           <b>Failure Analysis</b><br>
227           <small>Show the reasons for failure<br><br>
228           <form action="FailureAnalysis.php">
229             <select name=day class=inputfield>
230 <?php
231   foreach ($days as $day) {
232     print "<option";
233
234     if ($day == $latestDate) {
235       print " selected=selected";
236     } // if
237
238     print ">$day</option>\n";
239   } // foreach
240 ?>          </select>
241             <input type=submit name="action" value="Report">
242             </small>
243           </form>
244         </td>
245         <td class="shaded">
246           <b>Daily Test Report</b><br>
247           <form action="rantest.php">
248           <small>What test automation ran on:<br><br>
249             <select name=day class=inputfield>
250 <?php
251   foreach ($days as $day) {
252     print "<option>$day</option>\n";
253   } // foreach
254 ?>      
255             </select>
256             <input type=submit value="Report">
257           </form>
258         </td>
259       </tr>
260       <tr class="white" align="center">
261         <td colspan="2">
262 <?php
263 exec ("ls /east/seast1/testlogs/nightly*log /east/seast1/testlogs/ranscrub.log", &$nightly_logs, &$status);
264
265 if ($status != 0) {
266   print "Unable to do ls /east/seast1/testlogs/nightly*log (Status: $status)";
267 } else {
268   $count = count ($nightly_logs);
269   $nbr = 1;
270
271   if ($count > 0) {
272     print "<h3>Nightly logs</h3>";
273     foreach ($nightly_logs as $nightly_log) {
274       preg_match ("/\/east\/seast1\/testlogs\/(.*)\.log/", $nightly_log, &$matches);
275
276       print "<a href=\"/testlogs/$matches[1].log\">$matches[1]</a>";
277
278       if (--$count > 0) {
279         if ($nbr++ % 5 == 0) {
280           print "|<br>";
281         } else {
282           print "&nbsp;|&nbsp;";
283         } // if
284       } // if
285     } // foreach
286   } // if
287 } // if
288 ?>
289         </td>
290       </tr>
291     </tbody>
292   </table>
293
294 <?php copyright();?>
295 </body>
296 </html>