Megatest

Changes On Branch 62747d85ce6024a0
Login

Changes In Branch v1.6569-multi-db Through [62747d85ce] Excluding Merge-Ins

This is equivalent to a diff from d69b03fe95 to 62747d85ce

2021-02-01
13:29
fixed match let in db.scm check-in: d486cc49ee user: pjhatwal tags: v1.6582, v1.65-real
2021-01-31
22:17
Improved server.dot. Deps working. Several modules pulled into megatest.scm check-in: ad7b549523 user: matt tags: v1.6569-multi-db
18:39
Enable modules again check-in: 62747d85ce user: matt tags: v1.6569-multi-db
04:32
Added missing step in server shutdown (in server.dot) check-in: 39432a5449 user: matt tags: v1.6569-multi-db
2021-01-30
22:37
Added graph of server for multi-db check-in: 4d273a0078 user: matt tags: v1.6569-multi-db
2021-01-29
11:48
changed megatest version to v1.6582 check-in: d69b03fe95 user: mmgraham tags: v1.65-real
11:47
Made CHECK an error status for PREQ_FAIL Leaf check-in: a26bbf5c36 user: mmgraham tags: v1.6569-refactor-server-key-chk

Modified Makefile from [0dc94ad098] to [00e412a273].

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
           process.scm runs.scm tasks.scm tests.scm genexample.scm	\
           http-transport.scm filedb.scm tdb.scm client.scm mt.scm	\
           ezsteps.scm lock-queue.scm sdb.scm rmt.scm api.scm		\
           subrun.scm portlogger.scm archive.scm env.scm		\
           diff-report.scm cgisetup/models/pgdb.scm

# module source files
MSRCFILES = 
# ftail.scm rmtmod.scm commonmod.scm removed
# MSRCFILES = ducttape-lib.scm pkts.scm stml2.scm cookie.scm mutils.scm	\
#             mtargs.scm commonmod.scm dbmod.scm adjutant.scm ulex.scm	\
#             rmtmod.scm apimod.scm

GUISRCF = dashboard-context-menu.scm dashboard-tests.scm		\
          dashboard-guimonitor.scm gutils.scm dcommon.scm tree.scm	\







|







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
           process.scm runs.scm tasks.scm tests.scm genexample.scm	\
           http-transport.scm filedb.scm tdb.scm client.scm mt.scm	\
           ezsteps.scm lock-queue.scm sdb.scm rmt.scm api.scm		\
           subrun.scm portlogger.scm archive.scm env.scm		\
           diff-report.scm cgisetup/models/pgdb.scm

# module source files
MSRCFILES = dbmod.scm
# ftail.scm rmtmod.scm commonmod.scm removed
# MSRCFILES = ducttape-lib.scm pkts.scm stml2.scm cookie.scm mutils.scm	\
#             mtargs.scm commonmod.scm dbmod.scm adjutant.scm ulex.scm	\
#             rmtmod.scm apimod.scm

GUISRCF = dashboard-context-menu.scm dashboard-tests.scm		\
          dashboard-guimonitor.scm gutils.scm dcommon.scm tree.scm	\

Modified docs/manual/Makefile from [ec9633c3d9] to [43d7d87a44].

32
33
34
35
36
37
38
39
40
41



42
43
44
45
46
47
48

all : server.ps megatest_manual.html client.ps complex-itemmap.png megatest_manual.pdf

megatest_manual.html : megatest_manual.txt  *.txt installation.txt *png
	asciidoc  -b html5 -a icons -a iconsdir=$(DISPATH)/images/icons -a toc2 megatest_manual.txt
#	dos2unix megatest_manual.html

megatest_manual.pdf : megatest_manual.txt *.txt *png
	a2x -a toc -f pdf megatest_manual.txt




server.ps : server.dot
	dot -Tps server.dot > server.ps

client.ps : client.dot
	dot -Tps client.dot > client.ps

complex-itemmap.png : complex-itemmap.dot







|


