Megatest

Diff
Login

Differences From Artifact [1570f70f19]:

To Artifact [4094e84806]:


363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
​
# run the cpu1 simulation.
#   The step name is "run_simulation"
#   The commandline being run for this step is "runsim cpu1"
#   The logpro file to validate the output from the run is "runsim.logpro"
​
$MT_MEGATEST -runstep run_simulation -logpro runsim.logpro "runsim cpu1"
if ($? == 0)
  set status = PASS
else
  set status = FAIL
end
$MT_MEGATEST -test-status :state COMPLETED :status $status
</pre>
</div>

</div>
<div class="Unindented">
You can now run megatest and the created test directory will contain the new files “run_simulation.html” and “run_simulation.log”. If you are using the dashboard you can click on the run and then push the “View log” button to view the log file in firefox.
</div>







<
<
<
<
<
|







363
364
365
366
367
368
369





370
371
372
373
374
375
376
377
​
# run the cpu1 simulation.
#   The step name is "run_simulation"
#   The commandline being run for this step is "runsim cpu1"
#   The logpro file to validate the output from the run is "runsim.logpro"
​
$MT_MEGATEST -runstep run_simulation -logpro runsim.logpro "runsim cpu1"





$MT_MEGATEST -test-status :state COMPLETED :status $?
</pre>
</div>

</div>
<div class="Unindented">
You can now run megatest and the created test directory will contain the new files “run_simulation.html” and “run_simulation.log”. If you are using the dashboard you can click on the run and then push the “View log” button to view the log file in firefox.
</div>
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# run the cpu1 simulation.
#   The step name is "run_simulation"
#   The commandline being run for this step is "runsim cpu1"
#   The logpro file to validate the output from the run is "runsim.logpro"
​
$MT_MEGATEST -runstep run_simulation_cpu1 -logpro runsim.logpro "runsim cpu1" &amp;&amp; \
$MT_MEGATEST -runstep run_simulation_cpu2 -logpro runsim.logpro "runsim cpu2"
if ($? == 0)
  set status = PASS
else
  set status = FAIL
end
$MT_MEGATEST -test-status :state COMPLETED :status $status
</pre>
</div>

</div>
<h2 class="Section">
<a class="toc" name="toc-Section-3.3">3.3</a> Simple Test with Multiple Steps, Some in Parallel 
</h2>







<
<
<
<
<
|







388
389
390
391
392
393
394





395
396
397
398
399
400
401
402
# run the cpu1 simulation.
#   The step name is "run_simulation"
#   The commandline being run for this step is "runsim cpu1"
#   The logpro file to validate the output from the run is "runsim.logpro"
​
$MT_MEGATEST -runstep run_simulation_cpu1 -logpro runsim.logpro "runsim cpu1" &amp;&amp; \
$MT_MEGATEST -runstep run_simulation_cpu2 -logpro runsim.logpro "runsim cpu2"





$MT_MEGATEST -test-status :state COMPLETED :status $?
</pre>
</div>

</div>
<h2 class="Section">
<a class="toc" name="toc-Section-3.3">3.3</a> Simple Test with Multiple Steps, Some in Parallel 
</h2>
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
<div class="listing">
<pre class="listing">#!/bin/tcsh -x
​
# run the cpu1 and cpu2 simulations in parallel. 
# The -j parameter tells make how many jobs it may run in parallel
​
make -j 2 
if ($? == 0)
  set status = PASS
else
  set status = FAIL
end
$MT_MEGATEST -test-status :state COMPLETED :status $status
</pre>
</div>

</div>
<h2 class="Section">
<a class="toc" name="toc-Section-3.4">3.4</a> Simple Test with Iteration
</h2>







<
<
<
<
<
|







426
427
428
429
430
431
432





433
434
435
436
437
438
439
440
<div class="listing">
<pre class="listing">#!/bin/tcsh -x
​
# run the cpu1 and cpu2 simulations in parallel. 
# The -j parameter tells make how many jobs it may run in parallel
​
make -j 2 





$MT_MEGATEST -test-status :state COMPLETED :status $?
</pre>
</div>

</div>
<h2 class="Section">
<a class="toc" name="toc-Section-3.4">3.4</a> Simple Test with Iteration
</h2>
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
<a class="toc" name="toc-Paragraph-12"></a><div class="listing">
<pre class="listing">#!/bin/tcsh -x
​
# run the cpu simulation but now use the environment variable $CPU
# to select what cpu to run the simulation against
​
$MT_MEGATEST -runstep run_simulation -logpro runsim.logpro "runsim $CPU"
if ($? == 0)
  set status = PASS
