Megatest

Diff
Login

Differences From Artifact [2e56021d96]:

To Artifact [4ed5338fae]:


519
520
521
522
523
524
525

526
527
528
529
530
531
532
Create the file megatest.config using the megatest.config template from the
 tests directory.
 At a minimum you need the following:
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

# Fields are the keys under which your test runs are organized
\end_layout







>







519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
Create the file megatest.config using the megatest.config template from the
 tests directory.
 At a minimum you need the following:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

# Fields are the keys under which your test runs are organized
\end_layout
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
\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 Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

# runconfigs.config
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
Create the tests directory and your first test
\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







>



















>





<
>




|




|




|




|




|




|













>







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
\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 Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

# runconfigs.config
\end_layout

\end_inset


\end_layout

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

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout


mt
\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
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

[setup]
\end_layout
726
727
728
729
730
731
732

733
734
735
736
737
738
739

\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







>







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

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

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

#!/bin/bash
\end_layout
759
760
761
762
763
764
765

766
767
768
769
770
771
772

\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







>







764
765
766
767
768
769
770
771
772
773
774
775
776
777
778

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

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

megatest :field1 abc :field2 def :runname 2011week08.4a -runall
\end_layout
818
819
820
821
822
823
824

825
826
827
828
829
830
831

\begin_layout Subsection
A Simple Test with one Step
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

mkdir simpletest
\end_layout







>







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

\begin_layout Subsection
A Simple Test with one Step
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

mkdir simpletest
\end_layout
885
886
887
888
889
890
891

892
893
894
895
896
897
898
 
\end_layout

\begin_layout Standard
\noindent
\align left
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

#!/bin/tcsh -x
\end_layout







>







892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
 
\end_layout

\begin_layout Standard
\noindent
\align left
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

#!/bin/tcsh -x
\end_layout
956
957
958
959
960
961
962

963
964
965
966
967
968
969
 Here we add a step to test “cpu2”.
 The second step that tests cpu2 will only run after the step that tested
 “cpu1” completes.
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

#!/bin/tcsh -x
\end_layout







>







964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
 Here we add a step to test “cpu2”.
 The second step that tests cpu2 will only run after the step that tested
 “cpu1” completes.
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

#!/bin/tcsh -x
\end_layout
1033
1034
1035
1036
1037
1038
1039

1040
1041
1042
1043
1044
1045
1046
 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.
\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







>







1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
 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.
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

# Example Makefile to run two steps in parallel
\end_layout
1081
1082
1083
1084
1085
1086
1087

1088
1089
1090
1091
1092
1093
1094

\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







>







1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105

\begin_layout Subsection
The main.csh file
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

#!/bin/tcsh -x
\end_layout
1140
1141
1142
1143
1144
1145
1146

1147
1148
1149
1150
1151
1152
1153

\begin_layout Subsection
Update your testconfig file for iteration
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

[setup]
\end_layout







>







1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165

\begin_layout Subsection
Update your testconfig file for iteration
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

[setup]
\end_layout
1180
1181
1182
1183
1184
1185
1186

1187
1188
1189
1190
1191
1192
1193

\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
\noindent

#!/bin/tcsh -x







>







1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206

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

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout
\noindent

#!/bin/tcsh -x
1263
1264
1265
1266
1267
1268
1269

1270
1271
1272
1273
1274
1275
1276
 before being launched.
 In this example there is no point in running the “system” test if the “cpu”
 and “mem” tests either do not complete or complete but with status “FAIL”.
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout
\noindent

# testconfig for the "system" test







>







1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
 before being launched.
 In this example there is no point in running the “system” test if the “cpu”
 and “mem” tests either do not complete or complete but with status “FAIL”.
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout
\noindent

# testconfig for the "system" test
1306
1307
1308
1309
1310
1311
1312

1313
1314
1315
1316
1317
1318
1319
\begin_layout Standard
Use the -load-test-data switch to roll up arbitrary data from a test into
 the test_data table.
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

# Fields are:
\end_layout







>







