Megatest

Diff
Login

Differences From Artifact [6cfc483e56]:

To Artifact [a113e56825]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
<?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-08"/>
<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
</h1>
<h2 class="Date">
5/5/2011 
</h2>
<h2 class="author">
Matt Welland
</h2>
<div class="abstract">

<p class="abstract-message">
Abstract

</p>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="Unindented">

<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: Environment variables</a>
</div>

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

</div><div class="tocindent">


<div class="toc">






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




<div class="toc">




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




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

</div><div class="tocindent">

<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.3.3.1">Subsubsection 0.3.3.1: testconfig file</a>
</div></div>
</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>






|





<










<


>
|

<
<

<


>
|

<


>
|
<





|
|


>
|
<


>
|
<





|
|


>
|
<

















|

|


>
|
<

|

>

|
>
|
|
>

>
>
>
>
>
>
|

>
>
>
>

>
>
>
>
|
|
|
>
>
>

|
>
|
<

|
|

>
>


|

>







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
20
21
22

23
24
25
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
<?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
</h1>
<h2 class="Date">
5/5/2011 
</h2>
<h2 class="author">
Matt Welland
</h2>
<div class="abstract">

<p class="abstract-message">
Abstract
</p>
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>
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
580
581
582
583
584
585
586
587
588
589

590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607

608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625

626

627

628
629
630
631
632
633
634
635
636
637
638
639



640
641
642
643
644
645



646
647
648
649
650
651
652
653
654



655
656
657
658
659
660



661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709

710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727

728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745

746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763

764

765




















































































































































































































































































































































766
767
768
769


770
771
772
<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> Environment variables
</h3>



<div class="Unindented">
















































<table>

<tr>

<td align="left" valign="top">
Variable
</td>
<td align="left" valign="top">
Purpose
</td>
<td align="left" valign="top">
Default value/Comment
</td>

</tr>
<tr>

<td align="left" valign="top">
MT_CMDINFO
</td>
<td align="left" valign="top">
Conveys test variables to the megatest test runner.
</td>
<td align="left" valign="top">
Not for use by the end user
</td>

</tr>
<tr>

<td align="left" valign="top">
MT_TEST_RUN_DIR
</td>
<td align="left" valign="top">
Directory assigned by megatest for the test to run.
</td>
<td align="left" valign="top">
Tests can consider this their “home” directory
</td>

</tr>
<tr>

<td align="left" valign="top">
MT_TEST_NAME
</td>
<td align="left" valign="top">
Name of the test, corrosponds to the directory name under tests.
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">
MT_ITEM_INFO
</td>
<td align="left" valign="top">
Iterated tests will set this to a sequence of key/values ((KEY val) ...) 
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">
MT_RUN_AREA_HOME
</td>
<td align="left" valign="top">
Directory where megatest was launched from and where the tests code can be found
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">
MT_RUNNAME
</td>
<td align="left" valign="top">
Name of this run as set by the :runname parameter
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>












<td align="left" valign="top">
&lt;field1&gt; ....
</td>
<td align="left" valign="top">
The field values as set on the megatest -runall command line (e.g. :field1 abc)
</td>
<td align="left" valign="top">
Planning ahead your field names is important so as to avoid collisions with other environment variables
</td>

</tr>

</table>

</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.3.2">0.3.2</a> Configuration files
</h3>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.3.2.1">0.3.2.1</a> megatest.config
</h4>
<div class="Unindented">

<table>

<tr>

<td align="left" valign="top">
section
</td>
<td align="left" valign="top">
variable
</td>
<td align="left" valign="top">
value
</td>
<td align="left" valign="top">
required
</td>
<td align="left" valign="top">
comment
</td>

</tr>
<tr>

<td align="left" valign="top">
[setup]
</td>
<td align="left" valign="top">
max_concurrent_jobs
</td>
<td align="left" valign="top">
if variable is not defined no limit on jobs
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">

</td>
<td align="left" valign="top">
executable
</td>
<td align="left" valign="top">
full path to megatest binary
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
Use only if necessary, megatest will extract the location from where it used to launch and add append that to the PATH for test runs.
</td>

</tr>
<tr>

<td align="left" valign="top">

</td>
<td align="left" valign="top">
runsdir
</td>
<td align="left" valign="top">
full path to where the link tree to all runs will be created
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
Because your runs may be spread out over several disk partitions a central link tree is created to make finding all the runs easy.
</td>

</tr>
<tr>

<td align="left" valign="top">
[fields]
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
at least one
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">
[jobtools]
</td>
<td align="left" valign="top">
launcher
</td>
<td align="left" valign="top">
command line used to launch jobs - the job command (megatest -execute) will be appended to this
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">

