Megatest

Diff
Login

Differences From Artifact [b50d911082]:

To Artifact [98c122c376]:


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false







|







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\default_output_format default
\output_sync 1
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
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
LatexCommand tableofcontents

\end_inset


\end_layout

\begin_layout Section
About Megatest
\end_layout

\begin_layout Subsection
Megatest design philosophy
\end_layout

\begin_layout Standard
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.
 
\end_layout

\begin_layout Subsection
Megatest architecture
\end_layout

\begin_layout Standard
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.







|



|















|







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
LatexCommand tableofcontents

\end_inset


\end_layout

\begin_layout Chapter
About Megatest
\end_layout

\begin_layout Section
Megatest design philosophy
\end_layout

\begin_layout Standard
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.
 
\end_layout

\begin_layout Section
Megatest architecture
\end_layout

\begin_layout Standard
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.
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
call home
\begin_inset Quotes erd
\end_inset

 to your master sqlite3 database.
\end_layout

\begin_layout Section
Installation
\end_layout

\begin_layout Subsection
Compilation
\end_layout

\begin_layout Subsubsection
Dependencies
\end_layout

\begin_layout Standard
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 dependencie
s on Linux.
\end_layout

\begin_layout Subsubsection
Build and install
\end_layout

\begin_layout Standard
Run 
\begin_inset Quotes eld
\end_inset

make test
\begin_inset Quotes erd
\end_inset

 to create the megatest executable.
 You may wish to copy the executable to a centrally accessible location.
\end_layout

\begin_layout Subsection
Setup
\end_layout

\begin_layout Subsubsection
Create megatest.config
\end_layout

\begin_layout Standard
Create the file megatest.config using the megatest.config template from the
 tests directory.
 At a minimum you need the following:







|



|



|









|
















|



|







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
call home
\begin_inset Quotes erd
\end_inset

 to your master sqlite3 database.
\end_layout

\begin_layout Chapter
Installation
\end_layout

\begin_layout Section
Compilation
\end_layout

\begin_layout Subsection
Dependencies
\end_layout

\begin_layout Standard
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 dependencie
s on Linux.
\end_layout

\begin_layout Subsection
Build and install
\end_layout

\begin_layout Standard
Run 
\begin_inset Quotes eld
\end_inset

make test
\begin_inset Quotes erd
\end_inset

 to create the megatest executable.
 You may wish to copy the executable to a centrally accessible location.
\end_layout

\begin_layout Section
Setup
\end_layout

\begin_layout Subsection
Create megatest.config
\end_layout

\begin_layout Standard
Create the file megatest.config using the megatest.config template from the
 tests directory.
 At a minimum you need the following:
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
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
[disks]
\end_layout

\begin_layout Code
1 /tmp 
\end_layout

\begin_layout Subsubsection
Create runconfigs.config
\end_layout

\begin_layout Standard
This file is used to set environment variables that are run specific.
 You can simply create an empty file to start.







\end_layout










\begin_layout Subsubsection
Create the tests directory and your first test
\end_layout

\begin_layout Standard
The structure should look like this:
\end_layout






\begin_layout Code

../tests
\end_layout

\begin_layout Code

├── megatest.config
\end_layout

\begin_layout Code

├── runconfigs.config 
\end_layout

\begin_layout Code

└── tests 
\end_layout

\begin_layout Code

    └── mytest 
\end_layout

\begin_layout Code

       ├── main.sh
\end_layout

\begin_layout Code

       └── testconfig 
\end_layout






\begin_layout Subsubsection
Create the testconfig file for your test
\end_layout






\begin_layout Code

[setup]
\end_layout

\begin_layout Code

runscript main.sh
\end_layout






\begin_layout Subsubsection
Create your test running script, main.sh
\end_layout






\begin_layout Code

#!/bin/bash
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

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

\begin_layout Code





megatest -test-status :state COMPLETED :status PASS -m "This is a test level

 comment"



\end_layout

\begin_layout Subsubsection
Run megatest and watch your run progress
\end_layout






\begin_layout Code

megatest :field1 abc :field2 def :runname 2011week08.4a -runall
\end_layout

