1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
Reference
=========
Megatest Config File Settings
-----------------------------
Trim trailing spaces
~~~~~~~~~~~~~~~~~~~~
------------------
[configf:settings trim-trailing-spaces yes]
------------------
Submit jobs to Host Types based on Test Name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.In megatest.config
------------------------
[host-types]
general nbfake
remote bsub
[launchers]
runfirst/sum% remote
% general
[jobtools]
launcher bsub
# if defined and not "no" flexi-launcher will bypass launcher unless there is no
# match.
flexi-launcher yes
------------------------
host-types
^^^^^^^^^^
List of host types and the commandline to run a job on that host type.
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
Reference
=========
Megatest Config File Settings
-----------------------------
Disk Space Checks
~~~~~~~~~~~~~~~~~
Some parameters you can put in the [setup] section of megatest.config:
-------------------
# minimum space required in a run disk
minspace 10000000
# minimum space required in dbdir:
dbdir-space-required 100000
# script that takes path as parameter and returns number of bytes available:
free-space-script check-space.sh
-------------------
Trim trailing spaces
~~~~~~~~~~~~~~~~~~~~
------------------
[configf:settings trim-trailing-spaces yes]
------------------
Job Submission Control
~~~~~~~~~~~~~~~~~~~~~~
Submit jobs to Host Types based on Test Name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.In megatest.config
------------------------
[host-types]
general nbfake
remote bsub
[launchers]
runfirst/sum% remote
% general
[jobtools]
launcher bsub
# if defined and not "no" flexi-launcher will bypass launcher unless
# there is no host-type match.
flexi-launcher yes
------------------------
host-types
^^^^^^^^^^
List of host types and the commandline to run a job on that host type.
|
︙ | | | ︙ | |
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
^^^^^^^^^
.test/itempath => host-type
------------
runfirst/sum% remote
------------
Miscellaneous Setup Items
^^^^^^^^^^^^^^^^^^^^^^^^^
Attempt to rerun tests in "STUCK/DEAD", "n/a", "ZERO_ITEMS" states.
.In megatest.config
------------------
[setup]
reruns 5
------------------
Run time limit
^^^^^^^^^^^^^^
-----------------
[setup]
runtimelim 1h 2m 3s # this will automatically kill the test if it runs for more than 1h 2m and 3s
-----------------
The testconfig File
-------------------
Setup section
~~~~~~~~~~~~~
Header
|
<
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
^^^^^^^^^
.test/itempath => host-type
------------
runfirst/sum% remote
------------
Miscellaneous Setup Items
~~~~~~~~~~~~~~~~~~~~~~~~~
Attempt to rerun tests in "STUCK/DEAD", "n/a", "ZERO_ITEMS" states.
.In megatest.config
------------------
[setup]
reruns 5
------------------
Run time limit
^^^^^^^^^^^^^^
-----------------
[setup]
# this will automatically kill the test if it runs for more than 1h 2m and 3s
runtimelim 1h 2m 3s
-----------------
Tests browser view
^^^^^^^^^^^^^^^^^^
The tests browser (see the Run Control tab on the dashboard) has two views for displaying the tests.
. Dot (graphviz) based tree
. No dot, plain listing
The default is the graphviz based tree but if your tests don't view
well in that mode then use "nodot" to turn it off.
-----------------
[setup]
nodot
-----------------
Database settings
~~~~~~~~~~~~~~~~~
.Database config settings in [setup] section of megatest.config
[width="70%",cols="^,2m,2m,2m",frame="topbot",options="header"]
|======================
|Var | Purpose | Valid values | Comments
|delay-on-busy | Prevent concurrent access issues | yes\|no or not defined | Default=no, may help on some network file systems, may slow things down also.
|daemonize | Daemonize the server on start | yes\|no or not defined | Default=no
|faststart | All direct file access to sqlite db files | yes\|no or not defined | Default=yes, suggest no for central automated systems and yes for interactive use
|homehost | Start servers on this host | <hostname> | Defaults to local host
|hostname | Hostname to bind to | <hostname>\|- | On multi-homed hosts allows binding to specific hostname
|lowport | Start searching for a port at this portnum| 32768 |
|required | Server required | yes\|no or not defined | Default=no, force start of server always
|server-query-threshold | Start server when queries take longer than this | number in milliseconds | Default=300
|timeout | http api timeout | number in hours | Default is 1 minute, do not change
|======================
The testconfig File
-------------------
Setup section
~~~~~~~~~~~~~
Header
|
︙ | | | ︙ | |
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
-------------------
runscript main.csh
-------------------
Requirements section
~~~~~~~~~~~~~~~~~~~~
Header
^^^^^^
-------------------
[requirements]
-------------------
Wait on Other Tests
^^^^^^^^^^^^^^^^^^^
|
|
<
<
|
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
-------------------
runscript main.csh
-------------------
Requirements section
~~~~~~~~~~~~~~~~~~~~
.Header
-------------------
[requirements]
-------------------
Wait on Other Tests
^^^^^^^^^^^^^^^^^^^
|
︙ | | | ︙ | |
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
was historically called "itemwait" mode. The terms "itemwait" and
"itemmatch" are synonyms.
-------------------
[requirements]
mode itemmatch
-------------------
Itemmap Handling
~~~~~~~~~~~~~~~~
For cases were the dependent test has a similar but not identical
itempath to the downstream test an itemmap can allow for itemmatch
mode
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
was historically called "itemwait" mode. The terms "itemwait" and
"itemmatch" are synonyms.
-------------------
[requirements]
mode itemmatch
-------------------
Overriding Enviroment Variables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Override variables before starting the test. Can include files (perhaps generated by megatest -envdelta or similar).
--------------------
[pre-launch-env-vars]
VAR1 value1
# Get some generated settings
[include ../generated-vars.config]
# Use this trick to unset variables
#{scheme (unsetenv "FOOBAR")}
--------------------
Itemmap Handling
~~~~~~~~~~~~~~~~
For cases were the dependent test has a similar but not identical
itempath to the downstream test an itemmap can allow for itemmatch
mode
|
︙ | | | ︙ | |
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
.Testconfig for Test C
----------------------
[requirements]
waiton A B
[itemmap]
A (\d+)/aa aa/\1
B (\d+)/bb --------------------
.Testconfig for Test D
----------------------
[requirements]
waiton C
itemmap (\d+)/res \1/aa
----------------------
|
>
|
|
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
|
.Testconfig for Test C
----------------------
[requirements]
waiton A B
[itemmap]
A (\d+)/aa aa/\1
B (\d+)/bb
----------------------
.Testconfig for Test D
----------------------
[requirements]
waiton C
itemmap (\d+)/res \1/aa
----------------------
|
︙ | | | ︙ | |
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
|
# Archives will be organised under these paths like this:
# <testsuite>/<creationdate>
# Within the archive the data is structured like this:
# <target>/<runname>/<test>/
archive0 /mfs/myarchive-data/adisk1
--------------
Programming API
---------------
These routines can be called from the megatest repl.
.API Server Management Calls
[width="70%",cols="^,2m,2m,2m",frame="topbot",options="header,footer"]
|======================
|API Call | Purpose comments | Returns | Comments
|(rmt:start-server run-id) | | #( success/fail n/a ) |
|(rmt:kill-server run-id) | | #( success/fail n/a ) | Works only if the server is still reachable
|(rmt:login run-id) | Verify the the version, testsuite area etc. are correct. | #( #t "successful login" ) |
|======================
.API Keys Related Calls
[width="70%",cols="^,2m,2m,2m",frame="topbot",options="header,footer"]
|======================
|API Call | Purpose comments | Returns | Comments
|(rmt:get-keys run-id) | | ( key1 key2 ... ) |
| (rmt:get-key-val-pairs run-id) | | #t=success/#f=fail | Works only if the server is still reachable
|======================
:numbered!:
|
>
>
|
>
>
>
>
>
>
>
|
>
>
>
>
>
|
>
>
>
|
>
>
|
>
>
>
>
>
>
>
|
>
|
>
>
>
|
>
>
>
|
|
>
>
|
>
|
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
|
# Archives will be organised under these paths like this:
# <testsuite>/<creationdate>
# Within the archive the data is structured like this:
# <target>/<runname>/<test>/
archive0 /mfs/myarchive-data/adisk1
--------------
Handling Environment Variables
------------------------------
It is often necessary to capture and or manipulate environment
variables. Megatest has some facilities built in to help.
Capture variables
~~~~~~~~~~~~~~~~~
.Commands
------------------------------
# capture the current enviroment into a db called envdat.db under
# the context "before"
megatest -envcap before
# capture the current environment into a db called startup.db with
# context "after"
megatest -envcap after startup.db
# write the diff from before to after
megatest -envdelta before-after -dumpmode bash
------------------------------
Dump modes include bash, csh and config. You can include config data
into megatest.config or runconfigs.config.
.Example of generating and using config data
------------------------------
megatest -envcap original
# do some stuff here
megatest -envcap munged
megatest -envdelta original-munged -dumpmode ini -o modified.config
------------------------------
Then in runconfigs.config
.Example of using modified.config in a testconfig
------------------------------
cat testconfig
[pre-launch-env-vars]
[include modified.config]
------------------------------
Programming API
---------------
These routines can be called from the megatest repl.
.API Keys Related Calls
[width="70%",cols="^,2m,2m,2m",frame="topbot",options="header,footer"]
|======================
|API Call | Purpose comments | Returns | Comments
|(rmt:get-keys run-id) | | ( key1 key2 ... ) |
| (rmt:get-key-val-pairs run-id) | | #t=success/#f=fail | Works only if the server is still reachable
|======================
:numbered!:
|