Megatest

Diff
Login

Differences From Artifact [a113e56825]:

To Artifact [aa66bfa737]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="generator" content="http://www.nongnu.org/elyxer/"/>
<meta name="create-date" content="2011-05-14"/>
<link rel="stylesheet" href="http://www.nongnu.org/elyxer/lyx.css" type="text/css" media="screen"/>
<title>Megatest</title>
</head>
<body>
<div id="globalWrapper">
<h1 class="title">
Megatest






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="generator" content="http://www.nongnu.org/elyxer/"/>
<meta name="create-date" content="2011-05-16"/>
<link rel="stylesheet" href="http://www.nongnu.org/elyxer/lyx.css" type="text/css" media="screen"/>
<title>Megatest</title>
</head>
<body>
<div id="globalWrapper">
<h1 class="title">
Megatest
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45




46
47
48
49
50
51
52



53
54
55

56
57
58


59
60
61
62
63


64
65
66
67
68
69


70
71
72

73
74
75

76
77
78
79



80
81
82


83
84
85
86
87
88
89
90







91
92
93
94
95
96
97

98
99
100

101
102
103

104
105
106



107
108
109
110
111
112
113
114


115
116
117

118
119
120


121

122
123
124
125



126
127
128



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
Megatest is a minimalistic tool to help automate and manage the running of a suite of regression tests or other processes and to roll up the results for display on a web page or dashboard.
</div>
<div class="fulltoc">
<div class="tocheader">
Table of Contents
</div>
<div class="tocindent">
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Section-0.1">Section 0.1: About Megatest</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsection-0.1.1">Subsection 0.1.1: Megatest design philosophy</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-0.1.2">Subsection 0.1.2: Megatest architecture</a>
</div>
</div>
<div class="toc">




<a class="Link" href="#toc-Section-0.2">Section 0.2: Installation</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsection-0.2.1">Subsection 0.2.1: Compilation</a>
</div>
<div class="tocindent">



<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.1.1">Subsubsection 0.2.1.1: Dependencies</a>
</div>

<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.1.2">Subsubsection 0.2.1.2: Build and install</a>
</div>


</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-0.2.2">Subsection 0.2.2: Setup</a>
</div>
<div class="tocindent">


<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.2.1">Subsubsection 0.2.2.1: Create megatest.config</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.2.2">Subsubsection 0.2.2.2: Create runconfigs.config</a>
</div>


<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.2.3">Subsubsection 0.2.2.3: Create the tests directory and your first test</a>
</div>

<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.2.4">Subsubsection 0.2.2.4: Create the testconfig file for your test</a>
</div>

<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.2.5">Subsubsection 0.2.2.5: Create your test running script, main.sh</a>
</div>
<div class="toc">



<a class="Link" href="#toc-Subsubsection-0.2.2.6">Subsubsection 0.2.2.6: Run megatest and watch your run progress</a>
</div>
</div>


</div>
<div class="toc">
<a class="Link" href="#toc-Section-0.3">Section 0.3: Reference</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsection-0.3.1">Subsection 0.3.1: Configuration files</a>
</div>







<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.3.1.1">Subsubsection 0.3.1.1: Sections</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.3.1.2">Subsubsection 0.3.1.2: Variables</a>
</div>

<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.3.1.3">Subsubsection 0.3.1.3: Includes</a>
</div>

<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.3.1.4">Subsubsection 0.3.1.4: Setting a variable by running a command</a>
</div>

<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.3.1.5">Subsubsection 0.3.1.5: Notes</a>
</div>



</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-0.3.2">Subsection 0.3.2: Environment variables</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-0.3.3">Subsection 0.3.3: Configuration files</a>
</div>
<div class="tocindent">


<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.3.3.1">Subsubsection 0.3.3.1: megatest.config</a>
</div>

<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.3.3.2">Subsubsection 0.3.3.2: runconfigs.config file</a>
</div>


</div>

<div class="toc">
<a class="Link" href="#toc-Subsection-0.3.4">Subsection 0.3.4: Writing tests</a>
</div>
<div class="tocindent">



<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.3.4.1">Subsubsection 0.3.4.1: testconfig file</a>
</div>