\begin_layout Code





watch megatest -list-runs %
\end_layout
































\begin_layout Section



























































































































































































































































































































































































































































































































































Reference
\end_layout

\begin_layout Subsection
Configuration files
\end_layout

\begin_layout Subsubsection
Sections
\end_layout

\begin_layout Standard
[section name]
\end_layout

\begin_layout Standard
This creates a section named 
\begin_inset Quotes eld
\end_inset

section name
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Subsubsection
Variables
\end_layout

\begin_layout Standard
VARX has this value
\end_layout

\begin_layout Standard
The variable 
\begin_inset Quotes eld
\end_inset

VARX
\begin_inset Quotes erd
\end_inset

 will have the value 
\begin_inset Quotes eld
\end_inset

has this value
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Subsubsection
Includes
\end_layout

\begin_layout Standard
[include filename]
\end_layout








|






>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
|







>
>
>
>
>
|
>



|
>
|


|
>
|


|
>
|


|
>
|


|
>
|


|
>
|


>
>
>
>
>
|



>
>
>
>
>
|
>



|
>



>
>
>
>
>
|



>
>
>
>
>
|
>



|



|
>



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


|



>
>
>
>
>
|
>



|
>
>
>
>
>



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

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



|
|


|







|











|







|



















|







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
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
[disks]
\end_layout

\begin_layout Code
1 /tmp 
\end_layout

\begin_layout Subsection
Create runconfigs.config
\end_layout

\begin_layout Standard
This file is used to set environment variables that are run specific.
 You can simply create an empty file to start.
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

# runconfigs.config
\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Subsection
Create the tests directory and your first test
\end_layout

\begin_layout Standard
The structure should look like this:
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

../tests
\end_layout

\begin_layout Plain Layout

  ├── megatest.config
\end_layout

\begin_layout Plain Layout

  ├── runconfigs.config
\end_layout

\begin_layout Plain Layout

  └── tests
\end_layout

\begin_layout Plain Layout

     └── mytest
\end_layout

\begin_layout Plain Layout

           ├── main.sh
\end_layout

\begin_layout Plain Layout

           └── testconfig
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
Create the testconfig file for your test
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

[setup]
\end_layout

\begin_layout Plain Layout

runscript main.sh
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
Create your test running script, main.sh
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

#!/bin/bash
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

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

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

megatest -test-status :state COMPLETED :status PASS -m "This is a comment"
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
Run megatest and watch your run progress
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

megatest :field1 abc :field2 def :runname 2011week08.4a -runall
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

watch megatest -list-runs %
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# OR use the dashboard
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

dashboard &
\end_layout

\end_inset


\end_layout

\begin_layout Code

\end_layout

\begin_layout Chapter
How to Write Tests
\end_layout

\begin_layout Section
A Simple Test with one Step
\end_layout

\begin_layout Subsection
Create your test directory.
 The directory name will be the name of the test
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

mkdir simpletest
\end_layout

\begin_layout Plain Layout

cd simpletest
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
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.
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

# testconfig
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

[setup]
\end_layout

\begin_layout Plain Layout

runscript main.csh
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
Create your main.csh script
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

#!/bin/tcsh -x
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# run the cpu1 simulation.
\end_layout

\begin_layout Plain Layout

#   The step name is "run_simulation"
\end_layout

\begin_layout Plain Layout

#   The commandline being run for this step is "runsim cpu1"
\end_layout

\begin_layout Plain Layout

#   The logpro file to validate the output from the run is "runsim.logpro"
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

$MEGATEST -runstep run_simulation -logpro runsim.logpro "runsim cpu1"
\end_layout

\end_inset


\end_layout

\begin_layout Standard
You can now run megatest and the created test directory will contain the
 new files 
\begin_inset Quotes eld
\end_inset

run_simulation.html
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

run_simulation.log
\begin_inset Quotes erd
\end_inset

.
 If you are using the dashboard you can click on the run and then push the
 
\begin_inset Quotes eld
\end_inset

View log
\begin_inset Quotes erd
\end_inset

 button to view the log file in firefox.