</td>
<td align="left" valign="top">
workhosts
</td>
<td align="left" valign="top">
list of hostnames to run jobs on NOT SUPPORTED RIGHT NOW
</td>
<td align="left" valign="top">
n/a
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">
[env-override]
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
any string
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
These are set on the test launching machine, not the test running machine. Typical usage is to control the host or run queue for launching tests. These values will not be seen by the test when it runs.
</td>

</tr>
<tr>

<td align="left" valign="top">
[disks]
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
a valid path writable by the test launching process and by the test process
</td>
<td align="left" valign="top">
yes
</td>
<td align="left" valign="top">
The disk usage balancing algorithm is to choose the disk with the least space for each test run. 
</td>

</tr>

</table>

</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.3.2.2">0.3.2.2</a> runconfigs.config file
</h4>
<div class="Unindented">

<table>

<tr>

<td align="left" valign="top">
section
</td>
<td align="left" valign="top">
variable
</td>
<td align="left" valign="top">
value
</td>
<td align="left" valign="top">
required?
</td>
<td align="left" valign="top">
comment
</td>

</tr>
<tr>

<td align="left" valign="top">
[default]
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
any
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
variables set in this section will be available for all runs, defining the same variable in another section will override the value from the default section
</td>

</tr>
<tr>

<td align="left" valign="top">
[field1value/field2value...]
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
any
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
the values in this section will be set for any run where field1 is field1value, field2 is field2value and fieldN is fieldNvalue. 
</td>

</tr>

</table>

</div>
<div class="Indented">
Example: a test suite that checks that a piece of software works correctly for different customer configurations and locations each of which is done as a separate release regression run. The fields, CUSTOMER and LOCATION were chosen. The following runconfigs.config file would set some variables specific to runs for megacorp in India and femtocorp in the Cook Islands and New Zealand:
</div>
<div class="Code">
# runconfigs.config
</div>
<div class="Code">
[default]
</div>
<div class="Code">
ENCRYTION true



</div>
<div class="Code">
[megacorp/india]
</div>
<div class="Code">
TESTPATH /nfs/testing/megacorp_runs



</div>
<div class="Code">
[femtocorp/cook_islands]
</div>
<div class="Code">
ENCRYTION false
</div>
<div class="Code">
TESTPATH /afs/kiatoa/testing/cook_islands



</div>
<div class="Code">
[femtocorp/new_zealand]
</div>
<div class="Code">
TESTPATH /afs/kiatao/testing/new_zealand



</div>
<div class="Code">
[megacorp/new_zealand]
</div>
<div class="Code">
TESTPATH /nfs/testing/megacorp_runs
</div>
<div class="Paragraph-">
<a class="toc" name="toc-Paragraph*-1"></a>Running megatest like this:
</div>
<div class="Code">
megatest :CUSTOMER megacorp :LOCATION new_zealand :runname week12_2011_run1 -runall
</div>
<div class="Paragraph-">
<a class="toc" name="toc-Paragraph*-2"></a>Would set:
</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.3">0.3.3</a> Writing tests
</h3>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.3.3.1">0.3.3.1</a> testconfig file
</h4>
<div class="Unindented">

<table>

<tr>

<td align="left" valign="top">
section
</td>
<td align="left" valign="top">
variable
</td>
<td align="left" valign="top">
value
</td>
<td align="left" valign="top">
required?
</td>
<td align="left" valign="top">
comments
</td>

</tr>
<tr>

<td align="left" valign="top">
[setup]
</td>
<td align="left" valign="top">
runscript
</td>
<td align="left" valign="top">
name of script to execute for this test
</td>
<td align="left" valign="top">
yes
</td>
<td align="left" valign="top">
The script must be executable and either provide the full path or put a copy at the top of your test directory
</td>

</tr>
<tr>

<td align="left" valign="top">
[requirements]
</td>
<td align="left" valign="top">
waiton
</td>
<td align="left" valign="top">
list of valid test names
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
This test will not run until the named tests are state completed and status PASS
</td>

</tr>
<tr>

<td align="left" valign="top">
[items]
</td>
<td align="left" valign="top">
any valid
</td>
<td align="left" valign="top">
list of values
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
The test will be repeated once for each item with the variable name set to the value. If there is more than one variable then the test will be run against all unique combinations of the values
</td>

</tr>

</table>




















































































































































































































































































































































</div>

<hr/>
<p>Copyright (C) 2011 Matt Welland</p>


</div>
</body>
</html>







|

>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>

<

<









>


<









>


<









>


<









>


<









>


<









>


<









>


>
>
>
>
>
>
>