</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-0.3.5">Subsection 0.3.5: Command line</a>
</div>
</div>
</div>
</div>

</div>
<h2 class="Section">
<a class="toc" name="toc-Section-0.1">0.1</a> About Megatest
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.1.1">0.1.1</a> Megatest design philosophy
</h3>
<div class="Unindented">
Megatest is intended to provide the minimum needed resources to make writing a suite of tests for software, design engineering or process control (via owlfs for example) without being specialized for any specific problem space. Megatest in of itself does not know what constitutes a PASS or FAIL of a test. In most cases megatest is best used in conjunction with logpro or a similar tool to parse, analyze and decide on the test outcome. A call to megatest can then be made to record the result. 
</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.1.2">0.1.2</a> Megatest architecture
</h3>
<div class="Unindented">
All data to specify the tests and configure the system is stored in plain text files. All system state is stored in an sqlite3 database. Tests are launched using the launching system available for the distributed compute platform in use. A template script is provided which can launch jobs on local and remote Linux hosts. Currently megatest uses the network filesystem to “call home” to your master sqlite3 database.
</div>



<h2 class="Section">
<a class="toc" name="toc-Section-0.2">0.2</a> Installation
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.2.1">0.2.1</a> Compilation
</h3>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.1.1">0.2.1.1</a> Dependencies
</h4>
<div class="Unindented">
Chicken scheme and a number of eggs are required for building megatest. See the file utils/installall.sh for an automated way to install the dependencies on Linux.
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.1.2">0.2.1.2</a> Build and install
</h4>
<div class="Unindented">
Run “make test” to create the megatest executable. You may wish to copy the executable to a centrally accessible location.
</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.2.2">0.2.2</a> Setup
</h3>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.1">0.2.2.1</a> Create megatest.config
</h4>
<div class="Unindented">
Create the file megatest.config using the megatest.config template from the tests directory. At a minimum you need the following:
</div>
<div class="Code">
# Fields are the keys under which your test runs are organized
</div>
<div class="Code">







<

|



|


|



>
>
>
>
|



|

|
>
>
>

|

>

|

>
>


|

|
>
>

|


|

>
>

|

>

|

>

|


>
>
>
|


>
>


|



|

>
>
>
>
>
>
>


|


|

>

|

>

|

>

|

>
>
>


|


|

|
>
>

|

>

|

>
>

>

|

|
>
>
>

|

>
>
>


|






|
|
|
|
|
|



|
|
|



>
>
>

|


|

<
<
<



|
|
|



|
|
|
|
|
|







26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
Megatest is a minimalistic tool to help automate and manage the running of a suite of regression tests or other processes and to roll up the results for display on a web page or dashboard.
</div>
<div class="fulltoc">
<div class="tocheader">
Table of Contents
</div>
<div class="tocindent">