\end_layout

\begin_layout Section
Simple Test with Multiple Steps 
\end_layout

\begin_layout Standard
To run multiple steps simply add them to the main.csh file.
 Here we add a step to test 
\begin_inset Quotes eld
\end_inset

cpu2
\begin_inset Quotes erd
\end_inset

.
 The second step that tests cpu2 will only run after the step that tested
 
\begin_inset Quotes eld
\end_inset

cpu1
\begin_inset Quotes erd
\end_inset

 completes.
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

#!/bin/tcsh -x
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# run the cpu1 simulation.
\end_layout

\begin_layout Plain Layout

#   The step name is "run_simulation"
\end_layout

\begin_layout Plain Layout

#   The commandline being run for this step is "runsim cpu1"
\end_layout

\begin_layout Plain Layout

#   The logpro file to validate the output from the run is "runsim.logpro"
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

$MEGATEST -runstep run_simulation_cpu1 -logpro runsim.logpro "runsim cpu1"
\end_layout

\begin_layout Plain Layout

$MEGATEST -runstep run_simulation_cpu2 -logpro runsim.logpro "runsim cpu2"
\end_layout

\end_inset


\end_layout

\begin_layout Section
Simple Test, Multiple Steps, Some in Parallel 
\end_layout

\begin_layout Subsection
The Makefile
\end_layout

\begin_layout Standard
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 
\begin_inset Quotes eld
\end_inset

runsim cpu1
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

runsim cpu2
\begin_inset Quotes erd
\end_inset

 in parallel.
 For more information on make try 
\begin_inset Quotes eld
\end_inset

info make
\begin_inset Quotes erd
\end_inset

 at the Linux command prompt.
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

# Example Makefile to run two steps in parallel
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

RTLDIR=/path/to/rtl
\end_layout

\begin_layout Plain Layout

CPUS = cpu1 cpu2
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

run_simulation_$(CPUS).html : $(RTLDIR)/$(CPUS)
\end_layout

\begin_layout Plain Layout

	$(MEGATEST) -runstep run_simulation_$(CPUS) -logpro runsim.logpro "runsim
 $(CPUS)
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
The main.csh file
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

#!/bin/tcsh -x
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# run the cpu1 and cpu2 simulations in parallel.
 
\end_layout

\begin_layout Plain Layout

# The -j parameter tells make how many jobs it may run in parallel
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

make -j 2 
\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Section
Simple Test with Iteration
\end_layout

\begin_layout Standard
Since no jobs run after the cpu1 and cpu2 simulations inside the test there
 it is possible to run this test in iterated mode.
\end_layout

\begin_layout Subsection
Update you testconfig file for iteration
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

[setup]
\end_layout

\begin_layout Plain Layout

runscript main.csh
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

[items]
\end_layout

\begin_layout Plain Layout

CPU cpu1 cpu2
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
Rewrite your main.csh for iteration
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

#!/bin/tcsh -x
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# run the cpu simulation but now use the environment variable $CPU
\end_layout

\begin_layout Plain Layout

# to select what cpu to run the simulation against
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

$MEGATEST -runstep run_simulation -logpro runsim.logpro "runsim $CPU"
\end_layout

\end_inset


\end_layout

\begin_layout Section
Tests with Inter-test dependencies
\end_layout

\begin_layout Standard
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
 
\begin_inset Quotes eld
\end_inset

PASS
\begin_inset Quotes erd
\end_inset

.
 In either of these scenarios you can use the 
\begin_inset Quotes eld
\end_inset

waiton
\begin_inset Quotes erd
\end_inset

 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 
\begin_inset Quotes eld
\end_inset

system
\begin_inset Quotes erd
\end_inset

 test if the 
\begin_inset Quotes eld
\end_inset

cpu
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

mem
\begin_inset Quotes erd
\end_inset

 tests either do not complete or complete but with status 
\begin_inset Quotes eld
\end_inset

FAIL
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Standard
\begin_inset listings
inline false
status open

\begin_layout Plain Layout

# testconfig for the "system" test
\end_layout

\begin_layout Plain Layout

