︙ | | |
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
+
+
-
+
+
+
+
+
+
|
# script that takes path as parameter and returns number of bytes available:
free-space-script check-space.sh
-------------------
Trim trailing spaces
~~~~~~~~~~~~~~~~~~~~
NOTE: As of Megatest version v1.6548 trim-trailing-spaces defaults to yes.
------------------
[configf:settings trim-trailing-spaces yes]
[configf:settings trim-trailing-spaces no]
# |<== next line padded with spaces to here
DEFAULT_INDENT
[configf:settings trim-trailing-spaces no]
------------------
The variable DEFAULT_INDENT would be a string of 3 spaces
Job Submission Control
~~~~~~~~~~~~~~~~~~~~~~
Submit jobs to Host Types based on Test Name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
︙ | | |
333
334
335
336
337
338
339
340
341
342
343
344
345
346
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
-------------------
# A normal waiton waits for the prior tests to be COMPLETED
# and PASS, CHECK or WAIVED
waiton test1 test2
-------------------
NOTE: Dynamic waiton lists must be capable of being calculated at the
beginning of a run. This is because Megatest walks the tree of waitons
to create the list of tests to execute.
.This works
-------------------
waiton [system somescript.sh]
-------------------
.This does NOT work (the full context for the test is not available so #{shell ...} is NOT enabled to evaluate.
-------------------
waiton #{shell somescript.sh}
-------------------
.This does NOT work
-------------------
waiton [system somescript_that_depends_on_a_prior_test.sh]
-------------------
Mode
~~~~
The default (i.e. if mode is not specified) is normal. All pre-dependent tests
must be COMPLETED and PASS, CHECK or WAIVED before the test will start
-------------------
|
︙ | | |
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
|
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
|
-
-
|
--------------
Complex mapping example
~~~~~~~~~~~~~~~~~~~~~~~
// image::itemmap.png[]
image::complex-itemmap.png[]
We accomplish this by configuring the testconfigs of our tests C D and E as follows:
.Testconfig for Test E has
----------------------
[requirements]
waiton C
|
︙ | | |
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
|
536
537
538
539
540
541
542
543
544
545
546
547
548
549
|
-
-
-
-
|
. Test A has no waitons. All waitons of all tests in full list have been processed. Full list is finalized.
itemstable
~~~~~~~~~~
An alternative to defining items is the itemstable section. This lets you define the itempath in a table format rather than specifying components and relying on getting all permutations of those components.
Dynamic Flow Dependency Tree
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.Autogeneration waiton list for dynamic flow dependency trees
-------------------
[requirements]
|
︙ | | |
650
651
652
653
654
655
656
657
658
659
660
661
662
663
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
To transfer the environment to the next step you can do the following:
.Propagate environment to next step
----------------------------
$MT_MEGATEST -env2file .ezsteps/${stepname}
----------------------------
Scripts
~~~~~~~
.Specifying scripts inline (best used for only simple scripts)
----------------------------
[scripts]
loaddb #!/bin/bash
sqlite3 $1 <<EOF
.mode tabs
.import $2 data
.q
EOF
----------------------------
The above snippet results in the creation of an executable script
called "loaddb" in the test directory. NOTE: every line in the script
must be prefixed with the exact same number of spaces. Lines beginning
with a # will not work as expected. Currently you cannot indent
intermediate lines.
.Full example with ezsteps, logpro rules, scripts etc.
-----------------
# You can include a common file
#
[include #{getenv MT_RUN_AREA_HOME}/global-testconfig.inc]
# Use "var" for a scratch pad
|
︙ | | |