<div class="toc">
<a class="Link" href="#toc-Chapter-1">Chapter 1: About Megatest</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Section-1.1">Section 1.1: Megatest design philosophy</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Section-1.2">Section 1.2: Megatest architecture</a>
</div>
</div>
<div class="toc">
<a class="Link" href="#toc-Chapter-2">Chapter 2: Installation</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Section-2.1">Section 2.1: Compilation</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsection-2.1.1">Subsection 2.1.1: Dependencies</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-2.1.2">Subsection 2.1.2: Build and install</a>
</div>
</div>
<div class="toc">
<a class="Link" href="#toc-Section-2.2">Section 2.2: Setup</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsection-2.2.1">Subsection 2.2.1: Create megatest.config</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-2.2.2">Subsection 2.2.2: Create runconfigs.config</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-2.2.3">Subsection 2.2.3: Create the tests directory and your first test</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-2.2.4">Subsection 2.2.4: Create the testconfig file for your test</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-2.2.5">Subsection 2.2.5: Create your test running script, main.sh</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-2.2.6">Subsection 2.2.6: Run megatest and watch your run progress</a>
</div>
</div>
</div>
<div class="toc">
<a class="Link" href="#toc-Chapter-3">Chapter 3: How to Write Tests</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Section-3.1">Section 3.1: A Simple Test with one Step</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsection-3.1.1">Subsection 3.1.1: Create your test directory. The directory name will be the name of the test</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-3.1.2">Subsection 3.1.2: Create your testconfig file. This file contains various specifications for your test. For our example the test author has chosen to write the test using csh scripting.</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-3.1.3">Subsection 3.1.3: Create your main.csh script</a>
</div>
</div>
<div class="toc">
<a class="Link" href="#toc-Section-3.2">Section 3.2: Simple Test with Multiple Steps </a>
</div>
<div class="toc">
<a class="Link" href="#toc-Section-3.3">Section 3.3: Simple Test, Multiple Steps, Some in Parallel </a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsection-3.3.1">Subsection 3.3.1: The Makefile</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-3.3.2">Subsection 3.3.2: The main.csh file</a>
</div>
</div>
<div class="toc">
<a class="Link" href="#toc-Section-3.4">Section 3.4: Simple Test with Iteration</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsection-3.4.1">Subsection 3.4.1: Update you testconfig file for iteration</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-3.4.2">Subsection 3.4.2: Rewrite your main.csh for iteration</a>
</div>
</div>
<div class="toc">
<a class="Link" href="#toc-Section-3.5">Section 3.5: Tests with Inter-test dependencies</a>
</div>
</div>
<div class="toc">
<a class="Link" href="#toc-Chapter-4">Chapter 4: Reference</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Section-4.1">Section 4.1: Configuration file Syntax</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsection-4.1.1">Subsection 4.1.1: Sections</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-4.1.2">Subsection 4.1.2: Variables</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-4.1.3">Subsection 4.1.3: Includes</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-4.1.4">Subsection 4.1.4: Setting a variable by running a command</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-4.1.5">Subsection 4.1.5: Notes</a>
</div>
</div>
<div class="toc">
<a class="Link" href="#toc-Section-4.2">Section 4.2: Environment variables</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Section-4.3">Section 4.3: Configuration files</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsection-4.3.1">Subsection 4.3.1: megatest.config</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-4.3.2">Subsection 4.3.2: runconfigs.config file</a>
</div>
</div>
<div class="toc">
<a class="Link" href="#toc-Section-4.4">Section 4.4: Writing tests</a>
</div>
<div class="tocindent">
<div class="toc">
<a class="Link" href="#toc-Subsection-4.4.1">Subsection 4.4.1: testconfig file</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-4.4.2">Subsection 4.4.2: Command line</a>
</div>
</div>
</div>
</div>

</div>
<h1 class="Chapter">
<a class="toc" name="toc-Chapter-1">1</a> About Megatest
</h1>
<h2 class="Section">
<a class="toc" name="toc-Section-1.1">1.1</a> Megatest design philosophy
</h2>
<div class="Unindented">
Megatest is intended to provide the minimum needed resources to make writing a suite of tests for software, design engineering or process control (via owlfs for example) without being specialized for any specific problem space. Megatest in of itself does not know what constitutes a PASS or FAIL of a test. In most cases megatest is best used in conjunction with logpro or a similar tool to parse, analyze and decide on the test outcome. A call to megatest can then be made to record the result. 
</div>
<h2 class="Section">
<a class="toc" name="toc-Section-1.2">1.2</a> Megatest architecture
</h2>
<div class="Unindented">
All data to specify the tests and configure the system is stored in plain text files. All system state is stored in an sqlite3 database. Tests are launched using the launching system available for the distributed compute platform in use. A template script is provided which can launch jobs on local and remote Linux hosts. Currently megatest uses the network filesystem to “call home” to your master sqlite3 database.
</div>
<h1 class="Chapter">
<a class="toc" name="toc-Chapter-2">2</a> Installation
</h1>
<h2 class="Section">
<a class="toc" name="toc-Section-2.1">2.1</a> Compilation
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-2.1.1">2.1.1</a> Dependencies
</h3>