[setup]
\end_layout

\begin_layout Plain Layout

runscript main.csh
\end_layout

\begin_layout Plain Layout

waiton cpu mem
\end_layout

\end_inset


\end_layout

\begin_layout Chapter
Reference
\end_layout

\begin_layout Section
Configuration file Syntax
\end_layout

\begin_layout Subsection
Sections
\end_layout

\begin_layout Standard
[section name]
\end_layout

\begin_layout Quotation
This creates a section named 
\begin_inset Quotes eld
\end_inset

section name
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Subsection
Variables
\end_layout

\begin_layout Standard
VARX has this value
\end_layout

\begin_layout Quotation
The variable 
\begin_inset Quotes eld
\end_inset

VARX
\begin_inset Quotes erd
\end_inset

 will have the value 
\begin_inset Quotes eld
\end_inset

has this value
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Subsection
Includes
\end_layout

\begin_layout Standard
[include filename]
\end_layout

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
include 
\begin_inset Quotes eld
\end_inset

 (with the whitespace).
\end_layout

\begin_layout Subsubsection
Setting a variable by running a command
\end_layout

\begin_layout Standard
VARNAME [system ls /tmp]
\end_layout

\begin_layout Standard
The variable 
\begin_inset Quotes eld
\end_inset

VARNAME
\begin_inset Quotes erd
\end_inset

 will get a value created by the Unix command 
\begin_inset Quotes eld
\end_inset

ls /tmp
\begin_inset Quotes erd
\end_inset

.
 All lines of output from the command will be joined with a space.
\end_layout

\begin_layout Subsubsection
Notes
\end_layout

\begin_layout Itemize
Some variables are infered as lists.
 Each token on the line separated by whitespace will be member of the list.
\end_layout

\begin_layout Itemize
Comments (lines starting with #) and blank lines are ignored.
\end_layout

\begin_layout Subsection
Environment variables
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="9" columns="3">
<features tabularvalignment="middle">







|







|




















|












|







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
include 
\begin_inset Quotes eld
\end_inset

 (with the whitespace).
\end_layout

\begin_layout Subsection
Setting a variable by running a command
\end_layout

\begin_layout Standard
VARNAME [system ls /tmp]
\end_layout

\begin_layout Quotation
The variable 
\begin_inset Quotes eld
\end_inset

VARNAME
\begin_inset Quotes erd
\end_inset

 will get a value created by the Unix command 
\begin_inset Quotes eld
\end_inset

ls /tmp
\begin_inset Quotes erd
\end_inset

.
 All lines of output from the command will be joined with a space.
\end_layout

\begin_layout Subsection
Notes
\end_layout

\begin_layout Itemize
Some variables are infered as lists.
 Each token on the line separated by whitespace will be member of the list.
\end_layout

\begin_layout Itemize
Comments (lines starting with #) and blank lines are ignored.
\end_layout

\begin_layout Section
Environment variables
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="9" columns="3">
<features tabularvalignment="middle">
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsection
Configuration files
\end_layout

\begin_layout Subsubsection
megatest.config
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="9" columns="5">
<features tabularvalignment="middle">







|



|







1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
</lyxtabular>

\end_inset


\end_layout

\begin_layout Section
Configuration files
\end_layout

\begin_layout Subsection
megatest.config
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="9" columns="5">
<features tabularvalignment="middle">
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
runconfigs.config file
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="5">
<features tabularvalignment="middle">







|







1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsection
runconfigs.config file
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="5">
<features tabularvalignment="middle">
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
ENCRYPTION true
\end_layout

\begin_layout Code
TESTPATH /nfs/testing/megacorp_runs
\end_layout

\begin_layout Subsection
Writing tests
\end_layout

\begin_layout Subsubsection
testconfig file
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="5">
<features tabularvalignment="middle">







|



|







2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
ENCRYPTION true
\end_layout

\begin_layout Code
TESTPATH /nfs/testing/megacorp_runs
\end_layout

\begin_layout Section
Writing tests
\end_layout

\begin_layout Subsection
testconfig file
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="5">
<features tabularvalignment="middle">