Megatest

Hex Artifact Content
Login

Artifact b320e4ba8cdc169ce6d7a8111d6a89030a3a448d:


0000: 2f 2f 20 20 43 6f 70 79 72 69 67 68 74 20 32 30  //  Copyright 20
0010: 30 36 2d 32 30 31 37 2c 20 4d 61 74 74 68 65 77  06-2017, Matthew
0020: 20 57 65 6c 6c 61 6e 64 2e 0a 2f 2f 20 0a 2f 2f   Welland..// .//
0030: 20 54 68 69 73 20 66 69 6c 65 20 69 73 20 70 61   This file is pa
0040: 72 74 20 6f 66 20 4d 65 67 61 74 65 73 74 2e 0a  rt of Megatest..
0050: 2f 2f 20 0a 2f 2f 20 20 20 20 20 4d 65 67 61 74  // .//     Megat
0060: 65 73 74 20 69 73 20 66 72 65 65 20 73 6f 66 74  est is free soft
0070: 77 61 72 65 3a 20 79 6f 75 20 63 61 6e 20 72 65  ware: you can re
0080: 64 69 73 74 72 69 62 75 74 65 20 69 74 20 61 6e  distribute it an
0090: 64 2f 6f 72 20 6d 6f 64 69 66 79 0a 2f 2f 20 20  d/or modify.//  
00a0: 20 20 20 69 74 20 75 6e 64 65 72 20 74 68 65 20     it under the 
00b0: 74 65 72 6d 73 20 6f 66 20 74 68 65 20 47 4e 55  terms of the GNU
00c0: 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20   General Public 
00d0: 4c 69 63 65 6e 73 65 20 61 73 20 70 75 62 6c 69  License as publi
00e0: 73 68 65 64 20 62 79 0a 2f 2f 20 20 20 20 20 74  shed by.//     t
00f0: 68 65 20 46 72 65 65 20 53 6f 66 74 77 61 72 65  he Free Software
0100: 20 46 6f 75 6e 64 61 74 69 6f 6e 2c 20 65 69 74   Foundation, eit
0110: 68 65 72 20 76 65 72 73 69 6f 6e 20 33 20 6f 66  her version 3 of
0120: 20 74 68 65 20 4c 69 63 65 6e 73 65 2c 20 6f 72   the License, or
0130: 0a 2f 2f 20 20 20 20 20 28 61 74 20 79 6f 75 72  .//     (at your
0140: 20 6f 70 74 69 6f 6e 29 20 61 6e 79 20 6c 61 74   option) any lat
0150: 65 72 20 76 65 72 73 69 6f 6e 2e 0a 2f 2f 20 0a  er version..// .
0160: 2f 2f 20 20 20 20 20 4d 65 67 61 74 65 73 74 20  //     Megatest 
0170: 69 73 20 64 69 73 74 72 69 62 75 74 65 64 20 69  is distributed i
0180: 6e 20 74 68 65 20 68 6f 70 65 20 74 68 61 74 20  n the hope that 
0190: 69 74 20 77 69 6c 6c 20 62 65 20 75 73 65 66 75  it will be usefu
01a0: 6c 2c 0a 2f 2f 20 20 20 20 20 62 75 74 20 57 49  l,.//     but WI
01b0: 54 48 4f 55 54 20 41 4e 59 20 57 41 52 52 41 4e  THOUT ANY WARRAN
01c0: 54 59 3b 20 77 69 74 68 6f 75 74 20 65 76 65 6e  TY; without even
01d0: 20 74 68 65 20 69 6d 70 6c 69 65 64 20 77 61 72   the implied war
01e0: 72 61 6e 74 79 20 6f 66 0a 2f 2f 20 20 20 20 20  ranty of.//     
01f0: 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 20  MERCHANTABILITY 
0200: 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 41  or FITNESS FOR A
0210: 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 50   PARTICULAR PURP
0220: 4f 53 45 2e 20 20 53 65 65 20 74 68 65 0a 2f 2f  OSE.  See the.//
0230: 20 20 20 20 20 47 4e 55 20 47 65 6e 65 72 61 6c       GNU General
0240: 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20   Public License 
0250: 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73  for more details
0260: 2e 0a 2f 2f 20 0a 2f 2f 20 20 20 20 20 59 6f 75  ..// .//     You
0270: 20 73 68 6f 75 6c 64 20 68 61 76 65 20 72 65 63   should have rec
0280: 65 69 76 65 64 20 61 20 63 6f 70 79 20 6f 66 20  eived a copy of 
0290: 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20  the GNU General 
02a0: 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 0a 2f  Public License./
02b0: 2f 20 20 20 20 20 61 6c 6f 6e 67 20 77 69 74 68  /     along with
02c0: 20 4d 65 67 61 74 65 73 74 2e 20 20 49 66 20 6e   Megatest.  If n
02d0: 6f 74 2c 20 73 65 65 20 3c 68 74 74 70 3a 2f 2f  ot, see <http://
02e0: 77 77 77 2e 67 6e 75 2e 6f 72 67 2f 6c 69 63 65  www.gnu.org/lice
02f0: 6e 73 65 73 2f 3e 2e 0a 0a 64 69 67 72 61 70 68  nses/>...digraph
0300: 20 47 20 7b 0a 0a 20 20 20 20 2f 2f 20 70 75 74   G {..    // put
0310: 20 63 6c 69 65 6e 74 20 61 66 74 65 72 20 73 65   client after se
0320: 72 76 65 72 20 73 6f 20 73 65 72 76 65 72 5f 73  rver so server_s
0330: 74 61 72 74 20 6e 6f 64 65 20 69 73 20 76 69 73  tart node is vis
0340: 69 62 6c 65 0a 20 20 20 20 2f 2f 0a 20 20 20 20  ible.    //.    
0350: 73 75 62 67 72 61 70 68 20 63 6c 75 73 74 65 72  subgraph cluster
0360: 5f 32 20 7b 0a 20 20 20 20 20 20 20 20 6e 6f 64  _2 {.        nod
0370: 65 20 5b 73 74 79 6c 65 3d 66 69 6c 6c 65 64 2c  e [style=filled,
0380: 73 68 61 70 65 3d 62 6f 78 5d 3b 0a 09 0a 09 22  shape=box];...."
0390: 63 6c 69 65 6e 74 3a 73 65 74 75 70 20 73 74 61  client:setup sta
03a0: 72 74 22 20 20 20 20 20 2d 3e 20 72 75 6e 72 65  rt"     -> runre
03b0: 6d 6f 74 65 5f 6c 6f 6f 6b 75 70 5f 73 65 72 76  mote_lookup_serv
03c0: 65 72 3b 0a 09 72 75 6e 72 65 6d 6f 74 65 5f 6c  er;..runremote_l
03d0: 6f 6f 6b 75 70 5f 73 65 72 76 65 72 20 20 2d 3e  ookup_server  ->
03e0: 20 6c 6f 67 69 6e 5f 61 74 74 65 6d 70 74 20 5b   login_attempt [
03f0: 6c 61 62 65 6c 3d 22 68 61 76 65 20 73 65 72 76  label="have serv
0400: 65 72 22 5d 3b 0a 09 72 75 6e 72 65 6d 6f 74 65  er"];..runremote
0410: 5f 6c 6f 6f 6b 75 70 5f 73 65 72 76 65 72 20 20  _lookup_server  
0420: 2d 3e 20 6d 6f 6e 69 74 6f 72 64 62 5f 6c 6f 6f  -> monitordb_loo
0430: 6b 75 70 5f 73 65 72 76 65 72 20 5b 6c 61 62 65  kup_server [labe
0440: 6c 3d 22 6e 6f 20 73 65 72 76 65 72 22 5d 3b 0a  l="no server"];.
0450: 0a 09 6d 6f 6e 69 74 6f 72 64 62 5f 6c 6f 6f 6b  ..monitordb_look
0460: 75 70 5f 73 65 72 76 65 72 20 20 2d 3e 20 6c 6f  up_server  -> lo
0470: 67 69 6e 5f 61 74 74 65 6d 70 74 20 5b 6c 61 62  gin_attempt [lab
0480: 65 6c 3d 22 68 61 76 65 20 73 65 72 76 65 72 22  el="have server"
0490: 5d 3b 0a 09 6d 6f 6e 69 74 6f 72 64 62 5f 6c 6f  ];..monitordb_lo
04a0: 6f 6b 75 70 5f 73 65 72 76 65 72 20 20 2d 3e 20  okup_server  -> 
04b0: 73 65 72 76 65 72 5f 73 74 61 72 74 5f 72 65 6d  server_start_rem
04c0: 6f 74 65 20 5b 6c 61 62 65 6c 3d 22 6e 6f 20 73  ote [label="no s
04d0: 65 72 76 65 72 22 5d 3b 0a 0a 09 73 65 72 76 65  erver"];...serve
04e0: 72 5f 73 74 61 72 74 5f 72 65 6d 6f 74 65 20 20  r_start_remote  
04f0: 20 20 20 20 2d 3e 20 64 65 6c 61 79 5f 32 5f 73      -> delay_2_s
0500: 65 63 3b 0a 09 64 65 6c 61 79 5f 32 5f 73 65 63  ec;..delay_2_sec
0510: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 3e                ->
0520: 20 72 75 6e 72 65 6d 6f 74 65 5f 6c 6f 6f 6b 75   runremote_looku
0530: 70 5f 73 65 72 76 65 72 3b 0a 0a 09 6c 6f 67 69  p_server;...logi
0540: 6e 5f 61 74 74 65 6d 70 74 20 20 20 20 20 20 20  n_attempt       
0550: 20 20 20 20 20 2d 3e 20 22 72 6d 74 3a 73 65 6e       -> "rmt:sen
0560: 64 2d 72 65 63 65 69 76 65 5f 73 74 61 72 74 22  d-receive_start"
0570: 20 5b 6c 61 62 65 6c 3d 22 6c 6f 67 69 6e 20 73   [label="login s
0580: 75 63 65 73 73 66 75 6c 22 5d 3b 0a 09 22 72 6d  ucessful"];.."rm
0590: 74 3a 73 65 6e 64 2d 72 65 63 65 69 76 65 5f 73  t:send-receive_s
05a0: 74 61 72 74 22 20 2d 3e 20 22 72 6d 74 3a 73 65  tart" -> "rmt:se
05b0: 6e 64 2d 72 65 63 65 69 76 65 5f 73 74 61 72 74  nd-receive_start
05c0: 22 3b 0a 0a 09 22 72 6d 74 3a 73 65 6e 64 2d 72  ";..."rmt:send-r
05d0: 65 63 65 69 76 65 5f 73 74 61 72 74 22 20 2d 3e  eceive_start" ->
05e0: 20 72 75 6e 72 65 6d 6f 74 65 5f 6c 6f 6f 6b 75   runremote_looku
05f0: 70 5f 73 65 72 76 65 72 20 5b 6c 61 62 65 6c 3d  p_server [label=
0600: 65 78 63 65 70 74 69 6f 6e 5d 3b 0a 09 6c 6f 67  exception];..log
0610: 69 6e 5f 61 74 74 65 6d 70 74 20 20 20 20 20 20  in_attempt      
0620: 20 20 20 20 20 20 2d 3e 20 63 6c 65 61 72 5f 72        -> clear_r
0630: 75 6e 72 65 6d 6f 74 65 20 5b 6c 61 62 65 6c 3d  unremote [label=
0640: 22 6c 6f 67 69 6e 20 66 61 69 6c 65 64 22 5d 3b  "login failed"];
0650: 0a 0a 09 22 72 65 6d 6f 76 65 5f 72 75 6e 6e 69  ..."remove_runni
0660: 6e 67 20 3e 20 35 73 22 20 20 20 20 2d 3e 20 72  ng > 5s"    -> r
0670: 75 6e 72 65 6d 6f 74 65 5f 6c 6f 6f 6b 75 70 5f  unremote_lookup_
0680: 73 65 72 76 65 72 3b 0a 0a 09 73 75 62 67 72 61  server;...subgra
0690: 70 68 20 63 6c 75 73 74 65 72 5f 33 20 7b 0a 09  ph cluster_3 {..
06a0: 09 6e 6f 64 65 20 5b 73 74 79 6c 65 3d 66 69 6c  .node [style=fil
06b0: 6c 65 64 5d 3b 0a 09 09 63 6c 65 61 72 5f 72 75  led];...clear_ru
06c0: 6e 72 65 6d 6f 74 65 20 20 20 20 20 20 20 20 20  nremote         
06d0: 20 2d 3e 20 22 72 65 6d 6f 76 65 5f 72 75 6e 6e   -> "remove_runn
06e0: 69 6e 67 20 3e 20 35 73 22 3b 0a 09 7d 0a 0a 20  ing > 5s";..}.. 
06f0: 20 20 20 20 20 20 20 6c 61 62 65 6c 20 3d 20 22         label = "
0700: 63 6c 69 65 6e 74 3a 73 65 74 75 70 22 3b 0a 20  client:setup";. 
0710: 20 20 20 20 20 20 20 63 6f 6c 6f 72 3d 67 72 65         color=gre
0720: 65 6e 3b 0a 20 20 20 20 7d 0a 0a 7d              en;.    }..}