Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / week_2008_01_27.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 27, 2008 - February  2, 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/week_2008_01_20.html" title="January 20, 2008 - January 26, 2008" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2008_02_10.html" title="February 10, 2008 - February 16, 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/week_2008_01_20.html">&laquo; January 20, 2008 - January 26, 2008</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/week_2008_02_10.html">February 10, 2008 - February 16, 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/week_2008_01_27.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/week_2008_01_27.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                   </div>
209                </div>
210             </div>
211          </div>
212       </div>
213    </div>
214 </body>
215 </html>