Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 2008_01.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml"$>" />
11
12    <title>Status for Andrew DeFaria: January 2008 Archives</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/2007_12.html" title="December 2007" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/2008_02.html" title="February 2008" />
17 </head>
18 <body class="layout-one-column">
19    <div id="container">
20       <div id="container-inner" class="pkg">
21
22          <div id="banner">
23             <div id="banner-inner" class="pkg">
24                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
25                <h2 id="banner-description">Searchable status reports and work log</h2>
26             </div>
27          </div>
28
29          <div id="pagebody">
30             <div id="pagebody-inner" class="pkg">
31                <div id="alpha">
32                   <div id="alpha-inner" class="pkg">
33                      
34                      <p class="content-nav">
35                         <a href="http://defaria.com/blogs/Status/archives/2007_12.html">&laquo; December 2007</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/2008_02.html">February 2008 &raquo;</a>
38                      </p>
39                      
40                      
41                      <!--
42 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
43          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
44          xmlns:dc="http://purl.org/dc/elements/1.1/">
45 <rdf:Description
46     rdf:about="http://defaria.com/blogs/Status/archives/2008_01.html#entry-000695"
47     trackback:ping="http://defaria.com/mt/mt-tb.cgi/82"
48     dc:title="easter: Indecision is the key to flexibility!"
49     dc:identifier="http://defaria.com/blogs/Status/archives/2008_01.html#entry-000695"
50     dc:subject="General Dynamics"
51     dc:description="Easter Paged usage Added logfile analysis Added Timeout detection Added environment variable support Changed to use GetConfig for -file..."
52     dc:creator=""
53     dc:date="2008-01-30T17:55:37-06:00" />
54 </rdf:RDF>
55 -->
56
57
58                      <h2 class="date-header">January 30, 2008</h2>
59                      <a id="a000695"></a>
60                      <div class="entry" id="entry-695">
61                         <h3 class="entry-header">easter: Indecision is the key to flexibility!</h3>
62                         <div class="entry-content">
63                            <div class="entry-body">
64                               <h2>Easter</h2>
65
66 <ul>
67   <li>Paged usage</li>
68
69   <li>Added logfile analysis</li>
70
71   <li>Added Timeout detection</li>
72
73   <li>Added environment variable support</li>
74
75   <li>Changed to use GetConfig for -file</li>
76 </ul>
77                               
78                               <p>The following progress has been made on easter, the EAST Test Driver:</p>
79
80 <ul>
81   <li>easter -usage has gotten bigger so it's now piped to $ENV{PAGER}</li>
82
83   <li>Added log file analysis: easter now examines the log file produced by the running of test cases. It does this by extracting the test case name, not to be confused with the test case <u>file</u> name, from the profile file and composing a (long) path to the log file that the running of East produces. Note that easter is running remotely from a workstation on the RAN and driving tests and processes on raneast and ceast&lt;n&gt;. As such it dynamically expands environment
84 variables like $MNT_DIR and $EAST_REL in composing the path to the log file so that in the event of a change in either of these environment variables will be automatically sense and it will Just Work&reg;.<br>
85
86 <br>An additional complexity is that part of the path to the logfile contains a timestamp down to the millisecond. It's difficult (read impossible) to determine the exact timestamp that will be issues and guessing has it's challenges too. Instead, easter takes the approach of using "ls -t | head -1" to determine the most recently modified directory (timestamp directory that is). This works reasonably well provided we don't have multiple tests or processes writing in that directory.<br>
87
88 <br>Once the logfile is determined it is examined for "EXECUTION STATUS" and that is reported back to the user.</li>
89
90   <li>Implemented rudimentary detection of timeouts. In testing I noticed that TS_default.profile never exits. So instead it times out. This situation is detected and counted as a timeout (I'd still like an example test case that exits without indicating Success or Failure).<br>
91
92 <blockquote>
93   <small><p><b>Note: </b>It's been observes that other timeouts have been happening. For example, sometimes the connection to raneast seems to just hang. This could be due to abnormal load on raneast, ceast&lt;n&gt; or other hardware. The easter script does not always handle such things that gracefully yet. In general easter allows for up to 30 seconds for each remote execution of a command, including tests. How long do tests take?</p></small>
94 </blockquote>
95   </li>
96
97   <li>Added environment variables. The user can now set into the environment various parameters for easter so that they need not have to specify them on the command line. Generally this is used to set things that remain the same for the whole execution of easter like &lt;view&gt;, &lt;type&gt; and &lt;unit&gt;. There is a scheme for overriding that being environment, command line and config file. The environment variables are as follows:<br>
98
99 <div class=code><pre>
100 EASTER_VIEW  Analogous to -view&nbsp; (e.g. export EASTER_VIEW=p6258c_easter)
101 EASTER_TYPE  Analogous to -type&nbsp; (e.g. export EASTER_TYPE=rbs)
102 EASTER_CLASS Analogous to -class (e.g. export EASTER_CLASS=ts)
103 EASTER_UNIT  Analogous to -unit&nbsp; (e.g. export EASTER_UNIT=5)
104 EASTER_TEST  Analogous to -test&nbsp; (e.g. export EASTER_TEST=test1.profile)
105 EASTER_FILE  Analogous to -file&nbsp; (e.g. export EASTER_FILE=testsuite.conf)
106 </pre></div>
107
108 <p><font color="#c0c0c0">(and I was real tempted to make an EASTER_EGG!)</font></p>
109
110 <p>Any options specified on the command line override any options specified in the environment. So the user can do something like:</p>
111
112 <div class=code><pre>
113 $ export EASTER_FILE=testsuite.conf
114 $ easter
115 </pre></div>
116   </li>
117
118   <li>Expanded the syntax of the -file file. This now uses the GetConfig module. This is a more simplex form of config file, less complicated than say XML. It's more akin to X Resource files and allows for commenting. The config file now can contain configuration options embedded in the file as well as test executions. Comments are supported with the standard "#". Here's an example file:
119
120 <div class=code><pre>
121 ##############################################################################
122 #
123 # Name:          testsuite1
124 #
125 # Description:  Test suite file to test easter
126 #
127 # Author:        <a class="moz-txt-link-abbreviated" href="mailto:Andrew@DeFaria.com">Andrew@DeFaria.com</a>
128 #
129 # (c) Copyright 2008, General Dynamics, all rights reserved
130 #
131 ##############################################################################
132
133 # Use the following view
134 view:&nbsp;&nbsp; p63630_SIMCQ00000607_intview
135
136 # Set type and unit to rbs 6
137 type:   rbs
138 unit:    6
139
140 # Execute the following ts tests
141 exec:    TS_b2_l3_auto_test.profile
142 exec:    TS_success.profile
143 exec:    TS_failure.profile
144 exec:    TS_profile.profile
145 exec:    TS_default.profile
146 </pre></div>
147
148 <p>We can see that we are using a specific view, type and unit, which holds for all tests. Each exec line is cumulative (passes in an array to the script) of test cases to run. We can easily execute this "testsuite" then by doing either of:</p>
149
150 <div class=code><pre>
151 $ easter -f testsuite.conf
152 </pre></div>
153
154 or
155
156 <div class=code><pre>
157 $ export EASTER_FILE=testsuite.conf
158 $ easter
159 </pre></div>
160
161 <p>The resulting output is:</p>
162
163 <table bgcolor="black" border="0" cellpadding="2" cellspacing="0" width="90%">
164   <tbody>
165     <tr>
166       <td valign="top"><font color="#ffffff"><tt><b><font color="yellow">Randws016:</font></b><font color="yellow"><font color="#ffffff">ct setview p6258c_RANCQ00023645_devview</font></font><b><font color="yellow"><br></font></b></tt></font><font color="#ffffff"><tt><b><font  color="yellow">Randws016:</font></b><font color="yellow"><font color="#ffffff">cd /vobs/rantest/tools/lib/Nethawk</font></font><br>
167 </tt></font><font color="#ffffff"><tt><b><font color="yellow">Randws016:</font></b></tt></font><font  color="#ffffff"><tt>export EASTER_FILE=testsuite.conf</tt></font><br>
168           <font color="#ffffff"><tt><b><font color="yellow">Randws016:</font></b><font
169  color="#ffffff">easter</font></tt></font><br>
170           <font color="#ffffff"><tt>Please be patient while we set up
171 the test environment... done<br>
172           <font color="cyan">ts</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="yellow">TS_b2_l3_auto_test_.profile</font>
173           <font color="green">Success</font><br>
174           </tt></font><font color="#ffffff"><tt><font color="cyan">
175 ts</font></tt></font><font color="#ffffff"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font
176  color="yellow">TS_success.profile</font> <font color="green">Success</font><br>
177           </tt></font><font color="#ffffff"><tt><font color="cyan">
178 ts</font></tt></font><font color="#ffffff"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font
179  color="yellow">TS_success.profile</font> <font color="red">Failure</font><br>
180           </tt></font><font color="#ffffff"><tt><font color="cyan">
181 ts</font></tt></font><font color="#ffffff"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font
182  color="yellow">TS_success.profile</font> <font color="red">Failure</font><br>
183           </tt></font><font color="#ffffff"><tt><font color="cyan">
184 ts</font></tt></font><font color="#ffffff"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font
185  color="yellow">TS_default.profile</font> <font color="cyan">Timed out<br>
186           <font color="#ffffff">easter summary</font><br>
187           <font color="yellow">5 tests run</font><br>
188           <font color="green">2 tests passed</font><br>
189           <font color="red">2 tests failed</font><br>
190 1 test incomplete<br>
191           </font></tt></font></td>
192         </tr>
193       </tbody>
194     </table>
195     <tt></tt></li>
196
197 </ul>
198                               
199                               <p class="entry-footer">
200                                  <span class="post-footers">Posted by  at  5:55 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000695.html">Permalink</a>
201                                  
202                                  | <a href="http://defaria.com/blogs/Status/archives/000695.html#trackback">TrackBacks (0)</a>
203                               </p>
204                            </div>
205                         </div>
206                      </div>
207                      
208                      <!--
209 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
210          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
211          xmlns:dc="http://purl.org/dc/elements/1.1/">
212 <rdf:Description
213     rdf:about="http://defaria.com/blogs/Status/archives/2008_01.html#entry-000694"
214     trackback:ping="http://defaria.com/mt/mt-tb.cgi/81"
215     dc:title="East.pm"
216     dc:identifier="http://defaria.com/blogs/Status/archives/2008_01.html#entry-000694"
217     dc:subject="General Dynamics"
218     dc:description=" Initial coding of East.pm Added parameters to testeast script Changed Rexec to handle timeouts better Opened WOR for Rexec work..."
219     dc:creator=""
220     dc:date="2008-01-23T13:32:00-06:00" />
221 </rdf:RDF>
222 -->
223
224
225                      <h2 class="date-header">January 23, 2008</h2>
226                      <a id="a000694"></a>
227                      <div class="entry" id="entry-694">
228                         <h3 class="entry-header">East.pm</h3>
229                         <div class="entry-content">
230                            <div class="entry-body">
231                               <ul>
232   <li>Initial coding of East.pm</li>
233
234   <li>Added parameters to testeast script</li>
235
236   <li>Changed Rexec to handle timeouts better</li>
237
238   <li>Opened WOR for Rexec work</li>
239 </ul>
240                               
241                               <h2>East.pm Library</h2>
242
243 <p>Started coding the East.pm library. The idea was that this library would allow testers to invoke tests using a few simple Perl statements. Work on this was initially laid out by Gantry York for other simulators like TM500, etc. This East.pm merely falls in line with those.</p>
244
245 <p>I'm trying to code a Perl library for running test cases/suites on East. I'm new to this environment so I don't understand it well. It seems like there are test cases and test suites. There may be "load runner" things and "regression runner" things. All of these objects and how this works is all Greek to me at this moment.</p>
246
247 <p>What I'm told is that in order to run these things the following steps must take place:</p>
248
249 <ol>
250   <li>From the RAN, ssh to raneast</li>
251
252   <li>Once there a TCL/Tk script will pop up a window that shows various RBS/RNC/East things numbered from 1-7. Some boxes will be red indicating that they are in use and some will be green indicating that they are available.</li>
253
254   <li>I assume I'm supposed to pick a green one. Whether I'm looking for an RBS or an RNC or even an East is unknown to me at this time. <font color=red>This is chosen based on the Device Under Test, if you want to test rbs6 that is what you would choose.  East logins are used only for scripting purposes, and will not work for actual execution.</font></li>
255
256   <li>So far I've only played with RBSs so I pick a green RBS box and type in "rbs &lt;n&gt;" where &lt;n&gt; is the number of the green box I chose. This apparently goes through a mapping of sorts and ssh's to a ceast machine of appropriate number.</li>
257
258   <li>Once there I do a start_east_auto &lt;view name&gt; &lt;rbs&lt;n&gt;&gt; where this time "rbs" and "&lt;n&gt;" are squished together. Step 4 above has a space between the "rbs" and the "&lt;n&gt;". This, in some manner, starts the East server(s) and another GUI appears. There are various buttons - mostly initially yellow. I am supposed to wait 10-15 seconds for them (well some of them) to turn green.</li>
259
260   <li>Next I run java [type of test] -run -name &lt;name of test&gt;.</li>
261 </ol>
262
263 <p>At this point I'd like to ask some questions:</p>
264
265 <ol>
266   <li>Does the "rbs &lt;n&gt;" command and the "rbs&lt;n&gt;" parameter have to be the same with respect to &lt;n&gt;? <font color=red>Yes, the choice should be the same with regards to the rbs/rnc and <n>  The first is used to ssh to the correct ceast blade, the second is used to execute the east application with the correct settings for testing that particular node.  The second command is also what creates the lock file indicating you are currently using that resource (the box changes from green to red in the TCL script).</font></li>
267
268   <li>How can I programmatically determine if the desired "rbs &lt;n&gt;" unit is indeed green?<font color=red>There is a command line tool called elock that prints the status of each device. The DUT name will only be present if it is currently locked.</font></li>
269
270   <li>What is [type of test]? From the <i>Command Line in EAST</i> document I have ascertained the following "types" of tests:
271     <ul>
272       <li>LoadTCRunner <font color=red>The type of test which is run is called a Test Case or “TC”, it is run in Load which means it can be run with multiple contexts.</font></li>
273
274       <li>RegressionRunner <font color=red>Same as above, except the test is run as a single context</font></li>
275
276       <li>RegressionLoadRunner <font color=red>Not used in our current implementation</font></li>
277
278       <li>RegressionTSRunner <font color=red>This command runs Test Suites or “TS”</font></li>
279     </ul>
280   </li>
281 </ol>
282
283 <blockquote>
284 <p>From what I can tell, and from an IM with Ross, there appears to be the following relationship:</p>
285 </blockquote>
286
287 <blockquote>
288   <table border="1" cellpadding="2" cellspacing="0" width="100%" bgcolor=white>
289     <tbody>
290       <tr>
291         <th bgcolor="#339999" valign="top"><font color="#ffffff">Java Command<br>
292         </font></th>
293         <th bgcolor="#339999" valign="top"><font color="#ffffff">-name<br>
294         </font></th>
295         <th bgcolor="#339999" valign="top"><font color="#ffffff">Path<br>
296         </font></th>
297         <th bgcolor="#339999" valign="top"><font color="#ffffff">Comments<br>
298         </font></th>
299       </tr>
300       <tr>
301         <td valign="top">LoadTCRunner<br>
302         </td>
303         <td valign="top">&lt;test&gt;.profile<br>
304         </td>
305         <td valign="top">/simdev/tc_data/tc/profiles/load<br>
306         </td>
307         <td valign="top"><br>
308         </td>
309       </tr>
310       <tr>
311         <td valign="top">RegressionRunner<br>
312         </td>
313         <td valign="top">&lt;test&gt;.profile<br>
314         </td>
315         <td valign="top">/simdev/tc_data/tc/profiles/tc<br>
316         </td>
317         <td valign="top"><br>
318         </td>
319       </tr>
320       <tr>
321         <td valign="top">RegressionLoadRunner<br>
322         </td>
323         <td align="center" valign="top">???<br>
324         </td>
325         <td align="center" valign="top">???<br>
326         </td>
327         <td valign="top">Not used?<br>
328         </td>
329       </tr>
330       <tr>
331         <td valign="top">RegressionTSRunner<br>
332         </td>
333         <td valign="top">&lt;test&gt;.profile<br>
334         </td>
335         <td valign="top">/simdev/tc_data/ts/profiles/ts<br>
336         </td>
337         <td valign="top"><br>
338         </td>
339       </tr>
340     </tbody>
341   </table>
342
343   <p><b>Note:</b> Path is important as you cannot specify -path to the java command. <font color=red.True, but you can specify a path past the default directory in the –name argument.  A file at /simdev/tc_data/tc/profiles/load/RBS_SIM/TC_test.profile can be specified with –name “RBS_SIM/TC_test.profile”</font></p>
344 </blockquote>
345
346 <p>Finally, according to the <i>Command Line in EAST</i> document there is a -flag parameter which states:</p>
347
348 <blockquote>
349   <dl>
350     <dt><b>-flag</b></dt>
351     <dd>If this argument is used the runner will quit when the load engine exits</dd>
352   </dl>
353 </blockquote>
354
355 <p>Can this be used to block while the test is being run and is the exit status properly set to indicate success or failure?</p>
356
357 <p><font color=red>Yes, it will block when the test is run and exit when it is finished, however in tests yesterday it doesn’t seem to matter whether the test passed or failed, it always returns 0.  Also, there will be cases in which scripts that we run are designed to never exit, so the process would have to be killed after meeting a set of criteria.</font></p>
358                               
359                               <p class="entry-footer">
360                                  <span class="post-footers">Posted by  at  1:32 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000694.html">Permalink</a>
361                                  
362                                  | <a href="http://defaria.com/blogs/Status/archives/000694.html#trackback">TrackBacks (0)</a>
363                               </p>
364                            </div>
365                         </div>
366                      </div>
367                      
368                   </div>
369                </div>
370             </div>
371          </div>
372       </div>
373    </div>
374 </body>
375 </html>