>
>
>
>









>

>

>


|


|


<

<

<















>


<















>


<















>


<















>


<















>


<















>


<















>


<















>


<















>

>

>


|


<

<

<















>


<















>


<















>

>

>












>
>
>






>
>
>









>
>
>






>
>
>








|





|








|


|


<

<

<















>


<















>


<















>


<















>

>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


|
|
>
>



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
580
581
582
583
584
585
586
587
588
589
590

591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608

609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626

627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651

652

653

654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671

672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689

690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783

784

785

786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803

804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821

822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839

840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
<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">
Purpose
</td>
<td align="left" valign="top">
Default value/Comment
</td>

</tr>
<tr>

<td align="left" valign="top">
MT_CMDINFO
</td>
<td align="left" valign="top">
Conveys test variables to the megatest test runner.
</td>
<td align="left" valign="top">
Not for use by the end user
</td>

</tr>
<tr>

<td align="left" valign="top">
MT_TEST_RUN_DIR
</td>
<td align="left" valign="top">
Directory assigned by megatest for the test to run.
</td>
<td align="left" valign="top">
Tests can consider this their “home” directory
</td>

</tr>
<tr>

<td align="left" valign="top">
MT_TEST_NAME
</td>
<td align="left" valign="top">
Name of the test, corrosponds to the directory name under tests.
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">
MT_ITEM_INFO
</td>
<td align="left" valign="top">
Iterated tests will set this to a sequence of key/values ((KEY val) ...) 
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">
MT_RUN_AREA_HOME
</td>
<td align="left" valign="top">
Directory where megatest was launched from and where the tests code can be found
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">
MT_RUNNAME
</td>
<td align="left" valign="top">
Name of this run as set by the :runname parameter
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
MT_MEGATEST
</td>
<td align="left" valign="top">
Path/Filename to megatest executable. Found either from called path or but using the “exectuable” keyword in the [setup] section.
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
&lt;field1&gt; ....
</td>
<td align="left" valign="top">
The field values as set on the megatest -runall command line (e.g. :field1 abc)
</td>
<td align="left" valign="top">
Planning ahead your field names is important so as to avoid collisions with other environment variables
</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">
variable
</td>
<td align="left" valign="top">
value
</td>
<td align="left" valign="top">
required
</td>
<td align="left" valign="top">
comment
</td>

</tr>
<tr>

<td align="left" valign="top">
[setup]
</td>
<td align="left" valign="top">
max_concurrent_jobs
</td>
<td align="left" valign="top">
if variable is not defined no limit on jobs
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">

</td>
<td align="left" valign="top">
executable
</td>
<td align="left" valign="top">
full path to megatest binary
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
Use only if necessary, megatest will extract the location from where it used to launch and add append that to the PATH for test runs.
</td>

</tr>
<tr>

<td align="left" valign="top">

</td>
<td align="left" valign="top">
runsdir
</td>
<td align="left" valign="top">
full path to where the link tree to all runs will be created
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
Because your runs may be spread out over several disk partitions a central link tree is created to make finding all the runs easy.
</td>

</tr>
<tr>

<td align="left" valign="top">
[fields]
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
at least one
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">
[jobtools]
</td>
<td align="left" valign="top">
launcher
</td>
<td align="left" valign="top">
command line used to launch jobs - the job command (megatest -execute) will be appended to this
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">

</td>
<td align="left" valign="top">
workhosts
</td>
<td align="left" valign="top">
list of hostnames to run jobs on NOT SUPPORTED RIGHT NOW
</td>
<td align="left" valign="top">
n/a
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>

<td align="left" valign="top">
[env-override]
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
any string
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
These are set on the test launching machine, not the test running machine. Typical usage is to control the host or run queue for launching tests. These values will not be seen by the test when it runs.
</td>

</tr>
<tr>

<td align="left" valign="top">
[disks]
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
a valid path writable by the test launching process and by the test process
</td>
<td align="left" valign="top">
yes
</td>
<td align="left" valign="top">
The disk usage balancing algorithm is to choose the disk with the least space for each test run. 
</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">
variable
</td>
<td align="left" valign="top">
value
</td>
<td align="left" valign="top">
required?
</td>
<td align="left" valign="top">
comment
</td>

</tr>
<tr>

<td align="left" valign="top">
[default]
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
any
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
variables set in this section will be available for all runs, defining the same variable in another section will override the value from the default section
</td>

</tr>
<tr>

<td align="left" valign="top">
[field1value/field2value...]
</td>
<td align="left" valign="top">
string of letters, numbers and underscore
</td>
<td align="left" valign="top">
any
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
the values in this section will be set for any run where field1 is field1value, field2 is field2value and fieldN is fieldNvalue. 
</td>