1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
\begin_layout Standard
Use the -load-test-data switch to roll up arbitrary data from a test into
 the test_data table.
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

# Fields are:
\end_layout
1414
1415
1416
1417
1418
1419
1420

1421
1422
1423
1424
1425
1426
1427
To roll up a number of tests in a sequence of runs to a single run use the
 -rollup command.
 
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

megatest -rollup :sysname ubuntu :fsname nfs :datapath none :runname rollup_ww38
\end_layout







>







1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
To roll up a number of tests in a sequence of runs to a single run use the
 -rollup command.
 
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

megatest -rollup :sysname ubuntu :fsname nfs :datapath none :runname rollup_ww38
\end_layout
1442
1443
1444
1445
1446
1447
1448

1449
1450
1451
1452
1453
1454
1455

\begin_layout Section
Dashboard
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

> dashboard &
\end_layout







>







1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472

\begin_layout Section
Dashboard
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

> dashboard &
\end_layout
1492
1493
1494
1495
1496
1497
1498

1499
1500
1501
1502
1503
1504
1505
\begin_layout Standard
And OpenDocument multi-paned spreadsheet can be generated from the megatest.db
 file by running -extract-ods
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

megatest -extract-ods results.ods :runname % 
\end_layout







>







1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
\begin_layout Standard
And OpenDocument multi-paned spreadsheet can be generated from the megatest.db
 file by running -extract-ods
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

megatest -extract-ods results.ods :runname % 
\end_layout
1522
1523
1524
1525
1526
1527
1528

1529
1530
1531
1532
1533
1534
1535

\begin_layout Subsection
Getting previous test paths
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

megatest -test-paths -target %/%/% :runname % -testpatt % -itempatt % :status
 PASS 







>







1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554

\begin_layout Subsection
Getting previous test paths
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

megatest -test-paths -target %/%/% :runname % -testpatt % -itempatt % :status
 PASS 
1559
1560
1561
1562
1563
1564
1565

1566
1567
1568
1569
1570
1571
1572

\begin_layout Standard
flows/<flowname>.config
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

# Flow: <flowname>
\end_layout







>







1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592

\begin_layout Standard
flows/<flowname>.config
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

# Flow: <flowname>
\end_layout
1659
1660
1661
1662
1663
1664
1665

1666
1667
1668
1669
1670
1671
1672

\begin_layout Subsection
Run the flow
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

megatest -runflow <flowname> :FIELD1 val1 :FIELD2 val2 :runname wk32.4
\end_layout







>







1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693

\begin_layout Subsection
Run the flow
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

megatest -runflow <flowname> :FIELD1 val1 :FIELD2 val2 :runname wk32.4
\end_layout
1722
1723
1724
1725
1726
1727
1728

1729
1730
1731
1732
1733
1734
1735

\begin_layout Subsubsection
Sections
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

[section name]
\end_layout







>







1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757

\begin_layout Subsubsection
Sections
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily}"
inline false
status open

\begin_layout Plain Layout

[section name]
\end_layout
1745
1746
1747
1748
1749
1750
1751

1752
1753
1754
1755
1756
1757
1758

\begin_layout Subsubsection
Variables
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

VARX has this value
\end_layout







>







1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781

\begin_layout Subsubsection
Variables
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily}"
inline false
status open

\begin_layout Plain Layout

VARX has this value
\end_layout
1792
1793
1794
1795
1796
1797
1798

1799
1800
1801
1802
1803
1804
1805

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

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

VARNAME [system ls /tmp]
\end_layout







>







1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829

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

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily}"
inline false
status open

\begin_layout Plain Layout

VARNAME [system ls /tmp]
\end_layout
2699
2700
2701
2702
2703
2704
2705

2706
2707
2708
2709
2710
2711
2712
 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:
\end_layout

\begin_layout Standard
\begin_inset listings

inline false
status open

\begin_layout Plain Layout

# runconfigs.config
\end_layout







>







2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
 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:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\small\ttfamily},language=sh"
inline false
status open

\begin_layout Plain Layout

# runconfigs.config
\end_layout