Megatest

Diff
Login

Differences From Artifact [707c48c80f]:

To Artifact [a65572d7c2]:


1357
1358
1359
1360
1361
1362
1363




















































































































































































1364
1365
1366
1367
1368
1369
1370
<div class="listingblock">
<div class="title">Starting dashboard</div>
<div class="content monospaced">
<pre>dashboard -rows 24</pre>
</div></div>
</div>
</div>




















































































































































































</div>
<div class="sect1">
<h2 id="_writing_tests">Writing Tests</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_creating_a_new_test">Creating a new Test</h3>
<div class="paragraph"><p>The following steps will add a test "yourtestname" to your testsuite. This assumes







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







1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
<div class="listingblock">
<div class="title">Starting dashboard</div>
<div class="content monospaced">
<pre>dashboard -rows 24</pre>
</div></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_study_plan">Study Plan</h2>
<div class="sectionbody">
<div class="paragraph"><p>Megatest is an extensive program with a lot to learn. Following are some paths through the material to smooth the learning path.</p></div>
<div class="sect2">
<h3 id="_basic_concepts_suggest_you_pick_these_up_on_the_way">Basic Concepts (suggest you pick these up on the way)</h3>
<div class="ulist"><ul>
<li>
<p>
Components of automation; run, test, iteration
</p>
</li>
<li>
<p>
Selectors; target, runname, and testpatt
</p>
</li>
</ul></div>
</div>
<div class="sect2">
<h3 id="_running_testsuites_or_automation">Running Testsuites or Automation</h3>
<div class="ulist"><ul>
<li>
<p>
Using the dashboard gui (recommended)
</p>
<div class="ulist"><ul>
<li>
<p>
Using the "Runs" panel.
</p>
</li>
<li>
<p>
Using the "Run Control" panel.
</p>
</li>
<li>
<p>
Using a test control panel
</p>
</li>
<li>
<p>
The Right Mouse Button menu
</p>
</li>
<li>
<p>
Debug features
</p>
<div class="ulist"><ul>
<li>
<p>
xterm
</p>
<div class="ulist"><ul>
<li>
<p>
pstree
</p>
</li>
<li>
<p>
log files; mt_copy.log, mt_launch.log
</p>
</li>
<li>
<p>
variables; megatest.csh, megatest.sh
</p>
</li>
<li>
<p>
testconfig dump, *testconfig
</p>
</li>
</ul></div>
</li>
<li>
<p>
State/status buttons
</p>
</li>
<li>
<p>
Run, Clean, KillReq
</p>
</li>
<li>
<p>
ReRunClean
</p>
</li>
</ul></div>
</li>
</ul></div>
</li>
<li>
<p>
Using the command line
</p>
<div class="ulist"><ul>
<li>
<p>
Getting help; megatest -h, megatest -manual
</p>
</li>
<li>
<p>
Starting runs; megatest -run
</p>
<div class="ulist"><ul>
<li>
<p>
Selection controls; -target, -runname and -testpatt
</p>
</li>
</ul></div>
</li>
</ul></div>
</li>
</ul></div>
</div>
<div class="sect2">
<h3 id="_writing_tests_and_flows">Writing Tests and Flows</h3>
<div class="ulist"><ul>
<li>
<p>
tests/<em>testname</em>/testconfig <a href="megatest_manual.html#_the_testconfig_file">testconfig details</a>
</p>
<div class="ulist"><ul>
<li>
<p>
iteration (one test applied to many inputs) <a href="megatest_manual.html#_iteration">test iteration</a>
</p>
</li>
<li>
<p>
dependencies <a href="megatest_manual.html#_requirements_section">test requirements</a>
</p>
</li>
</ul></div>
</li>
<li>
<p>
megatest areas
</p>
<div class="ulist"><ul>
<li>
<p>
megatest.config
</p>
</li>
</ul></div>
</li>
</ul></div>
</div>
<div class="sect2">
<h3 id="_advanced_topics">Advanced Topics</h3>
<div class="ulist"><ul>
<li>
<p>
Removing and keeping runs selectively <a href="megatest_manual.html#_managing_old_runs">managing runs</a>
</p>
</li>
<li>
<p>
Subruns <a href="megatest_manual.html#_nested_runs">nested runs</a>
</p>
</li>
<li>
<p>
Config file features <a href="megatest_manual.html#_config_file_helpers">config file features</a>
</p>
</li>
</ul></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_writing_tests">Writing Tests</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_creating_a_new_test">Creating a new Test</h3>
<div class="paragraph"><p>The following steps will add a test "yourtestname" to your testsuite. This assumes
2007
2008
2009
2010
2011
2012
2013




