>
>
>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

all : server.ps megatest_manual.html client.ps complex-itemmap.png megatest_manual.pdf

megatest_manual.html : megatest_manual.txt  *.txt installation.txt *png
	asciidoc  -b html5 -a icons -a iconsdir=$(DISPATH)/images/icons -a toc2 megatest_manual.txt
#	dos2unix megatest_manual.html

megatest_manual.pdf : megatest_manual.txt *.txt *png *.ps
	a2x -a toc -f pdf megatest_manual.txt

server.pdf : server.dot
	dot -Tpdf server.dot > server.pdf

server.ps : server.dot
	dot -Tps server.dot > server.ps

client.ps : client.dot
	dot -Tps client.dot > client.ps

complex-itemmap.png : complex-itemmap.dot

Modified docs/manual/megatest_manual.html from [a02a70016f] to [fdd645b09f].

1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.7">
<title>The Megatest Users Manual</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */

/* Default font. */
body {
  font-family: Georgia,serif;




|







1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.10">
<title>The Megatest Users Manual</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */

/* Default font. */
body {
  font-family: Georgia,serif;
82
83
84
85
86
87
88
89



90
91
92



93
94
95
96
97
98
99

ul, ol, li > p {
  margin-top: 0;
}
ul > li     { color: #aaa; }
ul > li > * { color: black; }

pre {



  padding: 0;
  margin: 0;
}




#author {
  color: #527bbd;
  font-weight: bold;
  font-size: 1.1em;
}
#email {







|
>
>
>



>
>
>







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

ul, ol, li > p {
  margin-top: 0;
}
ul > li     { color: #aaa; }
ul > li > * { color: black; }

.monospaced, code, pre {
  font-family: "Courier New", Courier, monospace;
  font-size: inherit;
  color: navy;
  padding: 0;
  margin: 0;
}
pre {
  white-space: pre-wrap;
}

#author {
  color: #527bbd;
  font-weight: bold;
  font-size: 1.1em;
}
#email {
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228

div.exampleblock > div.content {
  border-left: 3px solid #dddddd;
  padding-left: 0.5em;
}

div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; }
a.image:visited { color: white; }

dl {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
dt {







|







220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

div.exampleblock > div.content {
  border-left: 3px solid #dddddd;
  padding-left: 0.5em;
}

div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; vertical-align: text-bottom; }
a.image:visited { color: white; }

dl {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
dt {
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429


/*
 * xhtml11 specific
 *
 * */

tt {
  font-family: "Courier New", Courier, monospace;
  font-size: inherit;
  color: navy;
}

div.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.tableblock > table {
  border: 3px solid #527bbd;
}







<
<
<
<
<
<







416
417
418
419
420
421
422






423
424
425
426
427
428
429


/*
 * xhtml11 specific
 *
 * */







div.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.tableblock > table {
  border: 3px solid #527bbd;
}
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468


/*
 * html5 specific
 *
 * */

.monospaced {
  font-family: "Courier New", Courier, monospace;
  font-size: inherit;
  color: navy;
}

table.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
thead, p.tableblock.header {
  font-weight: bold;
  color: #527bbd;







<
<
<
<
<
<







449
450
451
452
453
454
455






456
457
458
459
460
461
462


/*
 * html5 specific
 *
 * */







table.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
thead, p.tableblock.header {
  font-weight: bold;
  color: #527bbd;
534
535
536
537
538
539
540


541
542
543
544
545
546
547
body.manpage div.sectionbody {
  margin-left: 3em;
}

@media print {
  body.manpage div#toc { display: none; }
}


@media screen {
  body {
    max-width: 50em; /* approximately 80 characters wide */
    margin-left: 16em;
  }

  #toc {







>
>







528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
body.manpage div.sectionbody {
  margin-left: 3em;
}

@media print {
  body.manpage div#toc { display: none; }
}


@media screen {
  body {
    max-width: 50em; /* approximately 80 characters wide */
    margin-left: 16em;
  }

  #toc {
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
</div></div>
</div>
<div class="sect2">
<h3 id="_trim_trailing_spaces">Trim trailing spaces</h3>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="/nfs/pdx/disks/ice.disk.002/icfadm/pkgs/asciidoc/8.6.7/images/icons/note.png" alt="Note">
</td>
<td class="content">As of Megatest version v1.6548 trim-trailing-spaces defaults to yes.</td>
</tr></table>
</div>
<div class="listingblock">
<div class="content monospaced">
<pre>[configf:settings trim-trailing-spaces no]







|







2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
</div></div>
</div>
<div class="sect2">
<h3 id="_trim_trailing_spaces">Trim trailing spaces</h3>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="/usr/images/icons/note.png" alt="Note">
</td>
<td class="content">As of Megatest version v1.6548 trim-trailing-spaces defaults to yes.</td>
</tr></table>
</div>
<div class="listingblock">
<div class="content monospaced">
<pre>[configf:settings trim-trailing-spaces no]
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
<pre># A normal waiton waits for the prior tests to be COMPLETED
# and PASS, CHECK or WAIVED
waiton test1 test2</pre>
</div></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="/nfs/pdx/disks/ice.disk.002/icfadm/pkgs/asciidoc/8.6.7/images/icons/note.png" alt="Note">
</td>
<td class="content">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.</td>
</tr></table>
</div>
<div class="listingblock">







|







2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
<pre># A normal waiton waits for the prior tests to be COMPLETED
# and PASS, CHECK or WAIVED
waiton test1 test2</pre>
</div></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="/usr/images/icons/note.png" alt="Note">
</td>
<td class="content">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.</td>
</tr></table>
</div>
<div class="listingblock">
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
<div class="content monospaced">
<pre>[triggers]
COMPLETED/ xterm -e bash -s --</pre>
</div></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="/nfs/pdx/disks/ice.disk.002/icfadm/pkgs/asciidoc/8.6.7/images/icons/note.png" alt="Note">
</td>
<td class="content">There is a trailing space after the double-dash</td>
</tr></table>
</div>
<div class="paragraph"><p>There are a number of environment variables available to the trigger script
but since triggers can be called in various contexts not all variables are
available at all times. The trigger script should check for the variable and







|







3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
<div class="content monospaced">
<pre>[triggers]
COMPLETED/ xterm -e bash -s --</pre>
</div></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="/usr/images/icons/note.png" alt="Note">
</td>
<td class="content">There is a trailing space after the double-dash</td>
</tr></table>
</div>
<div class="paragraph"><p>There are a number of environment variables available to the trigger script
but since triggers can be called in various contexts not all variables are
available at all times. The trigger script should check for the variable and
3482
3483
3484
3485
3486
3487
3488
3489

3490
3491
3492
3493
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
Version 1.5<br>
Last updated 2020-09-08 08:39:29 PDT

</div>
</div>
</body>
</html>







|
>




3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
Version 1.5<br>
Last updated
 2021-01-25 11:33:16 MST
</div>
</div>
</body>
</html>

Modified docs/manual/server.dot from [3e029f5fe5] to [1e30b4ae23].

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
//     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/>.
digraph G {


    subgraph cluster_1 {


        node [style=filled,shape=box];

	check_available_queue       -> remove_entries_over_10s_old;



	remove_entries_over_10s_old -> set_available [label="num_avail < 3"];




	remove_entries_over_10s_old -> exit [label="num_avail > 2"];

	set_available               -> delay_2s;
	delay_2s          -> check_place_in_queue;



	check_place_in_queue        -> "http:transport-launch" [label="at head"];
	check_place_in_queue        -> exit [label="not at head"];







	"client:login"              -> "server:shutdown" [label="login failed"];
	"server:shutdown"           -> exit;	



	subgraph cluster_2 {







		"http:transport-launch"       -> "http:transport-run";
		"http:transport-launch"       -> "http:transport-keep-running";




		"http:transport-keep-running" -> "tests running?";




		"tests running?"              -> "client:login" [label=yes];

		"tests running?"              -> "server:shutdown" [label=no];

		"client:login"                -> delay_5s [label="login ok"];
		delay_5s                      -> "http:transport-keep-running";
	}


	// start_server -> "server_running?";




	// "server_running?" -> set_available [label="no"];


	// "server_running?" -> delay_2s [label="yes"];
	// delay_2s -> "still_running?";

	// "still_running?" -> ping_server [label=yes];
	// "still_running?" -> set_available [label=no];
	// ping_server -> exit [label=alive];

	// ping_server -> remove_server_record [label=dead];
	// remove_server_record -> set_available;








	// set_available -> avail_delay [label="delay 3s"];

	// avail_delay -> "first_in_queue?";
	// 












	// "first_in_queue?" -> set_running [label=yes];
	// set_running -> get_next_port -> handle_requests;
	// "first_in_queue?" -> "dead_entry_in_queue?" [label=no];
	// "dead_entry_in_queue?" -> "server_running?" [label=no];
	// "dead_entry_in_queue?" -> "remove_dead_entries" [label=yes];
	// remove_dead_entries -> "server_running?";
	// 
	// handle_requests -> start_shutdown [label="no traffic\nno running tests"];
	// handle_requests -> shutdown_request;
	// start_shutdown -> shutdown_delay;
	// shutdown_request -> shutdown_delay;
	// shutdown_delay -> exit;
	
        label = "server:launch";
        color=brown;
    }


//     client_start_server -> start_server;
//     handle_requests -> read_write;
//     read_write -> handle_requests;
}







>
|
>
>
|
|
<
>
>
>
|
>
>
>
>
|
|
|
|
>

>
|
|
>
>
>
>
>
>

<
<
|
>
>
|
>
>
>
>
>
>
>
|
<
>
>
>
|
|
>
>
>
>
|
>
|
>
|
<
|
>
|
|
>
>
>
>
|
>
>
|
|
>
|
<
|
>
|
|
>
>
>
>
>
>
>
>
|
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
>





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

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
132

133
134
135
136
137
138
//     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/>.
digraph G {

// connecting to server
subgraph cluster_1 {
  label="Connect";
  
  node [style=filled,shape=box];
  dotserver [label="Have .server file?"];

  connect [label="Connect to server"];
  // startserver [label="Start Server"];
  connected [label="Connection Successful"];
  anylive [label="Any live servers?"];
  askstart [label="Ask existing server to start a new server"];
  anydboard [label="Any live dashboards"];
  askdboard [label="Ask dashboard to start server"];
  serverlaunch [label="User server launch to start server process"];
  wait5sec [label="Wait 5 seconds"];
  
  dotserver -> connect [label="yes"];
  connect -> connected [label="yes"];
  connect -> anylive [label="no"];

  // startserver -> anylive;
  anylive -> askstart [label="yes"];
  anylive -> anydboard [label="no"];
  anydboard -> askdboard [label="yes"];
  anydboard -> serverlaunch [label="no"];
  serverlaunch -> wait5sec;
  askdboard -> wait5sec;
  askstart -> wait5sec;
  wait5sec -> dotserver;



}

// server bootstrap
subgraph cluster_2 {
  label="Startup";
  node [style=filled,shape=box];
  getlock [label="Get file lock"];
  starthttp [label="Start http server"];
  copydb [label="Copy db to /tmp"];
  createsrvfile [label="Create .nnn.server file containing host:port"];
  releaselock [label="Release file lock"];
  

  getlock -> starthttp -> createsrvfile;
  getlock -> copydb -> createsrvfile;
  createsrvfile -> releaselock;
}

// shutting down server
subgraph cluster_3 {
  label="Shutdown";
  node [style=filled,shape=box];
  shutdown [label="Start Shutdown"];
  rejectmode [label="Put http server into reject requests mode"];
  syncback [label="Sync db back"];
  removesrvfile [label="Remove server file containing host:port"];
  exit [label="Exit process"];


  shutdown -> rejectmode -> syncback -> removesrvfile -> exit;
}

//     subgraph cluster_1 {
//         node [style=filled,shape=box];
// 
// 	check_available_queue       -> remove_entries_over_10s_old;
// 	remove_entries_over_10s_old -> set_available [label="num_avail < 3"];
// 	remove_entries_over_10s_old -> exit [label="num_avail > 2"];
// 
// 	set_available               -> delay_2s;
// 	delay_2s          -> check_place_in_queue;
// 
// 	check_place_in_queue        -> "http:transport-launch" [label="at head"];

// 	check_place_in_queue        -> exit [label="not at head"];
// 
// 	"client:login"              -> "server:shutdown" [label="login failed"];
// 	"server:shutdown"           -> exit;	
// 
// 	subgraph cluster_2 {
// 		"http:transport-launch"       -> "http:transport-run";
// 		"http:transport-launch"       -> "http:transport-keep-running";
// 
// 		"http:transport-keep-running" -> "tests running?";
// 		"tests running?"              -> "client:login" [label=yes];
// 		"tests running?"              -> "server:shutdown" [label=no];
// 		"client:login"                -> delay_5s [label="login ok"];
// 		delay_5s                      -> "http:transport-keep-running";
// 	}
// 
// 	// start_server -> "server_running?";
// 	// "server_running?" -> set_available [label="no"];
// 	// "server_running?" -> delay_2s [label="yes"];
// 	// delay_2s -> "still_running?";
// 	// "still_running?" -> ping_server [label=yes];
// 	// "still_running?" -> set_available [label=no];
// 	// ping_server -> exit [label=alive];
// 	// ping_server -> remove_server_record [label=dead];
// 	// remove_server_record -> set_available;
// 	// set_available -> avail_delay [label="delay 3s"];
// 	// avail_delay -> "first_in_queue?";
// 	// 
// 	// "first_in_queue?" -> set_running [label=yes];
// 	// set_running -> get_next_port -> handle_requests;
// 	// "first_in_queue?" -> "dead_entry_in_queue?" [label=no];
// 	// "dead_entry_in_queue?" -> "server_running?" [label=no];
// 	// "dead_entry_in_queue?" -> "remove_dead_entries" [label=yes];
// 	// remove_dead_entries -> "server_running?";
// 	// 
// 	// handle_requests -> start_shutdown [label="no traffic\nno running tests"];
// 	// handle_requests -> shutdown_request;
// 	// start_shutdown -> shutdown_delay;
// 	// shutdown_request -> shutdown_delay;
// 	// shutdown_delay -> exit;
// 	
//         label = "server:launch";
//         color=brown;

//     }

//     client_start_server -> start_server;
//     handle_requests -> read_write;
//     read_write -> handle_requests;
}

Modified docs/manual/server.png from [ae7d7ee58e] to [76af712a05].

cannot compute difference between binary files

Modified megatest.scm from [e69eff1234] to [e598983384].

40
41
42
43
44
45
46




47
48
49
50
51
52
53
(declare (uses api))
(declare (uses tasks)) ;; only used for debugging.
(declare (uses env))
(declare (uses diff-report))
;; (declare (uses ftail))
;; (import ftail)





(define *db* #f) ;; this is only for the repl, do not use in general!!!!

(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")
(include "run_records.scm")
(include "megatest-fossil-hash.scm")







>
>
>
>







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
(declare (uses api))
(declare (uses tasks)) ;; only used for debugging.
(declare (uses env))
(declare (uses diff-report))
;; (declare (uses ftail))
;; (import ftail)

(declare (uses dbmod))
(import dbmod)
(declare (uses dbmod.import))

(define *db* #f) ;; this is only for the repl, do not use in general!!!!

(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")
(include "run_records.scm")
(include "megatest-fossil-hash.scm")