<div class="Unindented">
Chicken scheme and a number of eggs are required for building megatest. See the file utils/installall.sh for an automated way to install the dependencies on Linux.
</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-2.1.2">2.1.2</a> Build and install
</h3>
<div class="Unindented">
Run “make test” to create the megatest executable. You may wish to copy the executable to a centrally accessible location.
</div>
<h2 class="Section">
<a class="toc" name="toc-Section-2.2">2.2</a> Setup
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-2.2.1">2.2.1</a> Create megatest.config
</h3>
<div class="Unindented">
Create the file megatest.config using the megatest.config template from the tests directory. At a minimum you need the following:
</div>
<div class="Code">
# Fields are the keys under which your test runs are organized
</div>
<div class="Code">
230
231
232
233
234
235
236
237
238
239
240
241



242


243
244
245
246
247
248
249
250
251
252

253
254
255
256
257
258
259
260
261
262
263
264
265


266
267
268
269
270
271
272
273
274
275
276

277
278
279
280
281
282
283
284
285
286
287




288


289



290
291
292
293
294
295
296
297
298
299
300


301





302








303










































































































304
305



306



















































307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
</div>
<div class="Code">
[disks]
</div>
<div class="Code">
1 /tmp 
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.2">0.2.2.2</a> Create runconfigs.config
</h4>
<div class="Unindented">
This file is used to set environment variables that are run specific. You can simply create an empty file to start.



</div>


<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.3">0.2.2.3</a> Create the tests directory and your first test
</h4>
<div class="Unindented">
The structure should look like this:
</div>
<div class="Code">
../tests
</div>
<div class="Code">

├── megatest.config
</div>
<div class="Code">
├── runconfigs.config 
</div>
<div class="Code">
└── tests 
</div>
<div class="Code">
    └── mytest 
</div>
<div class="Code">
       ├── main.sh


</div>
<div class="Code">
       └── testconfig 
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.4">0.2.2.4</a> Create the testconfig file for your test
</h4>
<div class="Code">
[setup]
</div>
<div class="Code">

runscript main.sh
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.5">0.2.2.5</a> Create your test running script, main.sh
</h4>
<div class="Code">
#!/bin/bash
</div>
<div class="Code">

</div>




<div class="Code">


megatest -runstep mystep1 "sleep 20;echo Done" -m "mystep1 is done"



</div>
<div class="Code">
megatest -test-status :state COMPLETED :status PASS -m "This is a test level comment"
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.6">0.2.2.6</a> Run megatest and watch your run progress
</h4>
<div class="Code">
megatest :field1 abc :field2 def :runname 2011week08.4a -runall
</div>
<div class="Code">


watch megatest -list-runs %





</div>








<h2 class="Section">










































































































<a class="toc" name="toc-Section-0.3">0.3</a> Reference
</h2>



<h3 class="Subsection">



















