2014
2015
2016
2017
2018
2019
2020
<div class="paragraph"><p>The runscript method is a brute force way to run scripts where the
user is responsible for setting STATE and STATUS</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>runscript main.csh</pre>
</div></div>
</div>




















</div>
<div class="sect2">
<h3 id="_requirements_section">Requirements section</h3>
<div class="listingblock">
<div class="title">Header</div>
<div class="content monospaced">
<pre>[requirements]</pre>







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







2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
<div class="paragraph"><p>The runscript method is a brute force way to run scripts where the
user is responsible for setting STATE and STATUS</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>runscript main.csh</pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="_iteration">Iteration</h3>
<div class="listingblock">
<div class="title">Sections for iteration</div>
<div class="content monospaced">
<pre># full combinations
[items]
A x y
B 1 2

# Yields: x/1 x/2 y/1 y/2

# tabled
[itemstable]
A x y
B 1 2

# Yields x/1 y/2</pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_requirements_section">Requirements section</h3>
<div class="listingblock">
<div class="title">Header</div>
<div class="content monospaced">
<pre>[requirements]</pre>
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
<div class="paragraph"><p>A item based waiton will start items in a test when the same-named
item is COMPLETED and PASS, CHECK or WAIVED in the prior test. This
was historically called "itemwait" mode. The terms "itemwait" and
"itemmatch" are synonyms.</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>[requirements]
waiton precedingtest
mode itemmatch</pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="_overriding_enviroment_variables">Overriding Enviroment Variables</h3>
<div class="paragraph"><p>Override variables before starting the test. Can include files (perhaps generated by megatest -envdelta or similar).</p></div>







<







2246
2247
2248
2249
2250
2251
2252

2253
2254
2255
2256
2257
2258
2259
<div class="paragraph"><p>A item based waiton will start items in a test when the same-named
item is COMPLETED and PASS, CHECK or WAIVED in the prior test. This
was historically called "itemwait" mode. The terms "itemwait" and
"itemmatch" are synonyms.</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>[requirements]

