Megatest

Check-in [e9f1734405]
Login
Overview
Comment:wip
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.65-telemetry-sideeye
Files: files | file ages | folders
SHA1: e9f1734405142f05ca144a35b6bc78cfe9649dfd
User & Date: bjbarcla on 2019-02-15 18:03:14
Other Links: branch diff | manifest | tags
Context
2019-02-19
12:06
dead end Closed-Leaf check-in: 48c73df9dc user: bjbarcla tags: v1.65-telemetry-sideeye
2019-02-15
18:03
wip check-in: e9f1734405 user: bjbarcla tags: v1.65-telemetry-sideeye
2019-02-14
15:04
pulled in docs/manual changes check-in: 3797a8bab4 user: bjbarcla tags: v1.65-telemetry
Changes

Modified common.scm from [91f2f49c15] to [5886183872].

160
161
162
163
164
165
166

167
168
169
170
171
172
173
(define *transport-type*    'http)             ;; override with [server] transport http|rpc|nmsg
(define *runremote*         #f)                ;; if set up for server communication this will hold <host port>
;; (define *max-cache-size*    0)
(define *logged-in-clients* (make-hash-table))
(define *server-id*         #f)
(define *server-info*       #f)  ;; good candidate for easily convert to non-global
(define *time-to-exit*      #f)

(define *server-run*        #t)
(define *run-id*            #f)
(define *server-kind-run*   (make-hash-table))
(define *home-host*         #f)
;; (define *total-non-write-delay* 0)
(define *heartbeat-mutex*   (make-mutex))
(define *api-process-request-count* 0)







>







160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
(define *transport-type*    'http)             ;; override with [server] transport http|rpc|nmsg
(define *runremote*         #f)                ;; if set up for server communication this will hold <host port>
;; (define *max-cache-size*    0)
(define *logged-in-clients* (make-hash-table))
(define *server-id*         #f)
(define *server-info*       #f)  ;; good candidate for easily convert to non-global
(define *time-to-exit*      #f)
(define *time-to-exit-cleanup-thunk-list '())
(define *server-run*        #t)
(define *run-id*            #f)
(define *server-kind-run*   (make-hash-table))
(define *home-host*         #f)
;; (define *total-non-write-delay* 0)
(define *heartbeat-mutex*   (make-mutex))
(define *api-process-request-count* 0)
888
889
890
891
892
893
894








895
896
897
898
899
900
901
	    (debug:print-info 13 *default-log-port* "watchdog done."))
	  (debug:print-info 13 *default-log-port* "no need for watchdog on non-homehost"))))


(define (std-exit-procedure)
  ;;(common:telemetry-log-close)
  (on-exit (lambda () 0))








  ;;(debug:print-info 13 *default-log-port* "std-exit-procedure called; *time-to-exit*="*time-to-exit*)
  (let ((no-hurry  (if *time-to-exit* ;; hurry up
		       #f
		       (begin
			 (set! *time-to-exit* #t)
			 #t))))
    (debug:print-info 4 *default-log-port* "starting exit process, finalizing databases.")







>
>
>
>
>
>
>
>







889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
	    (debug:print-info 13 *default-log-port* "watchdog done."))
	  (debug:print-info 13 *default-log-port* "no need for watchdog on non-homehost"))))


(define (std-exit-procedure)
  ;;(common:telemetry-log-close)
  (on-exit (lambda () 0))

  (for-each (lambda (thunk)
              (handle-exceptions
	       exn
	       (debug:print 0 *default-log-port* "WARNING: exception while running on-exit thunk item")
               (thunk)))
            *time-to-exit-cleanup-thunk-list*)
  
  ;;(debug:print-info 13 *default-log-port* "std-exit-procedure called; *time-to-exit*="*time-to-exit*)
  (let ((no-hurry  (if *time-to-exit* ;; hurry up
		       #f
		       (begin
			 (set! *time-to-exit* #t)
			 #t))))
    (debug:print-info 4 *default-log-port* "starting exit process, finalizing databases.")

Added docs/manual/debug_techniques.txt version [9c5fdaf595].



















































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
58
59
60
61
62
63
64
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
// This file is part of Megatest.
// 
//     Megatest is free software: you can redistribute it and/or modify
//     it under the terms of the GNU General Public License as published by
//     the Free Software Foundation, either version 3 of the License, or
//     (at your option) any later version.
// 
//     Megatest is distributed in the hope that it will be useful,
//     but WITHOUT ANY WARRANTY; without even the implied warranty of
//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//     GNU General Public License for more details.
// 
//     You should have received a copy of the GNU General Public License
//     along with Megatest.  If not, see <http://www.gnu.org/licenses/>.
//
// Copyright 2006-2012, Matthew Welland.

Study Plan
----------

Megatest is an extensive program with a lot to learn. Following are some paths through the material to smooth the learning path.

Basic Concepts (suggest you pick these up on the way)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Components of automation; run, test, iteration 
* Selectors; target, runname, and testpatt

Running Testsuites or Automation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Using the dashboard gui (recommended)
** Using the "Runs" panel.
** Using the "Run Control" panel.
** Using a test control panel
** The Right Mouse Button menu
** Debug features
*** xterm
**** pstree
**** log files; mt_copy.log, mt_launch.log
**** variables; megatest.csh, megatest.sh
**** testconfig dump, *testconfig
*** State/status buttons
*** Run, Clean, KillReq
*** ReRunClean
* Using the command line
** Getting help; megatest -h, megatest -manual
** Starting runs; megatest -run
*** Selection controls; -target, -runname and -testpatt

Writing Tests and Flows
~~~~~~~~~~~~~~~~~~~~~~~

* environment variables (table 5)
* tests/_testname_/testconfig link:megatest_manual.html#_the_testconfig_file[testconfig details]
** ezsteps and logpro section
** iteration (one test applied to many inputs), items, itemstable link:megatest_manual.html#_iteration[test iteration]
** dependencies, waiton, itemmatch, itemwait link:megatest_manual.html#_requirements_section[test requirements]
** miscellaneous; mode toplevel, runtimelim, skip on file or on running, waiver propagation
* megatest areas
** megatest.config
** runconfigs.config
** config language features; include, shell, system, scheme, rp|realpath, getenv, get, rget, scriptinc link:megatest.html#_config_file_helpers[config file helpers]

Advanced Topics
~~~~~~~~~~~~~~~

* Removing and keeping runs selectively link:megatest_manual.html#_managing_old_runs[managing runs]
* Subruns link:megatest_manual.html#_nested_runs[nested runs]
* Config file features link:megatest_manual.html#_config_file_helpers[config file features]
* HTML output with -generate-html
* Triggers, post run, state/status
* MTLOWESTLOAD
* flexilauncher
* env delta and testconfig
* capturing test data, extracting values from logpro and using them for pass/fail
* mtutil, postgres connection, packets for cross-site/cross-user control (e.g. mcrun).

Maintenance and Troubleshooting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* cleanup-db, database structure of Megatest 1.6x
* archiving
* homehost management
* show-runconfig
* show-config
* show with -debug 0,9
* load management

Modified docs/manual/megatest_manual.html from [453b3aeb82] to [defaff4299].

896
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
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
<div class="paragraph"><p>Tests are launched using the launching system available for the
distributed compute platform in use. A template script is provided
which can launch jobs on local and remote Linux hosts. Currently
megatest uses the network filesystem to call home to your master
sqlite3 database. Megatest has been used with the Intel Netbatch and
lsf (also known as openlava) batch systems and it should be
straightforward to use it with other similar systems.</p></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_overview">Overview</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_stand_alone_megatest_area">Stand-alone Megatest Area</h3>
<div class="paragraph"><p>A single, stand-alone, Megatest based testsuite or "area" is
sufficient for most validation, automation and build problems.</p></div>
<div class="imageblock">
<div class="content">
<img src="megatest-stand-alone-area.png" alt="Static">
</div>
</div>
<div class="paragraph"><p>Megatest is designed as a distributed or decoupled system. This means
you can run the areas stand-alone with no additional
infrastructure. I.e. there are no databases, web servers or other
centralized resources needed. However as your needs grow you can
integrate multiple areas into a bigger system.</p></div>
<div class="sect3">
<h4 id="_component_descriptions">Component Descriptions</h4>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
Multi-area dashboard and xterm. A gui (the dashboard) is usually the
  best option for controlling and launching runs but all operations
  can also be done from the commandline. Note: The not yet released
  multi-area dashboard replaces the old dashboard for browsing and
  controlling runs but for managing a single area the old dashboard
  works very well.
</p>
</li>
<li>
<p>
Area/testsuite. This is your testsuite or automation definition and
  consists of the information in megatest.config, runconfigs.config
  and your testconfigs along with any custom scripting that can&#8217;t be
  done with the native Megatest features.
</p>
</li>
<li>
<p>
If your testsuite or build automation is too large to run on a
  single instance you can distribute your jobs into a compute server
  pool. The only current requirements are password-less ssh access and
  a network filesystem.
</p>
</li>
</ol></div>
</div>
</div>
<div class="sect2">
<h3 id="_full_system_architecture">Full System Architecture</h3>
<div class="imageblock">
<div class="content">
<img src="megatest-system-architecture.png" alt="Static">
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_installation">Installation</h2>
<div class="sectionbody">
<div class="sect2">







<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







896
897
898
899
900
901
902



903























































904
905
906
907
908
909
910
<div class="paragraph"><p>Tests are launched using the launching system available for the
distributed compute platform in use. A template script is provided
which can launch jobs on local and remote Linux hosts. Currently
megatest uses the network filesystem to call home to your master
sqlite3 database. Megatest has been used with the Intel Netbatch and
lsf (also known as openlava) batch systems and it should be
straightforward to use it with other similar systems.</p></div>



<div class="paragraph"><p>this page intentionally left blank</p></div>























































</div>
</div>
</div>
<div class="sect1">
<h2 id="_installation">Installation</h2>
<div class="sectionbody">
<div class="sect2">
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
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
owner  myname
description An example test
reviewed never</pre>
</div></div>
<div class="paragraph"><p>This test runs a single step called "stepname1" which runs a script
"stepname.sh". Note that although it is common to put the actions
needed for a test step into a script it is not necessary.</p></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_how_to_do_things">How To Do Things</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_process_runs">Process Runs</h3>
<div class="sect3">
<h4 id="_remove_runs">Remove Runs</h4>
<div class="paragraph"><p>From the dashboard click on the button (PASS/FAIL&#8230;) for one of the tests. From the test control panel that
comes up push the clean test button. The command field will be prefilled with a template command for removing
that test. You can edit the command, for example change the argument to -testpatt to "%" to remove all tests.</p></div>
<div class="listingblock">
<div class="title">Remove the test diskperf and all it&#8217;s items</div>
<div class="content monospaced">
<pre>megatest -remove-runs -target ubuntu/nfs/none -runname ww28.1a -testpatt diskperf/% -v</pre>
</div></div>
<div class="listingblock">
<div class="title">Remove all tests for all runs and all targets</div>
<div class="content monospaced">
<pre>megatest -remove-runs -target %/%/% -runname % -testpatt % -v</pre>
</div></div>
</div>
<div class="sect3">
<h4 id="_archive_runs">Archive Runs</h4>
<div class="paragraph"><p>Megatest supports using the bup backup tool (<a href="https://bup.github.io/">https://bup.github.io/</a>) to archive your tests for efficient storage
and retrieval. Archived data can be rapidly retrieved if needed. The metadata for the run (PASS/FAIL status, run
durations, time stamps etc.) are all preserved in the megatest database.</p></div>
<div class="paragraph"><p>For setup information see the Archiving topic in the reference section of this manual.</p></div>
<div class="sect4">
<h5 id="_to_archive">To Archive</h5>
<div class="paragraph"><p>Hint: use the test control panel to create a template command by pushing the "Archive Tests" button.</p></div>
<div class="listingblock">
<div class="title">Archive a full run</div>
<div class="content monospaced">
<pre>megatest -target ubuntu/nfs/none -runname ww28.1a -archive save-remove -testpatt %</pre>
</div></div>
</div>
<div class="sect4">
<h5 id="_to_restore">To Restore</h5>
<div class="listingblock">
<div class="title">Retrieve a single test</div>
<div class="content monospaced">
<pre>megatest -target ubuntu/nfs/none -runname ww28.1a -archive restore -testpatt diskperf/%</pre>
</div></div>
<div class="paragraph"><p>Hint: You can browse the archive using bup commands directly.</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>bup -d /path/to/bup/archive ftp</pre>
</div></div>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_submit_jobs_to_host_types_based_on_test_name">Submit jobs to Host Types based on Test Name</h3>
<div class="listingblock">
<div class="title">In megatest.config</div>
<div class="content monospaced">
<pre>[host-types]
general ssh #{getbgesthost general}
nbgeneral nbjob run JOBCOMMAND -log $MT_LINKTREE/$MT_TARGET/$MT_RUNNAME.$MT_TESTNAME-$MT_ITEM_PATH.lgo

[hosts]
general cubian xena

[launchers]
envsetup general
xor/%/n 4C16G
% nbgeneral

[jobtools]
launcher bsub
# if defined and not "no" flexi-launcher will bypass launcher unless there is no
# match.
flexi-launcher yes</pre>
</div></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_tricks">Tricks</h2>
<div class="sectionbody">
<div class="paragraph"><p>This section is a compendium of a various useful tricks for debugging,
configuring and generally getting the most out of Megatest.</p></div>
<div class="sect2">
<h3 id="_limiting_your_running_jobs">Limiting your running jobs</h3>
<div class="paragraph"><p>The following example will limit a test in the jobgroup "group1" to no more than 10 tests simultaneously.</p></div>
<div class="paragraph"><p>In your testconfig:</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>[test_meta]
jobgroup group1</pre>
</div></div>
<div class="paragraph"><p>In your megatest.config:</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>[jobgroups]
group1 10
custdes 4</pre>
</div></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_debugging_tricks">Debugging Tricks</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_examining_the_environment">Examining The Environment</h3>
<div class="sect3">
<h4 id="_test_control_panel_xterm">Test Control Panel - xterm</h4>
<div class="paragraph"><p>From the dashboard click on a test PASS/FAIL button. This brings up a test control panel. Aproximately near the center left of the
window there is a button "Start Xterm". Push this to get an xterm with the full context and environment loaded for that test. You can run
scripts or ezsteps by copying from the testconfig (hint, load up the testconfig in a separate gvim or emacs window). This is the easiest way
to debug your tests.</p></div>
</div>
<div class="sect3">
<h4 id="_during_config_file_processing">During Config File Processing</h4>
<div class="paragraph"><p>It is often helpful to know the content of variables in various
contexts as Megatest does the actions needed to run your tests. A handy technique is to force the startup of an xterm in the context being examined.</p></div>
<div class="paragraph"><p>For example, if an item list is not being generated as expected you
can inject the startup of an xterm as if it were an item:</p></div>
<div class="listingblock">
<div class="title">Original items table</div>
<div class="content monospaced">
<pre>[items]
CELLNAME [system getcellname.sh]</pre>
</div></div>
<div class="listingblock">
<div class="title">Items table modified for debug</div>
<div class="content monospaced">
<pre>[items]
DEBUG [system xterm]
CELLNAME [system getcellnames.sh]</pre>
</div></div>
<div class="paragraph"><p>When this test is run an xterm will pop up. In that xterm the
environment is exactly that in which the script "getcellnames.sh"
would run. You can now debug the script to find out why it isn&#8217;t
working as expected.</p></div>
</div>
<div class="sect3">
<h4 id="_organising_your_tests_and_tasks">Organising Your Tests and Tasks</h4>
<div class="paragraph"><p>The default location "tests" for storing tests can be extended by
adding to your tests-paths section.</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>[misc]
parent #{shell dirname $(readlink -f .)}

[tests-paths]
1 #{get misc parent}/simplerun/tests</pre>
</div></div>
<div class="paragraph"><p>The above example shows how you can use addition sections in your
config file to do complex processing. By putting results of relatively
slow operations into variables the processing of your configs can be
kept fast.</p></div>
</div>
<div class="sect3">
<h4 id="_alternative_method_for_running_your_job_script">Alternative Method for Running your Job Script</h4>
<div class="listingblock">
<div class="title">Directly running job in testconfig</div>
<div class="content monospaced">
<pre>[setup]
runscript main.csh</pre>
</div></div>
<div class="paragraph"><p>The runscript method is essentially a brute force way to run scripts where the
user is responsible for setting STATE and STATUS and managing the details of running a test.</p></div>
</div>
</div>
<div class="sect2">
<h3 id="_debugging_server_problems">Debugging Server Problems</h3>
<div class="paragraph"><p>Some handy Unix commands to track down issues with servers not
communicating with your test manager processes. Please put in tickets
at <a href="https://www.kiatoa.com/fossils/megatest">https://www.kiatoa.com/fossils/megatest</a> if you have problems with
servers getting stuck.</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>sudo lsof -i
sudo netstat -lptu
sudo netstat -tulpn</pre>
</div></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_reference">Reference</h2>
<div class="sectionbody">
<div class="sect2">







<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1339
1340
1341
1342
1343
1344
1345



1346

















































































































































































1347
1348
1349
1350
1351
1352
1353
owner  myname
description An example test
reviewed never</pre>
</div></div>
<div class="paragraph"><p>This test runs a single step called "stepname1" which runs a script
"stepname.sh". Note that although it is common to put the actions
needed for a test step into a script it is not necessary.</p></div>



<div class="paragraph"><p>include:howto.txt[]</p></div>

















































































































































































</div>
</div>
</div>
<div class="sect1">
<h2 id="_reference">Reference</h2>
<div class="sectionbody">
<div class="sect2">
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
<div class="content monospaced">
<pre>[configf:settings trim-trailing-spaces yes]</pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_job_submission_control">Job Submission Control</h3>
<div class="sect3">
<h4 id="_submit_jobs_to_host_types_based_on_test_name_2">Submit jobs to Host Types based on Test Name</h4>
<div class="listingblock">
<div class="title">In megatest.config</div>
<div class="content monospaced">
<pre>[host-types]
general   nbfake
remote    bsub








|







1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
<div class="content monospaced">
<pre>[configf:settings trim-trailing-spaces yes]</pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_job_submission_control">Job Submission Control</h3>
<div class="sect3">
<h4 id="_submit_jobs_to_host_types_based_on_test_name">Submit jobs to Host Types based on Test Name</h4>
<div class="listingblock">
<div class="title">In megatest.config</div>
<div class="content monospaced">
<pre>[host-types]
general   nbfake
remote    bsub

2656
2657
2658
2659
2660
2661
2662
























































































































































































































































































2663
2664
2665
2666
2667
2668
2669
<td class="tableblock halign-left valign-top" ><p class="tableblock monospaced"></p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock monospaced">( key1 key2 &#8230; )</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock monospaced"></p></td>
</tr>
</tbody>
</table>
</div>
























































































































































































































































































</div>
<div class="sect1">
<h2 id="_megatest_internals">Megatest Internals</h2>
<div class="sectionbody">
<div class="imageblock graphviz">
<div class="content">
<img src="server.png" alt="server.png">







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







2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
<td class="tableblock halign-left valign-top" ><p class="tableblock monospaced"></p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock monospaced">( key1 key2 &#8230; )</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock monospaced"></p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="_study_plan_2">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_2">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_2">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_2">Writing Tests and Flows</h3>
<div class="ulist"><ul>
<li>
<p>
environment variables (table 5)
</p>
</li>
<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>
ezsteps and logpro section
</p>
</li>
<li>
<p>
iteration (one test applied to many inputs), items, itemstable <a href="megatest_manual.html#_iteration">test iteration</a>
</p>
</li>
<li>
<p>
dependencies, waiton, itemmatch, itemwait <a href="megatest_manual.html#_requirements_section">test requirements</a>
</p>
</li>
<li>
<p>
miscellaneous; mode toplevel, runtimelim, skip on file or on running, waiver propagation
</p>
</li>
</ul></div>
</li>
<li>
<p>
megatest areas
</p>
<div class="ulist"><ul>
<li>
<p>
megatest.config
</p>
</li>
<li>
<p>
runconfigs.config
</p>
</li>
<li>
<p>
config language features; include, shell, system, scheme, rp|realpath, getenv, get, rget, scriptinc <a href="megatest.html#_config_file_helpers">config file helpers</a>
</p>
</li>
</ul></div>
</li>
</ul></div>
</div>
<div class="sect2">
<h3 id="_advanced_topics_2">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>
<li>
<p>
HTML output with -generate-html
</p>
</li>
<li>
<p>
Triggers, post run, state/status
</p>
</li>
<li>
<p>
MTLOWESTLOAD
</p>
</li>
<li>
<p>
flexilauncher
</p>
</li>
<li>
<p>
env delta and testconfig
</p>
</li>
<li>
<p>
capturing test data, extracting values from logpro and using them for pass/fail
</p>
</li>
<li>
<p>
mtutil, postgres connection, packets for cross-site/cross-user control (e.g. mcrun).
</p>
</li>
</ul></div>
</div>
<div class="sect2">
<h3 id="_maintenance_and_troubleshooting_2">Maintenance and Troubleshooting</h3>
<div class="ulist"><ul>
<li>
<p>
cleanup-db, database structure of Megatest 1.6x
</p>
</li>
<li>
<p>
archiving
</p>
</li>
<li>
<p>
homehost management
</p>
</li>
<li>
<p>
show-runconfig
</p>
</li>
<li>
<p>
show-config
</p>
</li>
<li>
<p>
show with -debug 0,9
</p>
</li>
<li>
<p>
load management
</p>
</li>
</ul></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_megatest_internals">Megatest Internals</h2>
<div class="sectionbody">
<div class="imageblock graphviz">
<div class="content">
<img src="server.png" alt="server.png">
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
Version 1.0<br>
Last updated 2018-11-29 09:32:52 PST
</div>
</div>
</body>
</html>







|




3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
Version 1.0<br>
Last updated 2019-02-14 14:07:31 PST
</div>
</div>
</body>
</html>

Modified docs/manual/megatest_manual.txt from [2589d78a96] to [4a326e3c90].

108
109
110
111
112
113
114
115
116
117


118
119
120
121
122
123
124
include::getting_started.txt[]

include::study_plan.txt[]

// :leveloffset: 0

include::writing_tests.txt[]
include::howto.txt[]

include::reference.txt[]




Megatest Internals
------------------

["graphviz", "server.png"]
----------------------------------------------------------------------







|


>
>







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
include::getting_started.txt[]

include::study_plan.txt[]

// :leveloffset: 0

include::writing_tests.txt[]
include:howto.txt[]

include::reference.txt[]

include::debug_techniques.txt[]


Megatest Internals
------------------

["graphviz", "server.png"]
----------------------------------------------------------------------

Added docs/manual/overview.txt version [b16c60428e].



>
1
this page intentionally left blank

Modified tests.scm from [82f5f9277a] to [ebe84ac0bd].

1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559

1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570



1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581


1582
1583
1584
1585
1586
1587
1588
	      dat
	      ;; no cached data available
	      (let* ((treg         (or test-registry
				       (tests:get-all)))
		     (test-path    (or (hash-table-ref/default treg test-name #f)
				       (conc *toppath* "/tests/" test-name)))
		     (test-configf (conc test-path "/testconfig"))
		     (testexists (let loop ((tries-left 7))
                                   (cond
                                    ( (and (common:file-exists? test-configf)(file-read-access? test-configf))
                                      #t)
                                    ( (common:file-exists? test-configf)
                                      (debug:print 0 *default-log-port* "WARNING: Cannot read testconfig file: "test-configf)
                                      #f)
                                    ( (and wait-a-minute (> tries-left 0))

                                      (thread-sleep! 10)
                                      (loop (sub1 tries-left)))
                                    (else
                                     (debug:print 0 *default-log-port* "WARNING: testconfig file does not exist: "test-configf)
                                     #f))))
		     (tcfg         (if testexists
				       (read-config test-configf #f system-allowed
						    environ-patt: (if system-allowed
								      "pre-launch-env-vars"
								      #f))
				       #f)))



		(if (and tcfg cache-file) (hash-table-set! tcfg "have fulldata" #t)) ;; mark this as fully read data
		(if tcfg (hash-table-set! *testconfigs* test-full-name tcfg))
		(if (and testexists
			 cache-file
			 (file-write-access? cache-path)
			 allow-write-cache)
		    (let ((tpath (conc cache-path "/.testconfig")))
		      (debug:print-info 1 *default-log-port* "Caching testconfig for " test-name " in " tpath)
                      (if (and tcfg (not (common:in-running-test?)))
                          (configf:write-alist tcfg tpath))))
		tcfg))))))


  
;; sort tests by priority and waiton
;; Move test specific stuff to a test unit FIXME one of these days
(define (tests:sort-by-priority-and-waiton test-records)
  (if (eq? (hash-table-size test-records) 0)
      '()
      (let* ((mungepriority (lambda (priority)







|







>



|







>
>
>
|
|
|
|
|
|
|
|
|
|
|
>
>







1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
	      dat
	      ;; no cached data available
	      (let* ((treg         (or test-registry
				       (tests:get-all)))
		     (test-path    (or (hash-table-ref/default treg test-name #f)
				       (conc *toppath* "/tests/" test-name)))
		     (test-configf (conc test-path "/testconfig"))
		     (testexists (let loop ((tries-left 14))
                                   (cond
                                    ( (and (common:file-exists? test-configf)(file-read-access? test-configf))
                                      #t)
                                    ( (common:file-exists? test-configf)
                                      (debug:print 0 *default-log-port* "WARNING: Cannot read testconfig file: "test-configf)
                                      #f)
                                    ( (and wait-a-minute (> tries-left 0))
                                      (debug:print 0 *default-log-port* "WARNING: Cannot read testconfig.  Sleeping 10 and will try again.  Tries left: " tries-left)
                                      (thread-sleep! 10)
                                      (loop (sub1 tries-left)))
                                    (else
                                     (debug:print 0 *default-log-port* "WARNING: testconfig file does not exist: "test-configf " [wait-a-minute=" wait-a-minute "]")
                                     #f))))
		     (tcfg         (if testexists
				       (read-config test-configf #f system-allowed
						    environ-patt: (if system-allowed
								      "pre-launch-env-vars"
								      #f))
				       #f)))

                (cond
                 ((testexists
                   (if (and tcfg cache-file) (hash-table-set! tcfg "have fulldata" #t)) ;; mark this as fully read data
		   (if tcfg (hash-table-set! *testconfigs* test-full-name tcfg)) ;; side effect
		   (if (and testexists
			    cache-file
			    (file-write-access? cache-path)
			    allow-write-cache)
		       (let ((tpath (conc cache-path "/.testconfig")))
		         (debug:print-info 1 *default-log-port* "Caching testconfig for " test-name " in " tpath)
                         (if (and tcfg (not (common:in-running-test?)))
                             (configf:write-alist tcfg tpath))))
		   tcfg))
                  (else
                   #f))))))))
  
;; sort tests by priority and waiton
;; Move test specific stuff to a test unit FIXME one of these days
(define (tests:sort-by-priority-and-waiton test-records)
  (if (eq? (hash-table-size test-records) 0)
      '()
      (let* ((mungepriority (lambda (priority)