<a class="toc" name="toc-Subsection-0.3.1">0.3.1</a> Configuration files
</h3>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.3.1.1">0.3.1.1</a> Sections
</h4>
<div class="Unindented">
[section name]
</div>
<div class="Indented">
This creates a section named “section name”
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.3.1.2">0.3.1.2</a> Variables
</h4>
<div class="Unindented">
VARX has this value
</div>
<div class="Indented">
The variable “VARX” will have the value “has this value”
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.3.1.3">0.3.1.3</a> Includes
</h4>
<div class="Unindented">
[include filename]
</div>
<div class="Indented">
The file named “filename” will be included as if part of the calling file. NOTE: This means no section can be named “include “ (with the whitespace).
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.3.1.4">0.3.1.4</a> Setting a variable by running a command
</h4>
<div class="Unindented">
VARNAME [system ls /tmp]
</div>
<div class="Indented">
The variable “VARNAME” will get a value created by the Unix command “ls /tmp”. All lines of output from the command will be joined with a space.
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.3.1.5">0.3.1.5</a> Notes
</h4>
<ul>
<li>
Some variables are infered as lists. Each token on the line separated by whitespace will be member of the list.
</li>
<li>
Comments (lines starting with #) and blank lines are ignored.
</li>

</ul>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.3.2">0.3.2</a> Environment variables
</h3>
<div class="Unindented">
<table>
<tr>
<td align="left" valign="top">
Variable
</td>
<td align="left" valign="top">







|
|
|

|
>
>
>

>
>
|
|
|



|
<
<
|
>
|
<
<
|
<
<
|
<
<
|
<
<
|
>
>

|
<

|
|
|
|
<
<
|
>

<
<
<
|
<
<

<


>
>
>
>
|
>
>

>
>
>

|
<

|
|
|
|
<
<
|
>
>

>
>
>
>
>

>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

<
<
<



|

|
|
|
|



|

|
|
|
|






|
|
|



|

|
|
|
|









|
|
|







275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299


300
301
302


303


304


305


306
307
308
309
310

311
312
313
314
315


316
317
318



319


320

321
322
323
324
325
326
327
328
329
330
331
332
333
334
335

336
337
338
339
340


341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524



525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
</div>
<div class="Code">
[disks]
</div>
<div class="Code">
1 /tmp 
</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-2.2.2">2.2.2</a> Create runconfigs.config
</h3>
<div class="Unindented">
This file is used to set environment variables that are run specific. You can simply create an empty file to start.<div class="listing">
<pre class="listing"># runconfigs.config

</pre>
</div>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-2.2.3">2.2.3</a> Create the tests directory and your first test
</h3>
<div class="Unindented">
The structure should look like this:
</div>
<div class="Indented">


<div class="listing">
<pre class="listing">../tests
  ├── megatest.config


  ├── runconfigs.config


  └── tests


     └── mytest


           ├── main.sh
           └── testconfig
</pre>
</div>


</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-2.2.4">2.2.4</a> Create the testconfig file for your test
</h3>
<div class="Unindented">


<div class="listing">
<pre class="listing">[setup]
runscript main.sh



</pre>


</div>


</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-2.2.5">2.2.5</a> Create your test running script, main.sh
</h3>
<div class="Unindented">
<div class="listing">
<pre class="listing">#!/bin/bash

megatest -runstep mystep1 "sleep 20;echo Done" -m "mystep1 is done"

megatest -test-status :state COMPLETED :status PASS -m "This is a comment"
</pre>
</div>


</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-2.2.6">2.2.6</a> Run megatest and watch your run progress
</h3>
<div class="Unindented">


<div class="listing">
<pre class="listing">megatest :field1 abc :field2 def :runname 2011week08.4a -runall

watch megatest -list-runs %

# OR use the dashboard

dashboard &amp;
</pre>
</div>

</div>
<div class="Code">

</div>
<h1 class="Chapter">
<a class="toc" name="toc-Chapter-3">3</a> How to Write Tests
</h1>
<h2 class="Section">
<a class="toc" name="toc-Section-3.1">3.1</a> A Simple Test with one Step
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-3.1.1">3.1.1</a> Create your test directory. The directory name will be the name of the test
</h3>
<div class="Unindented">
<div class="listing">
<pre class="listing">mkdir simpletest
cd simpletest
</pre>
</div>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-3.1.2">3.1.2</a> Create your testconfig file. This file contains various specifications for your test. For our example the test author has chosen to write the test using csh scripting.
</h3>
<div class="Unindented">
<div class="listing">
<pre class="listing"># testconfig

[setup]
runscript main.csh
</pre>
</div>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-3.1.3">3.1.3</a> Create your main.csh script
</h3>
<div class="Unindented">
<div class="listing">
<pre class="listing">#!/bin/tcsh -x

# run the cpu1 simulation.
#   The step name is "run_simulation"
#   The commandline being run for this step is "runsim cpu1"
#   The logpro file to validate the output from the run is "runsim.logpro"

$MEGATEST -runstep run_simulation -logpro runsim.logpro "runsim cpu1"
</pre>
</div>

</div>
<div class="Indented">
You can now run megatest and the created test directory will contain the new files “run_simulation.html” and “run_simulation.log”. If you are using the dashboard you can click on the run and then push the “View log” button to view the log file in firefox.
</div>
<h2 class="Section">
<a class="toc" name="toc-Section-3.2">3.2</a> Simple Test with Multiple Steps 
</h2>
<div class="Unindented">
To run multiple steps simply add them to the main.csh file. Here we add a step to test “cpu2”. The second step that tests cpu2 will only run after the step that tested “cpu1” completes.
</div>
<div class="Indented">
<div class="listing">
<pre class="listing">#!/bin/tcsh -x

# run the cpu1 simulation.
#   The step name is "run_simulation"
#   The commandline being run for this step is "runsim cpu1"
#   The logpro file to validate the output from the run is "runsim.logpro"

$MEGATEST -runstep run_simulation_cpu1 -logpro runsim.logpro "runsim cpu1"
$MEGATEST -runstep run_simulation_cpu2 -logpro runsim.logpro "runsim cpu2"
</pre>
</div>

</div>
<h2 class="Section">
<a class="toc" name="toc-Section-3.3">3.3</a> Simple Test, Multiple Steps, Some in Parallel 
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-3.3.1">3.3.1</a> The Makefile
</h3>
<div class="Unindented">
A good way to run steps in parallel within a single test, especially when there are following steps, is to use the Unix Make utility. Writing Makefiles is beyond the scope of this document but here is a minimal example that will run “runsim cpu1” and “runsim cpu2” in parallel. For more information on make try “info make” at the Linux command prompt.
</div>
<div class="Indented">
<div class="listing">
<pre class="listing"># Example Makefile to run two steps in parallel

RTLDIR=/path/to/rtl
CPUS = cpu1 cpu2

run_simulation_$(CPUS).html : $(RTLDIR)/$(CPUS)
	$(MEGATEST) -runstep run_simulation_$(CPUS) -logpro runsim.logpro "runsim $(CPUS)
</pre>
</div>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-3.3.2">3.3.2</a> The main.csh file
</h3>
<div class="Unindented">
<div class="listing">
<pre class="listing">#!/bin/tcsh -x

# run the cpu1 and cpu2 simulations in parallel. 
# The -j parameter tells make how many jobs it may run in parallel

make -j 2 

</pre>
</div>

</div>
<h2 class="Section">
<a class="toc" name="toc-Section-3.4">3.4</a> Simple Test with Iteration
</h2>
<div class="Unindented">
Since no jobs run after the cpu1 and cpu2 simulations inside the test there it is possible to run this test in iterated mode.
</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-3.4.1">3.4.1</a> Update you testconfig file for iteration
</h3>
<div class="Unindented">
<div class="listing">
<pre class="listing">[setup]
runscript main.csh

[items]
CPU cpu1 cpu2
</pre>
</div>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-3.4.2">3.4.2</a> Rewrite your main.csh for iteration
</h3>
<div class="Unindented">
<div class="listing">
<pre class="listing">#!/bin/tcsh -x

# run the cpu simulation but now use the environment variable $CPU
# to select what cpu to run the simulation against

$MEGATEST -runstep run_simulation -logpro runsim.logpro "runsim $CPU"
</pre>
</div>

</div>
<h2 class="Section">
<a class="toc" name="toc-Section-3.5">3.5</a> Tests with Inter-test dependencies
</h2>
<div class="Unindented">
Sometimes a test depends on the output from a previous test or it may not make sense to run a test is another test does not complete with status “PASS”. In either of these scenarios you can use the “waiton” keyword in your testconfig file to indicate that this test must wait on one or more tests to complete before being launched. In this example there is no point in running the “system” test if the “cpu” and “mem” tests either do not complete or complete but with status “FAIL”.
</div>
<div class="Indented">
<div class="listing">
<pre class="listing"># testconfig for the "system" test
[setup]
runscript main.csh
waiton cpu mem
</pre>
</div>

</div>
<h1 class="Chapter">
<a class="toc" name="toc-Chapter-4">4</a> Reference
</h1>
<h2 class="Section">
<a class="toc" name="toc-Section-4.1">4.1</a> Configuration file Syntax
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-4.1.1">4.1.1</a> Sections
</h3>



<div class="Unindented">
[section name]
</div>
<blockquote class="Quotation">
This creates a section named “section name”
</blockquote>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-4.1.2">4.1.2</a> Variables
</h3>
<div class="Unindented">
VARX has this value
</div>
<blockquote class="Quotation">
The variable “VARX” will have the value “has this value”
</blockquote>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-4.1.3">4.1.3</a> Includes
</h3>
<div class="Unindented">
[include filename]
</div>
<div class="Indented">
The file named “filename” will be included as if part of the calling file. NOTE: This means no section can be named “include “ (with the whitespace).
</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-4.1.4">4.1.4</a> Setting a variable by running a command
</h3>
<div class="Unindented">
VARNAME [system ls /tmp]
</div>
<blockquote class="Quotation">
The variable “VARNAME” will get a value created by the Unix command “ls /tmp”. All lines of output from the command will be joined with a space.
</blockquote>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-4.1.5">4.1.5</a> Notes
</h3>
<ul>
<li>
Some variables are infered as lists. Each token on the line separated by whitespace will be member of the list.
</li>
<li>
Comments (lines starting with #) and blank lines are ignored.
</li>

</ul>
<h2 class="Section">
<a class="toc" name="toc-Section-4.2">4.2</a> Environment variables
</h2>
<div class="Unindented">
<table>
<tr>
<td align="left" valign="top">
Variable
</td>
<td align="left" valign="top">
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
</td>

</tr>

</table>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.3.3">0.3.3</a> Configuration files
</h3>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.3.3.1">0.3.3.1</a> megatest.config
</h4>
<div class="Unindented">
<table>
<tr>
<td align="left" valign="top">
section
</td>
<td align="left" valign="top">







|
|
|
|
|
|







680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
</td>

</tr>

</table>

</div>
<h2 class="Section">
<a class="toc" name="toc-Section-4.3">4.3</a> Configuration files
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-4.3.1">4.3.1</a> megatest.config
</h3>
<div class="Unindented">
<table>
<tr>
<td align="left" valign="top">
section
</td>
<td align="left" valign="top">
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
</td>

</tr>

</table>

</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.3.3.2">0.3.3.2</a> runconfigs.config file
</h4>
<div class="Unindented">
<table>
<tr>
<td align="left" valign="top">
section
</td>
<td align="left" valign="top">







|
|
|







854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
</td>

</tr>

</table>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-4.3.2">4.3.2</a> runconfigs.config file
</h3>
<div class="Unindented">
<table>
<tr>
<td align="left" valign="top">
section
</td>
<td align="left" valign="top">
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
</div>
<div class="Code">
ENCRYPTION true
</div>
<div class="Code">
TESTPATH /nfs/testing/megacorp_runs
</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.3.4">0.3.4</a> Writing tests
</h3>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.3.4.1">0.3.4.1</a> testconfig file
</h4>
<div class="Unindented">
<table>
<tr>
<td align="left" valign="top">
section
</td>
<td align="left" valign="top">







|
|
|
|
|
|







983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
</div>
<div class="Code">
ENCRYPTION true
</div>
<div class="Code">
TESTPATH /nfs/testing/megacorp_runs
</div>
<h2 class="Section">
<a class="toc" name="toc-Section-4.4">4.4</a> Writing tests
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-4.4.1">4.4.1</a> testconfig file
</h3>
<div class="Unindented">
<table>
<tr>
<td align="left" valign="top">
section
</td>
<td align="left" valign="top">
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869

</tr>

</table>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.3.5">0.3.5</a> Command line
</h3>
<div class="Unindented">
<table>
<tr>
<td align="left" valign="top">
switch or param
</td>







|







1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082

</tr>

</table>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-4.4.2">4.4.2</a> Command line
</h3>
<div class="Unindented">
<table>
<tr>
<td align="left" valign="top">
switch or param
</td>
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207

</table>

</div>

<hr class="footer"/>
<div class="footer" id="generated-by">
Document generated by <a href="http://elyxer.nongnu.org/">eLyXer 1.0.0 (2010-07-21)</a> on <span class="create-date">2011-05-14T17:06:23.587385</span>
</div>
</div>
</body>
</html>







|




1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420

</table>

</div>

<hr class="footer"/>
<div class="footer" id="generated-by">
Document generated by <a href="http://elyxer.nongnu.org/">eLyXer 1.0.0 (2010-07-21)</a> on <span class="create-date">2011-05-16T22:49:35.164246</span>
</div>
</div>
</body>
</html>