mode itemmatch</pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="_overriding_enviroment_variables">Overriding Enviroment Variables</h3>
<div class="paragraph"><p>Override variables before starting the test. Can include files (perhaps generated by megatest -envdelta or similar).</p></div>
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
# Use this trick to unset variables
#{scheme (unsetenv "FOOBAR")}</pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_itemmap_handling">Itemmap Handling</h3>
<div class="paragraph"><p>For cases were the dependent test has a similar but not identical
itempath to the downstream test an itemmap can allow for itemwait/itemmatch
mode by specifying rules on how to map the waiton&#8217;s item name to the current test&#8217;s item name.</p></div>
<div class="listingblock">
<div class="title">example for removing part of itemmap for waiton test (eg: item <span class="monospaced">foo-x/bar</span> depends on waiton&#8217;s item <span class="monospaced">y/bar</span>)</div>
<div class="content monospaced">
<pre>[requirements]
mode itemwait
waiton precedingtest
# itemmap &lt;item pattern for this test&gt;  &lt;item replacement pattern for waiton test&gt;
itemmap .*x/ y/</pre>
</div></div>
<div class="listingblock">
<div class="title">example for removing part of itemmap for waiton test (eg: item <span class="monospaced">foo/bar/baz</span> in this test depends on waiton&#8217;s item <span class="monospaced">baz</span>)</div>
<div class="content monospaced">
<pre># ## pattern replacement notes
#
# ## Example
# ## Remove everything up to the last /
[requirements]
mode itemwait
waiton precedingtest
# itemmap &lt;item pattern for this test&gt; &lt;nothing here indicates removal&gt;
itemmap .*/</pre>
</div></div>
<div class="listingblock">
<div class="title">example replacing part of itemmap for (eg: item <span class="monospaced">foo/1234</span> will imply waiton&#8217;s item <span class="monospaced">bar/1234</span>)</div>
<div class="content monospaced">
<pre>#
# ## Example
# ## Replace foo/ with bar/
[requirements]
mode itemwait
waiton precedingtest
# itemmap &lt;item pattern for this test&gt;  &lt;item replacement pattern for waiton test&gt;
itemmap foo/ bar/</pre>
</div></div>
<div class="listingblock">
<div class="title">example for backreference (eg: item <span class="monospaced">foo23/thud</span> will imply waiton&#8217;s item <span class="monospaced">num-23/bar/thud</span></div>
<div class="content monospaced">
<pre>#
# ## Example
# ## can use \{number} in replacement pattern to backreference a (capture) from matching pattern similar to sed or perl
[requirements]
mode itemwait
waiton precedingtest
# itemmap &lt;item pattern for this test&gt;  &lt;item replacement pattern for waiton test&gt;
itemmap foo(\d+)/ num-\1/bar/</pre>
</div></div>
<div class="listingblock">
<div class="title">example multiple itemmaps</div>
<div class="content monospaced">
<pre># multi-line; matches are applied in the listed order
# The following would map:
#   a123b321 to b321fooa123 then to 321fooa123p
#
[requirements]
mode itemwait
waiton precedingtest
itemmap (a\d+)(b\d+) \2foo\1
  b(.*) \1p</pre>
</div></div>
<div class="sect3">
<h4 id="_complex_mapping">Complex mapping</h4>
<div class="paragraph"><p>Complex mappings can be handled with a separate [itemmap] section (instead if an itemmap line in the [requirements] section)</p></div>
<div class="paragraph"><p>Each line in an itemmap section starts with a waiton test name followed by an itemmap expression</p></div>







|
|





<












<











<











<











<
<







2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281

2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293

2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304

2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315

2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326


2327
2328
2329
2330
2331
2332
2333
# Use this trick to unset variables
#{scheme (unsetenv "FOOBAR")}</pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_itemmap_handling">Itemmap Handling</h3>
<div class="paragraph"><p>For cases were the dependent test has a similar but not identical
itempath to the downstream test an itemmap can allow for itemmatch
mode</p></div>
<div class="listingblock">
<div class="title">example for removing part of itemmap for waiton test (eg: item <span class="monospaced">foo-x/bar</span> depends on waiton&#8217;s item <span class="monospaced">y/bar</span>)</div>
<div class="content monospaced">
<pre>[requirements]
mode itemwait

# itemmap &lt;item pattern for this test&gt;  &lt;item replacement pattern for waiton test&gt;
itemmap .*x/ y/</pre>
</div></div>
<div class="listingblock">
<div class="title">example for removing part of itemmap for waiton test (eg: item <span class="monospaced">foo/bar/baz</span> in this test depends on waiton&#8217;s item <span class="monospaced">baz</span>)</div>
<div class="content monospaced">
<pre># ## pattern replacement notes
#
# ## Example
# ## Remove everything up to the last /
[requirements]
mode itemwait

# itemmap &lt;item pattern for this test&gt; &lt;nothing here indicates removal&gt;
itemmap .*/</pre>
</div></div>
<div class="listingblock">
<div class="title">example replacing part of itemmap for (eg: item <span class="monospaced">foo/1234</span> will imply waiton&#8217;s item <span class="monospaced">bar/1234</span>)</div>
<div class="content monospaced">
<pre>#
# ## Example
# ## Replace foo/ with bar/
[requirements]
mode itemwait

# itemmap &lt;item pattern for this test&gt;  &lt;item replacement pattern for waiton test&gt;
itemmap foo/ bar/</pre>
</div></div>
<div class="listingblock">
<div class="title">example for backreference (eg: item <span class="monospaced">foo23/thud</span> will imply waiton&#8217;s item <span class="monospaced">num-23/bar/thud</span></div>
<div class="content monospaced">
<pre>#
# ## Example
# ## can use \{number} in replacement pattern to backreference a (capture) from matching pattern similar to sed or perl
[requirements]
mode itemwait

# itemmap &lt;item pattern for this test&gt;  &lt;item replacement pattern for waiton test&gt;
itemmap foo(\d+)/ num-\1/bar/</pre>
</div></div>
<div class="listingblock">
<div class="title">example multiple itemmaps</div>
<div class="content monospaced">
<pre># multi-line; matches are applied in the listed order
# The following would map:
#   a123b321 to b321fooa123 then to 321fooa123p
#
[requirements]


itemmap (a\d+)(b\d+) \2foo\1
  b(.*) \1p</pre>
</div></div>
<div class="sect3">
<h4 id="_complex_mapping">Complex mapping</h4>
<div class="paragraph"><p>Complex mappings can be handled with a separate [itemmap] section (instead if an itemmap line in the [requirements] section)</p></div>
<div class="paragraph"><p>Each line in an itemmap section starts with a waiton test name followed by an itemmap expression</p></div>
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
</div>
<div class="paragraph"><p>We accomplish this by configuring the testconfigs of our tests C D and E as follows:</p></div>
<div class="listingblock">
<div class="title">Testconfig for Test E has</div>
<div class="content monospaced">
<pre>[requirements]
waiton C
mode itemwait
itemmap (\d+)/res \1/bb</pre>
</div></div>
<div class="listingblock">
<div class="title">Testconfig for Test D has</div>
<div class="content monospaced">
<pre>[requirements]
waiton C
mode itemwait
itemmap (\d+)/res \1/aa</pre>
</div></div>
<div class="listingblock">
<div class="title">Testconfig for Test C has</div>
<div class="content monospaced">
<pre>[requirements]
waiton A B
mode itemwait

[itemmap]
A (\d+)/aa aa/\1
B (\d+)/bb bb/\1</pre>
</div></div>
<div class="listingblock">
<div class="title">Testconfigs for Test B and Test A have no waiton or itemmap configured</div>







<







<







<







2348
2349
2350
2351
2352
2353
2354

2355
2356
2357
2358
2359
2360
2361

2362
2363
2364
2365
2366
2367
2368

2369
2370
2371
2372
2373
2374
2375
</div>
<div class="paragraph"><p>We accomplish this by configuring the testconfigs of our tests C D and E as follows:</p></div>
<div class="listingblock">
<div class="title">Testconfig for Test E has</div>
<div class="content monospaced">
<pre>[requirements]
waiton C

itemmap (\d+)/res \1/bb</pre>
</div></div>
<div class="listingblock">
<div class="title">Testconfig for Test D has</div>
<div class="content monospaced">
<pre>[requirements]
waiton C

itemmap (\d+)/res \1/aa</pre>
</div></div>
<div class="listingblock">
<div class="title">Testconfig for Test C has</div>
<div class="content monospaced">
<pre>[requirements]
waiton A B


[itemmap]
A (\d+)/aa aa/\1
B (\d+)/bb bb/\1</pre>
</div></div>
<div class="listingblock">
<div class="title">Testconfigs for Test B and Test A have no waiton or itemmap configured</div>
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
Version 1.0<br>
Last updated 2018-08-01 09:52:04 PDT
</div>
</div>
</body>
</html>







|




2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
Version 1.0<br>
Last updated 2018-10-24 13:58:41 PDT
</div>
</div>
</body>
</html>