Megatest

Diff
Login

Differences From Artifact [342589359c]:

To Artifact [ba30631ac8]:


98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<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>







|







98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<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 with 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>
216
217
218
219
220
221
222
223



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<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 class="listing">



<pre class="listing"># Fields are the keys under which your test runs are organized
[fields]
field1 TEXT
field2 TEXT
​
[jobtools]
# The launcher launches jobs to the local or remote hosts,
# the job is managed on the target host by megatest,
# comment out launcher to run local only. An example launcher
# "nbfake" can be found in the utils directory. 
launcher nbfake
​
# The disks section specifies where the tests will be run. As you
# run out of space in a partition you can add additional disks
# entries.
# Format is:
# name /path/to/area 
[disks]
1 /tmp 
</pre>
</div>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-2.2.2">2.2.2</a> Create runconfigs.config
</h3>







|
>
>
>


















|







216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<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="Paragraph">
<a class="toc" name="toc-Paragraph-1"></a><div class="listing">
<pre class="listing"># Fields are the keys under which your test runs are organized
[fields]
field1 TEXT
field2 TEXT
​
[jobtools]
# The launcher launches jobs to the local or remote hosts,
# the job is managed on the target host by megatest,
# comment out launcher to run local only. An example launcher
# "nbfake" can be found in the utils directory. 
launcher nbfake
​
# The disks section specifies where the tests will be run. As you
# run out of space in a partition you can add additional disks
# entries.
# Format is:
# name /path/to/area 
[disks]
disk1 /tmp 
</pre>
</div>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-2.2.2">2.2.2</a> Create runconfigs.config
</h3>
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
</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;







|
|














|
|









|
|












|
|







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
</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="Paragraph">
<a class="toc" name="toc-Paragraph-2"></a><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="Paragraph">
<a class="toc" name="toc-Paragraph-3"></a><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="Paragraph">
<a class="toc" name="toc-Paragraph-4"></a><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="Paragraph">
<a class="toc" name="toc-Paragraph-5"></a><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;
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
</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.







|
|









|
|












>
>
|
>












|







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
</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="Paragraph">
<a class="toc" name="toc-Paragraph-6"></a><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="Paragraph">
<a class="toc" name="toc-Paragraph-7"></a><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">
Note: Using csh is NOT recommended. Use bash, perl, ruby, zsh or anything other than csh. We use csh here because it is popular in some industries. 
</div>
<div class="Paragraph">
<a class="toc" name="toc-Paragraph-8"></a><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="Unindented">
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.
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
$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>







|







392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
$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 with 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>
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
<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>







<








|




|
|












|
|







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
<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 in this test it is possible to use 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="Paragraph">
<a class="toc" name="toc-Paragraph-9"></a><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="Paragraph">
<a class="toc" name="toc-Paragraph-10"></a><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>
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
</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">







|

|







509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
</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>
<blockquote class="Quotation">
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).
</blockquote>
<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">
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385

</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:59:24.726050</span>
</div>
</div>
</body>
</html>







|




1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390

</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-16T23:50:25.969569</span>
</div>
</div>
</body>
</html>