</tr>

</table>

</div>
<div class="Indented">
Example: a test suite that checks that a piece of software works correctly for different customer configurations and locations each of which is done as a separate release regression run. The fields, CUSTOMER and LOCATION were chosen. The following runconfigs.config file would set some variables specific to runs for megacorp in India and femtocorp in the Cook Islands and New Zealand:
</div>
<div class="Code">
# runconfigs.config
</div>
<div class="Code">
[default]
</div>
<div class="Code">
ENCRYTION true
</div>
<div class="Code">
#
</div>
<div class="Code">
[megacorp/india]
</div>
<div class="Code">
TESTPATH /nfs/testing/megacorp_runs
</div>
<div class="Code">
#
</div>
<div class="Code">
[femtocorp/cook_islands]
</div>
<div class="Code">
ENCRYTION false
</div>
<div class="Code">
TESTPATH /afs/kiatoa/testing/cook_islands
</div>
<div class="Code">
#
</div>
<div class="Code">
[femtocorp/new_zealand]
</div>
<div class="Code">
TESTPATH /afs/kiatao/testing/new_zealand
</div>
<div class="Code">
#
</div>
<div class="Code">
[megacorp/new_zealand]
</div>
<div class="Code">
TESTPATH /nfs/testing/megacorp_runs
</div>
<div class="Paragraph-">
<a class="toc" name="toc-Paragraph--1"></a>Running megatest like this:
</div>
<div class="Code">
megatest :CUSTOMER megacorp :LOCATION new_zealand :runname week12_2011_run1 -runall
</div>
<div class="Paragraph-">
<a class="toc" name="toc-Paragraph--2"></a>Would set:
</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">
variable
</td>
<td align="left" valign="top">
value
</td>
<td align="left" valign="top">
required?
</td>
<td align="left" valign="top">
comments
</td>

</tr>
<tr>

<td align="left" valign="top">
[setup]
</td>
<td align="left" valign="top">
runscript
</td>
<td align="left" valign="top">
name of script to execute for this test
</td>
<td align="left" valign="top">
yes
</td>
<td align="left" valign="top">
The script must be executable and either provide the full path or put a copy at the top of your test directory
</td>

</tr>
<tr>

<td align="left" valign="top">
[requirements]
</td>
<td align="left" valign="top">
waiton
</td>
<td align="left" valign="top">
list of valid test names
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
This test will not run until the named tests are state completed and status PASS
</td>

</tr>
<tr>

<td align="left" valign="top">
[items]
</td>
<td align="left" valign="top">
any valid
</td>
<td align="left" valign="top">
list of values
</td>
<td align="left" valign="top">
no
</td>
<td align="left" valign="top">
The test will be repeated once for each item with the variable name set to the value. If there is more than one variable then the test will be run against all unique combinations of the values
</td>

</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>
<td align="left" valign="top">
parameter
</td>
<td align="left" valign="top">
purpose
</td>
<td align="left" valign="top">
comments
</td>

</tr>
<tr>
<td align="left" valign="top">
-h
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">
brief help
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-runall
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">
run all tests
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-runtests
</td>
<td align="left" valign="top">
test1,test2,...
</td>
<td align="left" valign="top">
run one or more tests
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-step
</td>
<td align="left" valign="top">
stepname
</td>
<td align="left" valign="top">
record a step
</td>
<td align="left" valign="top">
requires :state and :status
</td>

</tr>
<tr>
<td align="left" valign="top">
-test-status
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">
record the test status
</td>
<td align="left" valign="top">
requires :state and :status
</td>

</tr>
<tr>
<td align="left" valign="top">
-setlog
</td>
<td align="left" valign="top">
logfilename
</td>
<td align="left" valign="top">
set the logfile name for a test
</td>
<td align="left" valign="top">
path is assumed to be relative to the test run directory
</td>

</tr>
<tr>
<td align="left" valign="top">
-set-toplog
</td>
<td align="left" valign="top">
logfilename
</td>
<td align="left" valign="top">
set the logfile name for the top test in an iterated test run
</td>
<td align="left" valign="top">
each sub test can have its own logfile set
</td>

</tr>
<tr>
<td align="left" valign="top">
-m
</td>
<td align="left" valign="top">
“comment”
</td>
<td align="left" valign="top">
sets a comment for the step, test or run
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
:runname
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
:state
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
:status
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-list-runs
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-testpatt
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-itempatt
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-showkeys
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-force
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-xterm
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-remove-runs
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
<i>Test helpers</i>
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-runstep
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-logpro
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">

</td>

</tr>

</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>