else
  set status = FAIL
end
$MT_MEGATEST -test-status :state COMPLETED :status $status
</pre>
</div>

</div>
<h2 class="Section">
<a class="toc" name="toc-Section-3.5">3.5</a> Tests with Inter-test dependencies
</h2>







|
|
|
<
<
|







462
463
464
465
466
467
468
469
470
471


472
473
474
475
476
477
478
479
<a class="toc" name="toc-Paragraph-12"></a><div class="listing">
<pre class="listing">#!/bin/tcsh -x
​
# run the cpu simulation but now use the environment variable $CPU
# to select what cpu to run the simulation against
​
$MT_MEGATEST -runstep run_simulation -logpro runsim.logpro "runsim $CPU"
# As of version 1.07 Megatest automatically converts a status of "0"
# to "PASS", any other number to "FAIL" and directly uses the value of
# a string passed in.


$MT_MEGATEST -test-status :state COMPLETED :status $?
</pre>
</div>

</div>
<h2 class="Section">
<a class="toc" name="toc-Section-3.5">3.5</a> Tests with Inter-test dependencies
</h2>
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

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







|
<
<
|
>

<
<

<
<
<
<
<
>

<
<

<
<
<
<
<
>

<
<

<
<

<
<
<
<
<
>

<
<
|
<
<
<
<
<
>

>
>

|
<







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

</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="Indented">


<div class="listing">
<pre class="listing"># runconfigs.config
[default]


ENCRYTION true






[megacorp/india]


TESTPATH /nfs/testing/megacorp_runs






[femtocorp/cook_islands]


ENCRYTION false


TESTPATH /afs/kiatoa/testing/cook_islands






[femtocorp/new_zealand]


TESTPATH /afs/kiatoa/testing/new_zealand






[megacorp/new_zealand]
TESTPATH /nfs/testing/megacorp_runs
</pre>
</div>


</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>
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358

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







|


|











|


|


|








|


|


|








|


|











|














|

















|














|


|











|














|







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
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315

</tr>
<tr>
<td align="left" valign="top">
:runname
</td>
<td align="left" valign="top">
[a-zA-Z0-9_-]+
</td>
<td align="left" valign="top">
directory in which this run will be stored in the test run area 
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
:state
</td>
<td align="left" valign="top">
any value
</td>
<td align="left" valign="top">
Set the step or test state, this is stored in the state field in the steps or tests table respectively
</td>
<td align="left" valign="top">
For tests Megatest recognises “INCOMPLETE”, “COMPLETE”
</td>

</tr>
<tr>
<td align="left" valign="top">
:status
</td>
<td align="left" valign="top">
any value
</td>
<td align="left" valign="top">
Set the step or test status, this is stored in the status field in the steps or tests table respectively
</td>
<td align="left" valign="top">
For tests Megatest recognises “PASS”, “FAIL”, and “CHECK”
</td>

</tr>
<tr>
<td align="left" valign="top">
-list-runs
</td>
<td align="left" valign="top">
any value, % is wildcard
</td>
<td align="left" valign="top">
Respects -itempatt and -testpatt for filters
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
<td align="left" valign="top">
-testpatt
</td>
<td align="left" valign="top">
any value, % is wildcard
</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">
any value, % is wildcard
</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">
Print the keys being used for this database
</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">
Test will not re-run if in the “PASS”, “CHECK” or “KILLED”, using -force will force the run to be launched.
</td>
<td align="left" valign="top">
WARNING: The -force switch will bypass any “waiton” dependencies.
</td>

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

</td>
<td align="left" valign="top">
Launch an xterm instead of run the test. The xterm will have the environment that the test would see.
</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">
Remove a run, test or subtest from the database and the disk. Cannot be undone. Requires -testpatt, -itempatt, :runname and all keys be specified.
</td>
<td align="left" valign="top">

</td>

</tr>
<tr>
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
<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-17T17:16:38.918258</span>
</div>
</div>
</body>
</html>







|














|













|




1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
<td align="left" valign="top">
-runstep
</td>
<td align="left" valign="top">

</td>
<td align="left" valign="top">
Used inside a test to run a step, record the start and end of the step and optionally analyze the output using logpro.
</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">
If using logpro to asses the PASS/FAIL status of the step you specify the logpro file with this parameter.
</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-17T20:49:50.586755</span>
</div>
</div>
</body>
</html>