ADDED docs/manual/client.ps Index: docs/manual/client.ps ================================================================== --- /dev/null +++ docs/manual/client.ps @@ -0,0 +1,693 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.38.0 (20140413.2041) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def +/tapered { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 450 550 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 414 514 boxprim clip newpath +1 1 set_scale 0 rotate 40 40 translate +% cluster_2 +gsave +1 setlinewidth +0.33333 1 1 graphcolor +newpath 8 8 moveto +8 498 lineto +341 498 lineto +341 8 lineto +closepath stroke +0 0 0 graphcolor +14 /Times-Roman set_font +143 482.8 moveto 63 (client:setup) alignedtext +grestore +% cluster_3 +gsave +1 setlinewidth +0 0 0 graphcolor +newpath 16 342 moveto +16 467 lineto +166 467 lineto +166 342 lineto +closepath stroke +grestore +% client:setup start +gsave +0 0 0.82745 nodecolor +newpath 282 386 moveto +176 386 lineto +176 350 lineto +282 350 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 282 386 moveto +176 386 lineto +176 350 lineto +282 350 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +184 364.3 moveto 90 (client:setup start) alignedtext +grestore +% runremote_lookup_server +gsave +0 0 0.82745 nodecolor +newpath 217.5 313 moveto +60.5 313 lineto +60.5 277 lineto +217.5 277 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 217.5 313 moveto +60.5 313 lineto +60.5 277 lineto +217.5 277 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +68.5 291.3 moveto 141 (runremote_lookup_server) alignedtext +grestore +% client:setup start->runremote_lookup_server +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 207.21 349.81 moveto +195.61 340.66 181.16 329.26 168.56 319.32 curveto +stroke +0 0 0 edgecolor +newpath 170.6 316.47 moveto +160.59 313.03 lineto +166.27 321.97 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 170.6 316.47 moveto +160.59 313.03 lineto +166.27 321.97 lineto +closepath stroke +grestore +% login_attempt +gsave +0 0 0.82745 nodecolor +newpath 324 139 moveto +232 139 lineto +232 103 lineto +324 103 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 324 139 moveto +232 139 lineto +232 103 lineto +324 103 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +240 117.3 moveto 76 (login_attempt) alignedtext +grestore +% runremote_lookup_server->login_attempt +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 190.79 276.8 moveto +200.53 272.04 210.12 266.16 218 259 curveto +250.85 229.16 251.17 213.46 267 172 curveto +269.79 164.69 271.96 156.5 273.61 148.9 curveto +stroke +0 0 0 edgecolor +newpath 277.06 149.52 moveto +275.54 139.03 lineto +270.19 148.17 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 277.06 149.52 moveto +275.54 139.03 lineto +270.19 148.17 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +261 204.3 moveto 63 (have server) alignedtext +grestore +% monitordb_lookup_server +gsave +0 0 0.82745 nodecolor +newpath 194 226 moveto +36 226 lineto +36 190 lineto +194 190 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 194 226 moveto +36 226 lineto +36 190 lineto +194 190 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +44 204.3 moveto 142 (monitordb_lookup_server) alignedtext +grestore +% runremote_lookup_server->monitordb_lookup_server +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 134.14 276.8 moveto +130.83 265.05 126.36 249.24 122.58 235.84 curveto +stroke +0 0 0 edgecolor +newpath 125.94 234.85 moveto +119.85 226.18 lineto +119.2 236.75 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 125.94 234.85 moveto +119.85 226.18 lineto +119.2 236.75 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +129 247.8 moveto 51 (no server) alignedtext +grestore +% rmt:send-receive_start +gsave +0 0 0.82745 nodecolor +newpath 289 52 moveto +151 52 lineto +151 16 lineto +289 16 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 289 52 moveto +151 52 lineto +151 16 lineto +289 16 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +159 30.3 moveto 122 (rmt:send-receive_start) alignedtext +grestore +% login_attempt->rmt:send-receive_start +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 266.26 102.8 moveto +258.01 90.7 246.82 74.3 237.51 60.67 curveto +stroke +0 0 0 edgecolor +newpath 240.25 58.46 moveto +231.72 52.18 lineto +234.47 62.41 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 240.25 58.46 moveto +231.72 52.18 lineto +234.47 62.41 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +253 73.8 moveto 82 (login sucessful) alignedtext +grestore +% clear_runremote +gsave +0 0 0.82745 nodecolor +newpath 151 459 moveto +45 459 lineto +45 423 lineto +151 423 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 151 459 moveto +45 459 lineto +45 423 lineto +151 423 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +53 437.3 moveto 90 (clear_runremote) alignedtext +grestore +% login_attempt->clear_runremote +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 294.97 139.02 moveto +306.47 151.83 320.7 170.47 327 190 curveto +354.2 274.29 351.99 321.78 291 386 curveto +257.73 421.03 203.76 433.95 161.34 438.43 curveto +stroke +0 0 0 edgecolor +newpath 161.01 434.95 moveto +151.38 439.36 lineto +161.66 441.92 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 161.01 434.95 moveto +151.38 439.36 lineto +161.66 441.92 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +343 291.3 moveto 63 (login failed) alignedtext +grestore +% monitordb_lookup_server->login_attempt +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 115.13 189.95 moveto +116.14 179.1 119.27 165.52 128 157 curveto +141.39 143.95 184.91 134.71 221.65 129.01 curveto +stroke +0 0 0 edgecolor +newpath 222.43 132.44 moveto +231.81 127.5 lineto +221.4 125.51 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 222.43 132.44 moveto +231.81 127.5 lineto +221.4 125.51 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +128 160.8 moveto 63 (have server) alignedtext +grestore +% server_start_remote +gsave +0 0 0.82745 nodecolor +newpath 161.5 139 moveto +36.5 139 lineto +36.5 103 lineto +161.5 103 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 161.5 139 moveto +36.5 139 lineto +36.5 103 lineto +161.5 103 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +44.5 117.3 moveto 109 (server_start_remote) alignedtext +grestore +% monitordb_lookup_server->server_start_remote +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 71.66 189.93 moveto +64.6 185.19 58.22 179.29 54 172 curveto +48.62 162.72 52.9 153.65 60.6 145.85 curveto +stroke +0 0 0 edgecolor +newpath 63.17 148.26 moveto +68.45 139.07 lineto +58.59 142.96 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 63.17 148.26 moveto +68.45 139.07 lineto +58.59 142.96 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +54 160.8 moveto 51 (no server) alignedtext +grestore +% delay_2_sec +gsave +0 0 0.82745 nodecolor +newpath 116.5 52 moveto +33.5 52 lineto +33.5 16 lineto +116.5 16 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 116.5 52 moveto +33.5 52 lineto +33.5 16 lineto +116.5 16 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +41.5 30.3 moveto 67 (delay_2_sec) alignedtext +grestore +% server_start_remote->delay_2_sec +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 94.14 102.8 moveto +90.83 91.05 86.36 75.24 82.58 61.84 curveto +stroke +0 0 0 edgecolor +newpath 85.94 60.85 moveto +79.85 52.18 lineto +79.2 62.75 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 85.94 60.85 moveto +79.85 52.18 lineto +79.2 62.75 lineto +closepath stroke +grestore +% delay_2_sec->runremote_lookup_server +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 58.78 52.17 moveto +47.77 65.05 34.14 83.72 28 103 curveto +12.8 150.76 20.08 213.71 27 226 curveto +38.66 246.72 59.47 261.86 80.02 272.52 curveto +stroke +0 0 0 edgecolor +newpath 78.57 275.71 moveto +89.09 276.96 lineto +81.65 269.42 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 78.57 275.71 moveto +89.09 276.96 lineto +81.65 269.42 lineto +closepath stroke +grestore +% rmt:send-receive_start->runremote_lookup_server +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 218.57 52.19 moveto +214.71 98.36 204.3 221.87 203 226 curveto +197.91 242.14 195.11 246.23 184 259 curveto +180.6 262.91 176.7 266.69 172.65 270.22 curveto +stroke +0 0 0 edgecolor +newpath 170.29 267.64 moveto +164.79 276.69 lineto +174.73 273.05 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 170.29 267.64 moveto +164.79 276.69 lineto +174.73 273.05 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +210 160.8 moveto 53 (exception) alignedtext +grestore +% rmt:send-receive_start->rmt:send-receive_start +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 289.27 41.18 moveto +299.83 40.09 307 37.69 307 34 curveto +307 31.64 304.06 29.8 299.17 28.5 curveto +stroke +0 0 0 edgecolor +newpath 299.72 25.05 moveto +289.27 26.82 lineto +298.55 31.95 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 299.72 25.05 moveto +289.27 26.82 lineto +298.55 31.95 lineto +closepath stroke +grestore +% remove_running > 5s +gsave +0 0 0.82745 nodecolor +newpath 158 386 moveto +24 386 lineto +24 350 lineto +158 350 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 158 386 moveto +24 386 lineto +24 350 lineto +158 350 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +32 364.3 moveto 118 (remove_running > 5s) alignedtext +grestore +% clear_runremote->remove_running > 5s +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 96.31 422.81 moveto +95.51 414.79 94.55 405.05 93.67 396.07 curveto +stroke +0 0 0 edgecolor +newpath 97.14 395.64 moveto +92.68 386.03 lineto +90.18 396.32 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 97.14 395.64 moveto +92.68 386.03 lineto +90.18 396.32 lineto +closepath stroke +grestore +% remove_running > 5s->runremote_lookup_server +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 102.62 349.81 moveto +108.4 341.27 115.49 330.77 121.88 321.32 curveto +stroke +0 0 0 edgecolor +newpath 124.79 323.27 moveto +127.49 313.03 lineto +118.99 319.35 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 124.79 323.27 moveto +127.49 313.03 lineto +118.99 319.35 lineto +closepath stroke +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 450 550 +end +restore +%%EOF ADDED docs/manual/server.ps Index: docs/manual/server.ps ================================================================== --- /dev/null +++ docs/manual/server.ps @@ -0,0 +1,838 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.38.0 (20140413.2041) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def +/tapered { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 502 935 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 466 899 boxprim clip newpath +1 1 set_scale 0 rotate 40 40 translate +% cluster_1 +gsave +1 setlinewidth +0 0.7451 0.64706 graphcolor +newpath 8 8 moveto +8 883 lineto +450 883 lineto +450 8 lineto +closepath stroke +0 0 0 graphcolor +14 /Times-Roman set_font +192.5 867.8 moveto 73 (server:launch) alignedtext +grestore +% cluster_2 +gsave +1 setlinewidth +0 0 0 graphcolor +newpath 16 81 moveto +16 467 lineto +328 467 lineto +328 81 lineto +closepath stroke +grestore +% check_available_queue +gsave +0 0 0.82745 nodecolor +newpath 383.5 852 moveto +240.5 852 lineto +240.5 816 lineto +383.5 816 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 383.5 852 moveto +240.5 852 lineto +240.5 816 lineto +383.5 816 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +248.5 830.3 moveto 127 (check_available_queue) alignedtext +grestore +% remove_entries_over_10s_old +gsave +0 0 0.82745 nodecolor +newpath 402.5 779 moveto +221.5 779 lineto +221.5 743 lineto +402.5 743 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 402.5 779 moveto +221.5 779 lineto +221.5 743 lineto +402.5 743 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +229.5 757.3 moveto 165 (remove_entries_over_10s_old) alignedtext +grestore +% check_available_queue->remove_entries_over_10s_old +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 312 815.81 moveto +312 807.79 312 798.05 312 789.07 curveto +stroke +0 0 0 edgecolor +newpath 315.5 789.03 moveto +312 779.03 lineto +308.5 789.03 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 315.5 789.03 moveto +312 779.03 lineto +308.5 789.03 lineto +closepath stroke +grestore +% set_available +gsave +0 0 0.82745 nodecolor +newpath 315.5 692 moveto +228.5 692 lineto +228.5 656 lineto +315.5 656 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 315.5 692 moveto +228.5 692 lineto +228.5 656 lineto +315.5 656 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +236.5 670.3 moveto 71 (set_available) alignedtext +grestore +% remove_entries_over_10s_old->set_available +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 288.59 742.95 moveto +283.2 737.81 278.14 731.73 275 725 curveto +271.8 718.14 270.43 710.17 270.01 702.64 curveto +stroke +0 0 0 edgecolor +newpath 273.51 702.42 moveto +269.97 692.43 lineto +266.51 702.45 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 273.51 702.42 moveto +269.97 692.43 lineto +266.51 702.45 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +275 713.8 moveto 81 (num_avail < 3) alignedtext +grestore +% exit +gsave +0 0 0.82745 nodecolor +newpath 381 52 moveto +327 52 lineto +327 16 lineto +381 16 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 381 52 moveto +327 52 lineto +327 16 lineto +381 16 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +343.5 30.3 moveto 21 (exit) alignedtext +grestore +% remove_entries_over_10s_old->exit +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 340.49 742.84 moveto +346.56 737.84 352.26 731.86 356 725 curveto +366.69 705.39 361 697.33 361 675 curveto +361 675 361 675 361 440 curveto +361 344.75 434 333.75 434 238.5 curveto +434 238.5 434 238.5 434 106 curveto +434 80.65 411.26 62.15 390.02 50.4 curveto +stroke +0 0 0 edgecolor +newpath 391.57 47.26 moveto +381.08 45.78 lineto +388.36 53.48 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 391.57 47.26 moveto +381.08 45.78 lineto +388.36 53.48 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +368 393.8 moveto 81 (num_avail > 2) alignedtext +grestore +% delay_2s +gsave +0 0 0.82745 nodecolor +newpath 304.5 619 moveto +239.5 619 lineto +239.5 583 lineto +304.5 583 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 304.5 619 moveto +239.5 619 lineto +239.5 583 lineto +304.5 583 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +247.5 597.3 moveto 49 (delay_2s) alignedtext +grestore +% set_available->delay_2s +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 272 655.81 moveto +272 647.79 272 638.05 272 629.07 curveto +stroke +0 0 0 edgecolor +newpath 275.5 629.03 moveto +272 619.03 lineto +268.5 629.03 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 275.5 629.03 moveto +272 619.03 lineto +268.5 629.03 lineto +closepath stroke +grestore +% check_place_in_queue +gsave +0 0 0.82745 nodecolor +newpath 342 546 moveto +202 546 lineto +202 510 lineto +342 510 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 342 546 moveto +202 546 lineto +202 510 lineto +342 510 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +210 524.3 moveto 124 (check_place_in_queue) alignedtext +grestore +% delay_2s->check_place_in_queue +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 272 582.81 moveto +272 574.79 272 565.05 272 556.07 curveto +stroke +0 0 0 edgecolor +newpath 275.5 556.03 moveto +272 546.03 lineto +268.5 556.03 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 275.5 556.03 moveto +272 546.03 lineto +268.5 556.03 lineto +closepath stroke +grestore +% check_place_in_queue->exit +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 295.97 509.79 moveto +308.96 499.05 323.96 484.05 332 467 curveto +337.44 455.47 354 251.25 354 238.5 curveto +354 238.5 354 238.5 354 106 curveto +354 91.65 354 75.67 354 62.51 curveto +stroke +0 0 0 edgecolor +newpath 357.5 62.22 moveto +354 52.22 lineto +350.5 62.22 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 357.5 62.22 moveto +354 52.22 lineto +350.5 62.22 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +353 277.3 moveto 61 (not at head) alignedtext +grestore +% http:transport-launch +gsave +0 0 0.82745 nodecolor +newpath 302 459 moveto +172 459 lineto +172 423 lineto +302 423 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 302 459 moveto +172 459 lineto +172 423 lineto +302 423 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +180 437.3 moveto 114 (http:transport-launch) alignedtext +grestore +% check_place_in_queue->http:transport-launch +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 264.92 509.8 moveto +260.03 497.93 253.44 481.93 247.89 468.45 curveto +stroke +0 0 0 edgecolor +newpath 251.12 467.09 moveto +244.07 459.18 lineto +244.64 469.75 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 251.12 467.09 moveto +244.07 459.18 lineto +244.64 469.75 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +257 480.8 moveto 40 (at head) alignedtext +grestore +% http:transport-run +gsave +0 0 0.82745 nodecolor +newpath 136 372 moveto +24 372 lineto +24 336 lineto +136 336 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 136 372 moveto +24 372 lineto +24 336 lineto +136 336 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +32 350.3 moveto 96 (http:transport-run) alignedtext +grestore +% http:transport-launch->http:transport-run +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 205.23 422.8 moveto +180.78 409.56 146.83 391.18 120.45 376.9 curveto +stroke +0 0 0 edgecolor +newpath 121.92 373.71 moveto +111.46 372.03 lineto +118.58 379.87 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 121.92 373.71 moveto +111.46 372.03 lineto +118.58 379.87 lineto +closepath stroke +grestore +% http:transport-keep-running +gsave +0 0 0.82745 nodecolor +newpath 320 372 moveto +154 372 lineto +154 336 lineto +320 336 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 320 372 moveto +154 372 lineto +154 336 lineto +320 336 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +162 350.3 moveto 150 (http:transport-keep-running) alignedtext +grestore +% http:transport-launch->http:transport-keep-running +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 237 422.8 moveto +237 411.16 237 395.55 237 382.24 curveto +stroke +0 0 0 edgecolor +newpath 240.5 382.18 moveto +237 372.18 lineto +233.5 382.18 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 240.5 382.18 moveto +237 372.18 lineto +233.5 382.18 lineto +closepath stroke +grestore +% client:login +gsave +0 0 0.82745 nodecolor +newpath 268 212 moveto +190 212 lineto +190 176 lineto +268 176 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 268 212 moveto +190 212 lineto +190 176 lineto +268 176 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +198 190.3 moveto 62 (client:login) alignedtext +grestore +% server:shutdown +gsave +0 0 0.82745 nodecolor +newpath 232 125 moveto +126 125 lineto +126 89 lineto +232 89 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 232 125 moveto +126 125 lineto +126 89 lineto +232 89 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +134 103.3 moveto 90 (server:shutdown) alignedtext +grestore +% client:login->server:shutdown +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 195.89 175.85 moveto +189.53 170.97 183.71 165.03 180 158 curveto +176.38 151.14 175.17 142.97 175.12 135.25 curveto +stroke +0 0 0 edgecolor +newpath 178.62 135.33 moveto +175.66 125.16 lineto +171.63 134.96 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 178.62 135.33 moveto +175.66 125.16 lineto +171.63 134.96 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +180 146.8 moveto 63 (login failed) alignedtext +grestore +% delay_5s +gsave +0 0 0.82745 nodecolor +newpath 317.5 125 moveto +252.5 125 lineto +252.5 89 lineto +317.5 89 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 317.5 125 moveto +252.5 125 lineto +252.5 89 lineto +317.5 89 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +260.5 103.3 moveto 49 (delay_5s) alignedtext +grestore +% client:login->delay_5s +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 240.33 175.8 moveto +248.3 163.7 259.11 147.3 268.09 133.67 curveto +stroke +0 0 0 edgecolor +newpath 271.11 135.45 moveto +273.68 125.18 lineto +265.26 131.6 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 271.11 135.45 moveto +273.68 125.18 lineto +265.26 131.6 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +261 146.8 moveto 46 (login ok) alignedtext +grestore +% server:shutdown->exit +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 220.92 88.99 moveto +250.31 77.07 289.23 61.28 317.39 49.85 curveto +stroke +0 0 0 edgecolor +newpath 318.91 53.01 moveto +326.86 46.01 lineto +316.28 46.53 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 318.91 53.01 moveto +326.86 46.01 lineto +316.28 46.53 lineto +closepath stroke +grestore +% tests running? +gsave +0 0 0.82745 nodecolor +newpath 275 299 moveto +183 299 lineto +183 263 lineto +275 263 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 275 299 moveto +183 299 lineto +183 263 lineto +275 263 lineto +closepath stroke +0 0 0 nodecolor +14 /Times-Roman set_font +191 277.3 moveto 76 (tests running?) alignedtext +grestore +% http:transport-keep-running->tests running? +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 235.06 335.81 moveto +234.16 327.79 233.06 318.05 232.05 309.07 curveto +stroke +0 0 0 edgecolor +newpath 235.52 308.57 moveto +230.92 299.03 lineto +228.56 309.36 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 235.52 308.57 moveto +230.92 299.03 lineto +228.56 309.36 lineto +closepath stroke +grestore +% tests running?->client:login +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 229 262.8 moveto +229 251.16 229 235.55 229 222.24 curveto +stroke +0 0 0 edgecolor +newpath 232.5 222.18 moveto +229 212.18 lineto +225.5 222.18 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 232.5 222.18 moveto +229 212.18 lineto +225.5 222.18 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +229 233.8 moveto 19 (yes) alignedtext +grestore +% tests running?->server:shutdown +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 206.39 262.81 moveto +192.11 250.45 174.91 232.41 167 212 curveto +157.35 187.09 162.73 156.51 169.07 134.98 curveto +stroke +0 0 0 edgecolor +newpath 172.49 135.79 moveto +172.2 125.2 lineto +165.82 133.66 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 172.49 135.79 moveto +172.2 125.2 lineto +165.82 133.66 lineto +closepath stroke +0 0 0 edgecolor +14 /Times-Roman set_font +167 190.3 moveto 14 (no) alignedtext +grestore +% delay_5s->http:transport-keep-running +gsave +1 setlinewidth +0 0 0 edgecolor +newpath 301.19 125.27 moveto +305.18 130.56 308.91 136.68 311 143 curveto +333.1 209.8 314.78 235.72 284 299 curveto +278.84 309.61 271.04 319.78 263.27 328.37 curveto +stroke +0 0 0 edgecolor +newpath 260.58 326.13 moveto +256.22 335.79 lineto +265.65 330.95 lineto +closepath fill +1 setlinewidth +solid +0 0 0 edgecolor +newpath 260.58 326.13 moveto +256.22 335.79 lineto +265.65 330.95 lineto +closepath stroke +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 502 935 +end +restore +%%EOF ADDED launch.scm-baseline Index: launch.scm-baseline ================================================================== --- /dev/null +++ launch.scm-baseline @@ -0,0 +1,969 @@ + +;; Copyright 2006-2013, Matthew Welland. +;; +;; This program is made available under the GNU GPL version 2.0 or +;; greater. See the accompanying file COPYING for details. +;; +;; This program is distributed WITHOUT ANY WARRANTY; without even the +;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. + +;;====================================================================== +;; launch a task - this runs on the originating host, tests themselves +;; +;;====================================================================== + +(use regex regex-case base64 sqlite3 srfi-18 directory-utils posix-extras z3 call-with-environment-variables) + +(import (prefix base64 base64:)) +(import (prefix sqlite3 sqlite3:)) + +(declare (unit launch)) +(declare (uses common)) +(declare (uses configf)) +(declare (uses db)) +;; (declare (uses sdb)) +(declare (uses tdb)) +;; (declare (uses filedb)) + +(include "common_records.scm") +(include "key_records.scm") +(include "db_records.scm") + +;;====================================================================== +;; ezsteps +;;====================================================================== + +;; ezsteps were going to be coded as +;; stepname[,predstep1,predstep2 ...] [{VAR1=first,second,third}] command to execute +;; BUT +;; now are +;; stepname {VAR=first,second,third ...} command ... +;; where the {VAR=first,second,third ...} is optional. + +;; given an exit code and whether or not logpro was used calculate OK/BAD +;; return #t if we are ok, #f otherwise +(define (steprun-good? logpro exitcode) + (or (eq? exitcode 0) + (and logpro (eq? exitcode 2)))) + +;; if handed a string, process it, else look for MT_CMDINFO +(define (launch:get-cmdinfo-assoc-list #!key (encoded-cmd #f)) + (let ((enccmd (if encoded-cmd encoded-cmd (getenv "MT_CMDINFO")))) + (if enccmd + (common:read-encoded-string enccmd) + '()))) + + +(define (launch:runstep ezstep run-id test-id exit-info m tal) + (let* ((stepname (car ezstep)) ;; do stuff to run the step + (stepinfo (cadr ezstep)) + (stepparts (string-match (regexp "^(\\{([^\\}]*)\\}\\s*|)(.*)$") stepinfo)) + (stepparms (list-ref stepparts 2)) ;; for future use, {VAR=1,2,3}, run step for each + (stepcmd (list-ref stepparts 3)) + (script "") ; "#!/bin/bash\n") ;; yep, we depend on bin/bash FIXME!!!\ + (logpro-file (conc stepname ".logpro")) + (html-file (conc stepname ".html")) + (logpro-used (file-exists? logpro-file))) + ;; NB// can safely assume we are in test-area directory + (debug:print 4 "ezsteps:\n stepname: " stepname " stepinfo: " stepinfo " stepparts: " stepparts + " stepparms: " stepparms " stepcmd: " stepcmd) + + ;; ;; first source the previous environment + ;; (let ((prev-env (conc ".ezsteps/" prevstep (if (string-search (regexp "csh") + ;; (get-environment-variable "SHELL")) ".csh" ".sh")))) + ;; (if (and prevstep (file-exists? prev-env)) + ;; (set! script (conc script "source " prev-env)))) + + ;; call the command using mt_ezstep + ;; (set! script (conc "mt_ezstep " stepname " " (if prevstep prevstep "x") " " stepcmd)) + + (debug:print 4 "script: " script) + (rmt:teststep-set-status! run-id test-id stepname "start" "-" #f #f area-dat) + ;; now launch the actual process + (call-with-environment-variables + (list (cons "PATH" (conc (get-environment-variable "PATH") ":."))) + (lambda () + (let* ((cmd (conc stepcmd " > " stepname ".log")) + (pid (process-run cmd))) + (rmt:test-set-top-process-pid run-id test-id pid area-dat) + (let processloop ((i 0)) + (let-values (((pid-val exit-status exit-code)(process-wait pid #t))) + (mutex-lock! m) + (vector-set! exit-info 0 pid) + (vector-set! exit-info 1 exit-status) + (vector-set! exit-info 2 exit-code) + (mutex-unlock! m) + (if (eq? pid-val 0) + (begin + (thread-sleep! 2) + (processloop (+ i 1)))) + ))))) + (debug:print-info 0 "step " stepname " completed with exit code " (vector-ref exit-info 2)) + ;; now run logpro if needed + (if logpro-used + (let ((pid (process-run (conc "logpro " logpro-file " " (conc stepname ".html") " < " stepname ".log")))) + (let processloop ((i 0)) + (let-values (((pid-val exit-status exit-code)(process-wait pid #t))) + (mutex-lock! m) + (vector-set! exit-info 0 pid) + (vector-set! exit-info 1 exit-status) + (vector-set! exit-info 2 exit-code) + (mutex-unlock! m) + (if (eq? pid-val 0) + (begin + (thread-sleep! 2) + (processloop (+ i 1))))) + (debug:print-info 0 "logpro for step " stepname " exited with code " (vector-ref exit-info 2))))) + + (let ((exinfo (vector-ref exit-info 2)) + (logfna (if logpro-used (conc stepname ".html") ""))) + (rmt:teststep-set-status! run-id test-id stepname "end" exinfo #f logfna area-dat)) + (if logpro-used + (rmt:test-set-log! run-id test-id (conc stepname ".html") area-dat)) + ;; set the test final status + (let* ((this-step-status (cond + ((and (eq? (vector-ref exit-info 2) 2) logpro-used) 'warn) + ((eq? (vector-ref exit-info 2) 0) 'pass) + (else 'fail))) + (overall-status (cond + ((eq? (vector-ref exit-info 3) 2) 'warn) ;; rollup-status + ((eq? (vector-ref exit-info 3) 0) 'pass) + (else 'fail))) + (next-status (cond + ((eq? overall-status 'pass) this-step-status) + ((eq? overall-status 'warn) + (if (eq? this-step-status 'fail) 'fail 'warn)) + (else 'fail))) + (next-state ;; "RUNNING") ;; WHY WAS THIS CHANGED TO NOT USE (null? tal) ?? + (cond + ((null? tal) ;; more to run? + "COMPLETED") + (else "RUNNING"))) + ) + (debug:print 4 "Exit value received: " (vector-ref exit-info 2) " logpro-used: " logpro-used + " this-step-status: " this-step-status " overall-status: " overall-status + " next-status: " next-status " rollup-status: " (vector-ref exit-info 3)) + (case next-status + ((warn) + (vector-set! exit-info 3 2) ;; rollup-status + ;; NB// test-set-status! does rdb calls under the hood + (tests:test-set-status! run-id test-id next-state "WARN" + (if (eq? this-step-status 'warn) "Logpro warning found" #f) + #f)) + ((pass) + (tests:test-set-status! run-id test-id next-state "PASS" #f #f)) + (else ;; 'fail + (vector-set! exit-info 3 1) ;; force fail, this used to be next-state but that doesn't make sense. should always be "COMPLETED" + (tests:test-set-status! run-id test-id "COMPLETED" "FAIL" (conc "Failed at step " stepname) #f) + ))) + logpro-used)) + +(define (launch:execute encoded-cmd area-dat) + (let* ((cmdinfo (common:read-encoded-string encoded-cmd))) + (setenv "MT_CMDINFO" encoded-cmd) + (if (list? cmdinfo) ;; ((testpath /tmp/mrwellan/jazzmind/src/example_run/tests/sqlitespeed) + ;; (test-name sqlitespeed) (runscript runscript.rb) (db-host localhost) (run-id 1)) + (let* ((testpath (assoc/default 'testpath cmdinfo)) ;; testpath is the test spec area + (top-path (assoc/default 'toppath cmdinfo)) + (work-area (assoc/default 'work-area cmdinfo)) ;; work-area is the test run area + (test-name (assoc/default 'test-name cmdinfo)) + (runscript (assoc/default 'runscript cmdinfo)) + (ezsteps (assoc/default 'ezsteps cmdinfo)) + ;; (runremote (assoc/default 'runremote cmdinfo)) + (transport (assoc/default 'transport cmdinfo)) + ;; (serverinf (assoc/default 'serverinf cmdinfo)) + (port (assoc/default 'port cmdinfo)) + (run-id (assoc/default 'run-id cmdinfo)) + (test-id (assoc/default 'test-id cmdinfo)) + (target (assoc/default 'target cmdinfo)) + (itemdat (assoc/default 'itemdat cmdinfo)) + (env-ovrd (assoc/default 'env-ovrd cmdinfo)) + (set-vars (assoc/default 'set-vars cmdinfo)) ;; pre-overrides from -setvar + (runname (assoc/default 'runname cmdinfo)) + (megatest (assoc/default 'megatest cmdinfo)) + (runtlim (assoc/default 'runtlim cmdinfo)) + (item-path (item-list->path itemdat)) + (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo)) + (keys #f) + (keyvals #f) + (fullrunscript (if (not runscript) + #f + (if (substring-index "/" runscript) + runscript ;; use unadultered if contains slashes + (let ((fulln (conc testpath "/" runscript))) + (if (and (file-exists? fulln) + (file-execute-access? fulln)) + fulln + runscript))))) ;; assume it is on the path + ;; (rollup-status 0) + ) + (change-directory top-path) + + ;; (set-signal-handler! signal/int (lambda () + + ;; Do not run the test if it is REMOVING, RUNNING, KILLREQ or REMOTEHOSTSTART, + ;; Mark the test as REMOTEHOSTSTART *IMMEDIATELY* + ;; + (let ((test-info (rmt:get-testinfo-state-status run-id test-id area-dat))) + (if (not (member (db:test-get-state test-info) '("REMOVING" "REMOTEHOSTSTART" "RUNNING" "KILLREQ"))) + (tests:test-force-state-status! run-id test-id "REMOTEHOSTSTART" "n/a") + (begin + (debug:print 0 "ERROR: test state is " (db:test-get-state test-info) ", cannot proceed") + (exit)))) + + (debug:print 2 "Exectuing " test-name " (id: " test-id ") on " (get-host-name)) + (set! keys (rmt:get-keys area-dat)) + ;; (runs:set-megatest-env-vars run-id area-dat inkeys: keys inkeyvals: keyvals) ;; these may be needed by the launching process + ;; one of these is defunct/redundant ... + (if (not (launch:setup-for-run area-dat force: #t)) + (begin + (debug:print 0 "Failed to setup, exiting") + ;; (sqlite3:finalize! db) + ;; (sqlite3:finalize! tdb) + (exit 1))) + (change-directory toppath) + + ;; NOTE: Current order is to process runconfigs *before* setting the MT_ vars. This + ;; seems non-ideal but could well break stuff + ;; BUG? BUG? BUG? + + (let ((rconfig (full-runconfigs-read))) ;; (read-config (conc toppath "/runconfigs.config") #f #t sections: (list "default" target)))) + ;; (setup-env-defaults (conc toppath "/runconfigs.config") run-id (make-hash-table) keyvals target) + ;; (set-run-config-vars run-id keyvals target) ;; (db:get-target db run-id)) + ;; Now have runconfigs data loaded, set environment vars + (for-each (lambda (section) + (for-each (lambda (varval) + (let ((var (car varval)) + (val (cadr varval))) + (if (and (string? var)(string? val)) + (begin + (setenv var (config:eval-string-in-environment val))) ;; val) + (debug:print 0 "ERROR: bad variable spec, " var "=" val)))) + (configf:get-section rconfig section))) + (list "default" target))) + (change-directory work-area) + (set! keyvals (keys:target->keyval keys target)) + ;; apply pre-overrides before other variables. The pre-override vars must not + ;; clobbers things from the official sources such as megatest.config and runconfigs.config + (if (string? set-vars) + (let ((varpairs (string-split set-vars ","))) + (debug:print 4 "varpairs: " varpairs) + (map (lambda (varpair) + (let ((varval (string-split varpair "="))) + (if (eq? (length varval) 2) + (let ((var (car varval)) + (val (cadr varval))) + (debug:print 1 "Adding pre-var/val " var " = " val " to the environment") + (setenv var val))))) + varpairs))) + (for-each + (lambda (varval) + (let ((var (car varval)) + (val (cadr varval))) + (if val + (setenv var val) + (begin + (debug:print 0 "ERROR: required variable " var " does not have a valid value. Exiting") + (exit))))) + (list + (list "MT_TEST_RUN_DIR" work-area) + (list "MT_TEST_NAME" test-name) + (list "MT_ITEM_INFO" (conc itemdat)) + (list "MT_ITEMPATH" item-path) + (list "MT_RUNNAME" runname) + (list "MT_MEGATEST" megatest) + (list "MT_TARGET" target) + (list "MT_LINKTREE" (configf:lookup (megatest:area-configdat area-dat) "setup" "linktree")) + (list "MT_TESTSUITENAME" (common:get-testsuite-name)))) + + (if mt-bindir-path (setenv "PATH" (conc (getenv "PATH") ":" mt-bindir-path))) + ;; (change-directory top-path) + ;; Can setup as client for server mode now + ;; (client:setup) + + + ;; environment overrides are done *before* the remaining critical envars. + (alist->env-vars env-ovrd) + (runs:set-megatest-env-vars run-id area-dat inkeys: keys inkeyvals: keyvals) + (set-item-env-vars itemdat) + (save-environment-as-files "megatest") + ;; open-run-close not needed for test-set-meta-info + ;; (tests:set-full-meta-info #f test-id run-id 0 work-area) + ;; (tests:set-full-meta-info test-id run-id 0 work-area) + (tests:set-full-meta-info #f test-id run-id 0 work-area 10) + + (thread-sleep! 0.3) ;; NFS slowness has caused grief here + + (if (args:get-arg "-xterm") + (set! fullrunscript "xterm") + (if (and fullrunscript (not (file-execute-access? fullrunscript))) + (system (conc "chmod ug+x " fullrunscript)))) + ;; We are about to actually kick off the test + ;; so this is a good place to remove the records for + ;; any previous runs + ;; (db:test-remove-steps db run-id testname itemdat) + + (let* ((m (make-mutex)) + (kill-job? #f) + (exit-info (vector #t #t #t 0)) + (job-thread #f) + (keep-going #t) + (runit (lambda () + ;; (let-values + ;; (((pid exit-status exit-code) + ;; (run-n-wait fullrunscript))) + ;; (tests:test-set-status! test-id "RUNNING" "n/a" #f #f) + ;; Since we should have a clean slate at this time there is no need to do + ;; any of the other stuff that tests:test-set-status! does. Let's just + ;; force RUNNING/n/a + + + ;; (thread-sleep! 0.3) + (tests:test-force-state-status! run-id test-id "RUNNING" "n/a") + (rmt:roll-up-pass-fail-counts run-id test-name item-path "RUNNING" area-dat) + ;; (thread-sleep! 0.3) ;; NFS slowness has caused grief here + + ;; if there is a runscript do it first + (if fullrunscript + (let ((pid (process-run fullrunscript))) + (rmt:test-set-top-process-pid run-id test-id pid area-dat) + (let loop ((i 0)) + (let-values + (((pid-val exit-status exit-code) (process-wait pid #t))) + (mutex-lock! m) + (vector-set! exit-info 0 pid) + (vector-set! exit-info 1 exit-status) + (vector-set! exit-info 2 exit-code) + (vector-set! exit-info 3 exit-code) ;; rollup status + (mutex-unlock! m) + (if (eq? pid-val 0) + (begin + (thread-sleep! 2) + (loop (+ i 1))) + ))))) + ;; then, if runscript ran ok (or did not get called) + ;; do all the ezsteps (if any) + (if ezsteps + (let* ((testconfig (read-config (conc work-area "/testconfig") #f #t environ-patt: "pre-launch-env-vars")) ;; FIXME??? is allow-system ok here? + (ezstepslst (hash-table-ref/default testconfig "ezsteps" '()))) + (hash-table-set! *testconfigs* test-name testconfig) ;; cached for lazy reads later ... + (if (not (file-exists? ".ezsteps"))(create-directory ".ezsteps")) + ;; if ezsteps was defined then we are sure to have at least one step but check anyway + (if (not (> (length ezstepslst) 0)) + (debug:print 0 "ERROR: ezsteps defined but ezstepslst is zero length") + (let loop ((ezstep (car ezstepslst)) + (tal (cdr ezstepslst)) + (prevstep #f)) + ;; check exit-info (vector-ref exit-info 1) + (if (vector-ref exit-info 1) + (let ((logpro-used (launch:runstep ezstep run-id test-id exit-info m tal))) + (if (and (steprun-good? logpro-used (vector-ref exit-info 2)) + (not (null? tal))) + (loop (car tal) (cdr tal) stepname))) + (debug:print 4 "WARNING: a prior step failed, stopping at " ezstep)))))))) + (monitorjob (lambda () + (let* ((start-seconds (current-seconds)) + (calc-minutes (lambda () + (inexact->exact + (round + (- + (current-seconds) + start-seconds))))) + (kill-tries 0)) + ;; (tests:set-full-meta-info #f test-id run-id (calc-minutes) work-area) + ;; (tests:set-full-meta-info test-id run-id (calc-minutes) work-area) + (tests:set-full-meta-info #f test-id run-id (calc-minutes) work-area 10) + (let loop ((minutes (calc-minutes))) + (begin + (set! kill-job? (or (test-get-kill-request run-id test-id) ;; run-id test-name itemdat)) + (and runtlim (let* ((run-seconds (- (current-seconds) start-seconds)) + (time-exceeded (> run-seconds runtlim))) + (if time-exceeded + (begin + (debug:print-info 0 "KILLING TEST DUE TO TIME LIMIT EXCEEDED! Runtime=" run-seconds " seconds, limit=" runtlim) + #t) + #f))))) + (tests:update-central-meta-info run-id test-id (get-cpu-load) (get-df (current-directory))(calc-minutes) #f #f) + (if kill-job? + (begin + (mutex-lock! m) + ;; NOTE: The pid can change as different steps are run. Do we need handshaking between this + ;; section and the runit section? Or add a loop that tries three times with a 1/4 second + ;; between tries? + (let* ((pid1 (vector-ref exit-info 0)) + (pid2 (rmt:test-get-top-process-pid run-id test-id area-dat)) + (pids (delete-duplicates (filter number? (list pid1 pid2))))) + (if (not (null? pids)) + (begin + (for-each + (lambda (pid) + (handle-exceptions + exn + (begin + (debug:print-info 0 "Unable to kill process with pid " pid ", possibly already killed.") + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn))) + (debug:print 0 "WARNING: Request received to kill job " pid) ;; " (attempt # " kill-tries ")") + (debug:print-info 0 "Signal mask=" (signal-mask)) + ;; (if (process:alive? pid) + ;; (begin + (map (lambda (pid-num) + (process-signal pid-num signal/term)) + (process:get-sub-pids pid)) + (thread-sleep! 5) + ;; (if (process:process-alive? pid) + (map (lambda (pid-num) + (handle-exceptions + exn + #f + (process-signal pid-num signal/kill))) + (process:get-sub-pids pid)))) + ;; (debug:print-info 0 "not killing process " pid " as it is not alive")))) + pids) + (tests:test-set-status! run-id test-id "KILLED" "KILLED" (args:get-arg "-m") #f)) + (begin + (debug:print 0 "ERROR: Nothing to kill, pid1=" pid1 ", pid2=" pid2) + (tests:test-set-status! run-id test-id "KILLED" "FAILED TO KILL" (args:get-arg "-m") #f) + ))) + (mutex-unlock! m) + ;; no point in sticking around. Exit now. + (exit))) + (if keep-going + (begin + (thread-sleep! 3) ;; (+ 3 (random 6))) ;; add some jitter to the call home time to spread out the db accesses + (if keep-going + (loop (calc-minutes))))))) + (tests:update-central-meta-info run-id test-id (get-cpu-load) (get-df (current-directory))(calc-minutes) #f #f)))) ;; NOTE: Checking twice for keep-going is intentional + (th1 (make-thread monitorjob "monitor job")) + (th2 (make-thread runit "run job"))) + (set! job-thread th2) + (thread-start! th1) + (thread-start! th2) + (thread-join! th2) + (debug:print-info 0 "Megatest exectute of test " test-name ", item path " item-path " complete. Notifying the db ...") + (set! keep-going #f) + (thread-join! th1) + (thread-sleep! 1) ;; give thread th1 a chance to be done TODO: Verify this is needed. At 0.1 I was getting fail to stop, increased to total of 1.1 sec. + (mutex-lock! m) + (let* ((item-path (item-list->path itemdat)) + ;; only state and status needed - use lazy routine + (testinfo (rmt:get-testinfo-state-status run-id test-id area-dat))) + ;; Am I completed? + (if (member (db:test-get-state testinfo) '("REMOTEHOSTSTART" "RUNNING")) ;; NOTE: It should *not* be REMOTEHOSTSTART but for reasons I don't yet understand it sometimes gets stuck in that state ;; (not (equal? (db:test-get-state testinfo) "COMPLETED")) + (let ((new-state (if kill-job? "KILLED" "COMPLETED") ;; (if (eq? (vector-ref exit-info 2) 0) ;; exited with "good" status + ;; "COMPLETED" + ;; (db:test-get-state testinfo))) ;; else preseve the state as set within the test + ) + (new-status (cond + ((not (vector-ref exit-info 1)) "FAIL") ;; job failed to run + ((eq? (vector-ref exit-info 3) 0) + ;; if the current status is AUTO then defer to the calculated value (i.e. leave this AUTO) + (if (equal? (db:test-get-status testinfo) "AUTO") "AUTO" "PASS")) + ((eq? (vector-ref exit-info 3) 1) "FAIL") + ((eq? (vector-ref exit-info 3) 2) + ;; if the current status is AUTO the defer to the calculated value but qualify (i.e. make this AUTO-WARN) + (if (equal? (db:test-get-status testinfo) "AUTO") "AUTO-WARN" "WARN")) + (else "FAIL")))) ;; (db:test-get-status testinfo))) + (debug:print-info 1 "Test exited in state=" (db:test-get-state testinfo) ", setting state/status based on exit code of " (vector-ref exit-info 1) " and rollup-status of " (vector-ref exit-info 3)) + (tests:test-set-status! run-id + test-id + new-state + new-status + (args:get-arg "-m") #f) + ;; need to update the top test record if PASS or FAIL and this is a subtest + ;; NO NEED TO CALL roll-up-pass-fail-counts HERE, THIS IS DONE IN roll-up-pass-fail-counts called by tests:test-set-status! + )) + ;; for automated creation of the rollup html file this is a good place... + ;; (if (and (not (equal? item-path "")) + ;; (< (random (rmt:get-count-tests-running-for-testname run-id test-name)) 5)) + (tests:summarize-items run-id test-id test-name #f) + (tests:summarize-test run-id test-id)) ;; don't force - just update if no + (mutex-unlock! m) + (debug:print 2 "Output from running " fullrunscript ", pid " (vector-ref exit-info 0) " in work area " + work-area ":\n====\n exit code " (vector-ref exit-info 2) "\n" "====\n") + (if (not (vector-ref exit-info 1)) + (exit 4))))))) + +(define (launch:read-cached-config) + (if (get-environment-variable "MT_CMDINFO") ;; we are inside a test - do not reprocess configs + (let ((alistconfig (conc (get-environment-variable "MT_LINKTREE") "/" + (get-environment-variable "MT_TARGET") "/" + (get-environment-variable "MT_RUNNAME") "/" + ".megatest.cfg"))) + (if (file-exists? alistconfig) + (list (configf:read-alist alistconfig) + (get-environment-variable "MT_RUN_AREA_HOME")) + #f)) + #f)) + +(define (launch:read-megatest-config toppath) + (let ((runname (or (args:get-arg "-runname")(args:get-arg ":runname")))) + (if runname (setenv "MT_RUNNAME" runname)) + (find-and-read-config + (if (args:get-arg "-config")(args:get-arg "-config") "megatest.config") + environ-patt: "env-override" + given-toppath: (get-environment-variable "MT_RUN_AREA_HOME") + pathenvvar: "MT_RUN_AREA_HOME"))) + +;; set up the very basics needed for doing anything here. +(define (launch:setup-for-run area-dat #!key (force #f)) + ;; would set values for KEYS in the environment here for better support of env-override but + ;; have chicken/egg scenario. need to read megatest.config then read it again. Going to + ;; pass on that idea for now + ;; special case + (let ((configdat (megatest:area-configdat area-dat))) + (if (or force (not (hash-table? configdat))) ;; no need to re-open on every call + (let* ((newconfiginfo (or (launch:read-cached-config) ;; no config cached - give up + (launch:read-megatest-config (megatest:area-path area-dat)))) + (configdat (car newconfiginfo)) + (toppath (cadr newconfiginfo))) + (megatest:area-configinfo-set! area-dat newconfiginfo) + (megatest:area-configdat-set! area-dat configdat) + (megatest:area-path-set! area-dat toppath) + (let* ((tmptransport (configf:lookup configdat "server" "transport")) + (transport (if tmptransport (string->symbol tmptransport) 'http))) + (if (member transport '(http rpc nmsg)) + (megatest:area-transport-set! area-dat transport) + (begin + (debug:print 0 "ERROR: Unrecognised transport " transport) + (exit)))) + (let ((linktree (configf:lookup configdat "setup" "linktree"))) ;; link tree is critical + (if linktree + (if (not (file-exists? linktree)) + (begin + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Something went wrong when trying to create linktree dir at " linktree) + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) + (exit 1)) + (create-directory linktree #t)))) + (begin + (debug:print 0 "ERROR: linktree not defined in [setup] section of megatest.config") + (exit 1))) + (if linktree + (let ((dbdir (conc linktree "/.db"))) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: failed to create the " dbdir " area for your database files") + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn))) + (if (not (directory-exists? dbdir))(create-directory dbdir))) + (setenv "MT_LINKTREE" linktree)) + (begin + (debug:print 0 "ERROR: linktree is required in your megatest.config [setup] section") + (exit 1))) + (if (and toppath + (directory-exists? toppath)) + (setenv "MT_RUN_AREA_HOME" toppath) + (begin + (debug:print 0 "ERROR: failed to find the top path to your Megatest area.") + (exit 1)))) + toppath)))) + +(define (launch:cache-config area-dat) + ;; if we have a linktree and -runtests and -target and the directory exists dump the config + ;; to megatest-(current-seconds).cfg and symlink it to megatest.cfg + (let ((configdat (megatest:area-configdat area-dat))) + (if (and configdat + (args:get-arg "-runtests")) + (let* ((linktree (get-environment-variable "MT_LINKTREE")) + (target (common:args-get-target)) + (runname (or (args:get-arg "-runname") + (args:get-arg ":runname"))) + (fulldir (conc linktree "/" + target "/" + runname))) + (debug:print-info 0 "Have -runtests with target=" target ", runname=" runname ", fulldir=" fulldir) + (if (file-exists? linktree) ;; can't proceed without linktree + (begin + (if (not (file-exists? fulldir)) + (create-directory fulldir #t)) ;; need to protect with exception handler + (if (and target + runname + (file-exists? fulldir)) + (let ((tmpfile (conc fulldir "/.megatest.cfg." (current-seconds))) + (targfile (conc fulldir "/.megatest.cfg"))) + (debug:print-info 0 "Caching megatest.config in " fulldir "/.megatest.cfg") + (configf:write-alist configdat tmpfile) + (system (conc "ln -sf " tmpfile " " targfile)) + )))))))) + +(define (get-best-disk confdat) + (let* ((disks (hash-table-ref/default confdat "disks" #f)) + (minspace (let ((m (configf:lookup confdat "setup" "minspace"))) + (string->number (or m "10000"))))) + (if disks + (let ((res (common:get-disk-with-most-free-space disks minspace))) ;; min size of 1000, seems tad dumb + (if res + (cdr res) + (begin + (if (common:low-noise-print 20 "no valid disks") + (debug:print 0 "ERROR: No valid disks found in megatest.config. Please add some to your [disks] section and ensure the directory exists!")) + (exit 1))))))) + +;; Desired directory structure: +;; +;; - - -. +;; | +;; v +;; - - -|- +;; +;; dir stored in test is: +;; +;; - - [ - ] +;; +;; All log file links should be stored relative to the top of link path +;; +;; - [ - ] +;; +(define (create-work-area run-id run-info keyvals test-id test-src-path disk-path testname itemdat area-dat #!key (remtries 2)) + (let* ((configdat (megatest:area-configdat area-dat)) + (item-path (if (string? itemdat) itemdat (item-list->path itemdat))) ;; if pass in string - just use it + (runname (if (string? run-info) ;; if we pass in a string as run-info use it as run-name. + run-info + (db:get-value-by-header (db:get-rows run-info) + (db:get-header run-info) + "runname"))) + ;; convert back to db: from rdb: - this is always run at server end + (target (string-intersperse (map cadr keyvals) "/")) + + (not-iterated (equal? "" item-path)) + + ;; all tests are found at /test-base or /test-base + (testtop-base (conc target "/" runname "/" testname)) + (test-base (conc testtop-base (if not-iterated "" "/") item-path)) + + ;; nb// if itempath is not "" then it is prefixed with "/" + (toptest-path (conc disk-path "/" testtop-base)) + (test-path (conc disk-path "/" test-base)) + + ;; ensure this exists first as links to subtests must be created there + (linktree (let ((rd (config-lookup configdat "setup" "linktree"))) + (if rd rd (conc (megatest:area-path area-dat) "/runs")))) + + (lnkbase (conc linktree "/" target "/" runname)) + (lnkpath (conc lnkbase "/" testname)) + (lnkpathf (conc lnkpath (if not-iterated "" "/") item-path)) + (lnktarget (conc lnkpath "/" item-path))) + + ;; Update the rundir path in the test record for all, rundir=physical, shortdir=logical + ;; rundir shortdir + (rmt:general-call 'test-set-rundir-shortdir run-id lnkpathf test-path testname item-path area-dat) + + (debug:print 2 "INFO:\n lnkbase=" lnkbase "\n lnkpath=" lnkpath "\n toptest-path=" toptest-path "\n test-path=" test-path) + (if (not (file-exists? linktree)) + (begin + (debug:print 0 "WARNING: linktree did not exist! Creating it now at " linktree) + (create-directory linktree #t))) ;; (system (conc "mkdir -p " linktree)))) + ;; create the directory for the tests dir links, this is needed no matter what... + (if (and (not (directory-exists? lnkbase)) + (not (file-exists? lnkbase))) + (handle-exceptions + exn + (begin + (debug:print "ERROR: Problem creating linktree base at " lnkbase) + (print-error-message exn (current-error-port))) + (create-directory lnkbase #t))) + + ;; update the toptest record with its location rundir, cache the path + ;; This wass highly inefficient, one db write for every subtest, potentially + ;; thousands of unnecessary updates, cache the fact it was set and don't set it + ;; again. + + ;; Now create the link from the test path to the link tree, however + ;; if the test is iterated it is necessary to create the parent path + ;; to the iteration. use pathname-directory to trim the path by one + ;; level + (if (not not-iterated) ;; i.e. iterated + (let ((iterated-parent (pathname-directory (conc lnkpath "/" item-path)))) + (debug:print-info 2 "Creating iterated parent " iterated-parent) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create directory " iterated-parent ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-directory iterated-parent #t)))) + + (if (symbolic-link? lnkpath) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to remove symlink " lnkpath ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (delete-file lnkpath))) + + (if (not (or (file-exists? lnkpath) + (symbolic-link? lnkpath))) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create symlink " lnkpath ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-symbolic-link toptest-path lnkpath))) + + ;; NB - This was not working right - some top tests are not getting the path set!!! + ;; + ;; Do the setting of this record after the paths are created so that the shortdir can + ;; be set to the real directory location. This is safer for future clean up if the link + ;; tree is damaged or lost. + ;; + (if (not (hash-table-ref/default *toptest-paths* testname #f)) + (let* ((testinfo (rmt:get-test-info-by-id run-id test-id area-dat)) ;; run-id testname item-path)) + (curr-test-path (if testinfo ;; (filedb:get-path *fdb* + ;; (db:get-path dbstruct + ;; (rmt:sdb-qry 'getstr + (db:test-get-rundir testinfo) ;; ) ;; ) + #f))) + (hash-table-set! *toptest-paths* testname curr-test-path) + ;; NB// Was this for the test or for the parent in an iterated test? + (rmt:general-call 'test-set-rundir-shortdir run-id lnkpath + (if (file-exists? lnkpath) + (resolve-pathname lnkpath) + lnkpath) + testname "" area-dat) + ;; (rmt:general-call 'test-set-rundir run-id lnkpath testname "") ;; toptest-path) + (if (or (not curr-test-path) + (not (directory-exists? toptest-path))) + (begin + (debug:print-info 2 "Creating " toptest-path " and link " lnkpath) + (handle-exceptions + exn + #f ;; don't care to catch and deal with errors here for now. + (create-directory toptest-path #t)) + (hash-table-set! *toptest-paths* testname toptest-path))))) + + ;; The toptest path has been created, the link to the test in the linktree has + ;; been created. Now, if this is an iterated test the real test dir must be created + (if (not not-iterated) ;; this is an iterated test + (begin ;; (let ((lnktarget (conc lnkpath "/" item-path))) + (debug:print 2 "Setting up sub test run area") + (debug:print 2 " - creating run area in " test-path) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create directory " test-path ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-directory test-path #t)) + (debug:print 2 + " - creating link from: " test-path "\n" + " to: " lnktarget) + + ;; If there is already a symlink delete it and recreate it. + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to re-create link " lnktarget ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit)) + (if (symbolic-link? lnktarget) (delete-file lnktarget)) + (if (not (file-exists? lnktarget)) (create-symbolic-link test-path lnktarget))))) + + (if (not (directory? test-path)) + (create-directory test-path #t)) ;; this is a hack, I don't know why out of the blue this path does not exist sometimes + + (if (and test-src-path (directory? test-path)) + (begin + (let* ((ovrcmd (let ((cmd (config-lookup configdat "setup" "testcopycmd"))) + (if cmd + ;; substitute the TEST_SRC_PATH and TEST_TARG_PATH + (string-substitute "TEST_TARG_PATH" test-path + (string-substitute "TEST_SRC_PATH" test-src-path cmd #t) #t) + #f))) + (cmd (if ovrcmd + ovrcmd + (conc "rsync -av" (if (debug:debug-mode 1) "" "q") " " test-src-path "/ " test-path "/" + " >> " test-path "/mt_launch.log 2>> " test-path "/mt_launch.log"))) + (status (system cmd))) + (if (not (eq? status 0)) + (debug:print 2 "ERROR: problem with running \"" cmd "\""))) + (list lnkpathf lnkpath )) + (if (and test-src-path (> remtries 0)) + (begin + (debug:print 0 "ERROR: Failed to create work area at " test-path " with link at " lnktarget ", remaining attempts " remtries) + ;; + (create-work-area run-id run-info keyvals test-id test-src-path disk-path testname itemdat remtries: (- remtries 1))) + (list #f #f))))) + +;; 1. look though disks list for disk with most space +;; 2. create run dir on disk, path name is meaningful +;; 3. create link from run dir to megatest runs area +;; 4. remotely run the test on allocated host +;; - could be ssh to host from hosts table (update regularly with load) +;; - could be netbatch +;; (launch-test db (cadr status) test-conf)) +(define (launch-test test-id run-id run-info keyvals runname test-conf test-name test-path itemdat params area-dat) + (let ((toppath (megatest:area-path area-dat)) + (configdat (megatest:area-configdat area-dat))) + (change-directory toppath) + (alist->env-vars ;; consolidate this code with the code in megatest.scm for "-execute" + (list ;; (list "MT_TEST_RUN_DIR" work-area) + (list "MT_RUN_AREA_HOME" toppath) + (list "MT_TEST_NAME" test-name) + ;; (list "MT_ITEM_INFO" (conc itemdat)) + (list "MT_RUNNAME" runname) + ;; (list "MT_TARGET" mt_target) + )) + (let* ((useshell (let ((ush (config-lookup configdat "jobtools" "useshell"))) + (if ush + (if (equal? ush "no") ;; must use "no" to NOT use shell + #f + ush) + #t))) ;; default is yes + (launcher (config-lookup configdat "jobtools" "launcher")) + (runscript (config-lookup test-conf "setup" "runscript")) + (ezsteps (> (length (hash-table-ref/default test-conf "ezsteps" '())) 0)) ;; don't send all the steps, could be big + (diskspace (config-lookup test-conf "requirements" "diskspace")) + (memory (config-lookup test-conf "requirements" "memory")) + (hosts (config-lookup configdat "jobtools" "workhosts")) + (remote-megatest (config-lookup configdat "setup" "executable")) + (run-time-limit (or (configf:lookup test-conf "requirements" "runtimelim") + (configf:lookup configdat "setup" "runtimelim"))) + ;; FIXME SOMEDAY: not good how this is so obtuse, this hack is to + ;; allow running from dashboard. Extract the path + ;; from the called megatest and convert dashboard + ;; or dboard to megatest + (local-megatest (let* ((lm (car (argv))) + (dir (pathname-directory lm)) + (exe (pathname-strip-directory lm))) + (conc (if dir (conc dir "/") "") + (case (string->symbol exe) + ((dboard) "../megatest") + ((mtest) "../megatest") + ((dashboard) "megatest") + (else exe))))) + (item-path (item-list->path itemdat)) + (test-sig (conc test-name ":" item-path)) ;; (item-list->path itemdat))) ;; test-path is the full path including the item-path + (work-area #f) + (toptest-work-area #f) ;; for iterated tests the top test contains data relevant for all + (diskpath #f) + (cmdparms #f) + (fullcmd #f) ;; (define a (with-output-to-string (lambda ()(write x)))) + (mt-bindir-path #f) + (testinfo (rmt:get-test-info-by-id run-id test-id area-dat)) + (mt_target (string-intersperse (map cadr keyvals) "/")) + (debug-param (append (if (args:get-arg "-debug") (list "-debug" (args:get-arg "-debug")) '()) + (if (args:get-arg "-logging")(list "-logging") '())))) + (setenv "MT_ITEMPATH" item-path) + (if hosts (set! hosts (string-split hosts))) + ;; set the megatest to be called on the remote host + (if (not remote-megatest)(set! remote-megatest local-megatest)) ;; "megatest")) + (set! mt-bindir-path (pathname-directory remote-megatest)) + (if launcher (set! launcher (string-split launcher))) + ;; set up the run work area for this test + (if (and (args:get-arg "-preclean") ;; user has requested to preclean for this run + (not (member (db:test-get-rundir testinfo)(list "n/a" "/tmp/badname")))) ;; n/a is a placeholder and thus not a read dir + (begin + (debug:print-info 0 "attempting to preclean directory " (db:test-get-rundir testinfo) " for test " test-name "/" item-path) + (runs:remove-test-directory testinfo 'remove-data-only))) ;; remove data only, do not perturb the record + + ;; prevent overlapping actions - set to LAUNCHED as early as possible + ;; + (tests:test-set-status! run-id test-id "LAUNCHED" "n/a" #f #f) ;; (if launch-results launch-results "FAILED")) + (rmt:roll-up-pass-fail-counts run-id test-name item-path "LAUNCHED" area-dat) + (set! diskpath (get-best-disk configdat)) + (if diskpath + (let ((dat (create-work-area run-id run-info keyvals test-id test-path diskpath test-name itemdat))) + (set! work-area (car dat)) + (set! toptest-work-area (cadr dat)) + (debug:print-info 2 "Using work area " work-area)) + (begin + (set! work-area (conc test-path "/tmp_run")) + (create-directory work-area #t) + (debug:print 0 "WARNING: No disk work area specified - running in the test directory under tmp_run"))) + (set! cmdparms (base64:base64-encode + (z3:encode-buffer + (with-output-to-string + (lambda () ;; (list 'hosts hosts) + (write (list (list 'testpath test-path) + (list 'transport (conc (megatest:area-transport area-dat))) ;; + ;; (list 'serverinf *server-info*) + (list 'toppath toppath) + (list 'work-area work-area) + (list 'test-name test-name) + (list 'runscript runscript) + (list 'run-id run-id ) + (list 'test-id test-id ) + ;; (list 'item-path item-path ) + (list 'itemdat itemdat ) + (list 'megatest remote-megatest) + (list 'ezsteps ezsteps) + (list 'target mt_target) + (list 'runtlim (if run-time-limit (common:hms-string->seconds run-time-limit) #f)) + (list 'env-ovrd (hash-table-ref/default configdat "env-override" '())) + (list 'set-vars (if params (hash-table-ref/default params "-setvars" #f))) + (list 'runname runname) + (list 'mt-bindir-path mt-bindir-path)))))))) + + ;; clean out step records from previous run if they exist + ;; (rmt:delete-test-step-records run-id test-id) + (change-directory work-area) ;; so that log files from the launch process don't clutter the test dir + (cond + ((and launcher hosts) ;; must be using ssh hostname + (set! fullcmd (append launcher (car hosts)(list remote-megatest test-sig "-execute" cmdparms) debug-param))) + ;; (set! fullcmd (append launcher (car hosts)(list remote-megatest test-sig "-execute" cmdparms)))) + (launcher + (set! fullcmd (append launcher (list remote-megatest test-sig "-execute" cmdparms) debug-param))) + ;; (set! fullcmd (append launcher (list remote-megatest test-sig "-execute" cmdparms)))) + (else + (if (not useshell)(debug:print 0 "WARNING: internal launching will not work well without \"useshell yes\" in your [jobtools] section")) + (set! fullcmd (append (list remote-megatest test-sig "-execute" cmdparms) debug-param (list (if useshell "&" "")))))) + ;; (set! fullcmd (list remote-megatest test-sig "-execute" cmdparms (if useshell "&" ""))))) + (if (args:get-arg "-xterm")(set! fullcmd (append fullcmd (list "-xterm")))) + (debug:print 1 "Launching " work-area) + ;; set pre-launch-env-vars before launching, keep the vars in prevvals and put the envionment back when done + (debug:print 4 "fullcmd: " fullcmd) + (let* ((commonprevvals (alist->env-vars + (hash-table-ref/default configdat "env-override" '()))) + (testprevvals (alist->env-vars + (hash-table-ref/default test-conf "pre-launch-env-overrides" '()))) + (miscprevvals (alist->env-vars ;; consolidate this code with the code in megatest.scm for "-execute" + (append (list (list "MT_TEST_RUN_DIR" work-area) + (list "MT_TEST_NAME" test-name) + (list "MT_ITEM_INFO" (conc itemdat)) + (list "MT_RUNNAME" runname) + (list "MT_TARGET" mt_target) + (list "MT_ITEMPATH" item-path) + ) + itemdat))) + ;; Launchwait defaults to true, must override it to turn off wait + (launchwait (if (equal? (configf:lookup configdat "setup" "launchwait") "no") #f #t)) + (launch-results (apply (if launchwait + cmd-run-with-stderr->list + process-run) + (if useshell + (let ((cmdstr (string-intersperse fullcmd " "))) + (if launchwait + cmdstr + (conc cmdstr " >> mt_launch.log 2>&1"))) + (car fullcmd)) + (if useshell + '() + (cdr fullcmd))))) + (if (not launchwait) ;; give the OS a little time to allow the process to start + (thread-sleep! 0.01)) + (with-output-to-file "mt_launch.log" + (lambda () + (if (list? launch-results) + (apply print launch-results) + (print "NOTE: launched \"" fullcmd "\"\n but did not wait for it to proceed. Add the following to megatest.config \n[setup]\nlaunchwait yes\n if you have problems with this")) + #:append)) + (debug:print 2 "Launching completed, updating db") + (debug:print 2 "Launch results: " launch-results) + (if (not launch-results) + (begin + (print "ERROR: Failed to run " (string-intersperse fullcmd " ") ", exiting now") + ;; (sqlite3:finalize! db) + ;; good ole "exit" seems not to work + ;; (_exit 9) + ;; but this hack will work! Thanks go to Alan Post of the Chicken email list + ;; NB// Is this still needed? Should be safe to go back to "exit" now? + (process-signal (current-process-id) signal/kill) + )) + (alist->env-vars miscprevvals) + (alist->env-vars testprevvals) + (alist->env-vars commonprevvals) + launch-results)) + (change-directory toppath)) + ;; added paren below after refactoring above routine. must have missed something? + ) + ADDED launch.scm-merge Index: launch.scm-merge ================================================================== --- /dev/null +++ launch.scm-merge @@ -0,0 +1,980 @@ + +;; Copyright 2006-2013, Matthew Welland. +;; +;; This program is made available under the GNU GPL version 2.0 or +;; greater. See the accompanying file COPYING for details. +;; +;; This program is distributed WITHOUT ANY WARRANTY; without even the +;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. + +;;====================================================================== +;; launch a task - this runs on the originating host, tests themselves +;; +;;====================================================================== + +(use regex regex-case base64 sqlite3 srfi-18 directory-utils posix-extras z3 call-with-environment-variables) + +(import (prefix base64 base64:)) +(import (prefix sqlite3 sqlite3:)) + +(declare (unit launch)) +(declare (uses common)) +(declare (uses configf)) +(declare (uses db)) +;; (declare (uses sdb)) +(declare (uses tdb)) +;; (declare (uses filedb)) + +(include "common_records.scm") +(include "key_records.scm") +(include "db_records.scm") + +;;====================================================================== +;; ezsteps +;;====================================================================== + +;; ezsteps were going to be coded as +;; stepname[,predstep1,predstep2 ...] [{VAR1=first,second,third}] command to execute +;; BUT +;; now are +;; stepname {VAR=first,second,third ...} command ... +;; where the {VAR=first,second,third ...} is optional. + +;; given an exit code and whether or not logpro was used calculate OK/BAD +;; return #t if we are ok, #f otherwise +(define (steprun-good? logpro exitcode) + (or (eq? exitcode 0) + (and logpro (eq? exitcode 2)))) + +;; if handed a string, process it, else look for MT_CMDINFO +(define (launch:get-cmdinfo-assoc-list #!key (encoded-cmd #f)) + (let ((enccmd (if encoded-cmd encoded-cmd (getenv "MT_CMDINFO")))) + (if enccmd + (common:read-encoded-string enccmd) + '()))) + + +(define (launch:runstep ezstep run-id test-id exit-info m tal) + (let* ((stepname (car ezstep)) ;; do stuff to run the step + (stepinfo (cadr ezstep)) + (stepparts (string-match (regexp "^(\\{([^\\}]*)\\}\\s*|)(.*)$") stepinfo)) + (stepparms (list-ref stepparts 2)) ;; for future use, {VAR=1,2,3}, run step for each + (stepcmd (list-ref stepparts 3)) + (script "") ; "#!/bin/bash\n") ;; yep, we depend on bin/bash FIXME!!!\ + (logpro-file (conc stepname ".logpro")) + (html-file (conc stepname ".html")) + (logpro-used (file-exists? logpro-file))) + ;; NB// can safely assume we are in test-area directory + (debug:print 4 "ezsteps:\n stepname: " stepname " stepinfo: " stepinfo " stepparts: " stepparts + " stepparms: " stepparms " stepcmd: " stepcmd) + + ;; ;; first source the previous environment + ;; (let ((prev-env (conc ".ezsteps/" prevstep (if (string-search (regexp "csh") + ;; (get-environment-variable "SHELL")) ".csh" ".sh")))) + ;; (if (and prevstep (file-exists? prev-env)) + ;; (set! script (conc script "source " prev-env)))) + + ;; call the command using mt_ezstep + ;; (set! script (conc "mt_ezstep " stepname " " (if prevstep prevstep "x") " " stepcmd)) + + (debug:print 4 "script: " script) + (rmt:teststep-set-status! run-id test-id stepname "start" "-" #f #f area-dat) + ;; now launch the actual process + (call-with-environment-variables + (list (cons "PATH" (conc (get-environment-variable "PATH") ":."))) + (lambda () ;; (process-run "/bin/bash" "-c" "exec ls -l /tmp/foobar > /tmp/delme-more.log 2>&1") + (let* ((cmd (conc "exec " stepcmd " > " stepname ".log 2>&1")) ;; >outfile 2>&1 + (pid (process-run "/bin/bash" (list "-c" cmd)))) + (rmt:test-set-top-process-pid run-id test-id pid area-dat) + (let processloop ((i 0)) + (let-values (((pid-val exit-status exit-code)(process-wait pid #t))) + (mutex-lock! m) + (vector-set! exit-info 0 pid) + (vector-set! exit-info 1 exit-status) + (vector-set! exit-info 2 exit-code) + (mutex-unlock! m) + (if (eq? pid-val 0) + (begin + (thread-sleep! 2) + (processloop (+ i 1)))) + ))))) + (debug:print-info 0 "step " stepname " completed with exit code " (vector-ref exit-info 2)) + ;; now run logpro if needed + (if logpro-used + (let ((pid (process-run (conc "logpro " logpro-file " " (conc stepname ".html") " < " stepname ".log")))) + (let processloop ((i 0)) + (let-values (((pid-val exit-status exit-code)(process-wait pid #t))) + (mutex-lock! m) + (vector-set! exit-info 0 pid) + (vector-set! exit-info 1 exit-status) + (vector-set! exit-info 2 exit-code) + (mutex-unlock! m) + (if (eq? pid-val 0) + (begin + (thread-sleep! 2) + (processloop (+ i 1))))) + (debug:print-info 0 "logpro for step " stepname " exited with code " (vector-ref exit-info 2))))) + + (let ((exinfo (vector-ref exit-info 2)) + (logfna (if logpro-used (conc stepname ".html") ""))) + (rmt:teststep-set-status! run-id test-id stepname "end" exinfo #f logfna area-dat)) + (if logpro-used + (rmt:test-set-log! run-id test-id (conc stepname ".html") area-dat)) + ;; set the test final status + (let* ((this-step-status (cond + ((and (eq? (vector-ref exit-info 2) 2) logpro-used) 'warn) + ((eq? (vector-ref exit-info 2) 0) 'pass) + (else 'fail))) + (overall-status (cond + ((eq? (vector-ref exit-info 3) 2) 'warn) ;; rollup-status + ((eq? (vector-ref exit-info 3) 0) 'pass) + (else 'fail))) + (next-status (cond + ((eq? overall-status 'pass) this-step-status) + ((eq? overall-status 'warn) + (if (eq? this-step-status 'fail) 'fail 'warn)) + (else 'fail))) + (next-state ;; "RUNNING") ;; WHY WAS THIS CHANGED TO NOT USE (null? tal) ?? + (cond + ((null? tal) ;; more to run? + "COMPLETED") + (else "RUNNING"))) + ) + (debug:print 4 "Exit value received: " (vector-ref exit-info 2) " logpro-used: " logpro-used + " this-step-status: " this-step-status " overall-status: " overall-status + " next-status: " next-status " rollup-status: " (vector-ref exit-info 3)) + (case next-status + ((warn) + (vector-set! exit-info 3 2) ;; rollup-status + ;; NB// test-set-status! does rdb calls under the hood + (tests:test-set-status! run-id test-id next-state "WARN" + (if (eq? this-step-status 'warn) "Logpro warning found" #f) + #f)) + ((pass) + (tests:test-set-status! run-id test-id next-state "PASS" #f #f)) + (else ;; 'fail + (vector-set! exit-info 3 1) ;; force fail, this used to be next-state but that doesn't make sense. should always be "COMPLETED" + (tests:test-set-status! run-id test-id "COMPLETED" "FAIL" (conc "Failed at step " stepname) #f) + ))) + logpro-used)) + +(define (launch:execute encoded-cmd area-dat) + (let* ((cmdinfo (common:read-encoded-string encoded-cmd))) + (setenv "MT_CMDINFO" encoded-cmd) + (if (list? cmdinfo) ;; ((testpath /tmp/mrwellan/jazzmind/src/example_run/tests/sqlitespeed) + ;; (test-name sqlitespeed) (runscript runscript.rb) (db-host localhost) (run-id 1)) + (let* ((testpath (assoc/default 'testpath cmdinfo)) ;; testpath is the test spec area + (top-path (assoc/default 'toppath cmdinfo)) + (work-area (assoc/default 'work-area cmdinfo)) ;; work-area is the test run area + (test-name (assoc/default 'test-name cmdinfo)) + (runscript (assoc/default 'runscript cmdinfo)) + (ezsteps (assoc/default 'ezsteps cmdinfo)) + ;; (runremote (assoc/default 'runremote cmdinfo)) + (transport (assoc/default 'transport cmdinfo)) + ;; (serverinf (assoc/default 'serverinf cmdinfo)) + (port (assoc/default 'port cmdinfo)) + (run-id (assoc/default 'run-id cmdinfo)) + (test-id (assoc/default 'test-id cmdinfo)) + (target (assoc/default 'target cmdinfo)) + (itemdat (assoc/default 'itemdat cmdinfo)) + (env-ovrd (assoc/default 'env-ovrd cmdinfo)) + (set-vars (assoc/default 'set-vars cmdinfo)) ;; pre-overrides from -setvar + (runname (assoc/default 'runname cmdinfo)) + (megatest (assoc/default 'megatest cmdinfo)) + (runtlim (assoc/default 'runtlim cmdinfo)) + (item-path (item-list->path itemdat)) + (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo)) + (keys #f) + (keyvals #f) + (fullrunscript (if (not runscript) + #f + (if (substring-index "/" runscript) + runscript ;; use unadultered if contains slashes + (let ((fulln (conc testpath "/" runscript))) + (if (and (file-exists? fulln) + (file-execute-access? fulln)) + fulln + runscript))))) ;; assume it is on the path + ;; (rollup-status 0) + ) + (change-directory top-path) + + ;; (set-signal-handler! signal/int (lambda () + + ;; WAS: Do not run the test if it is REMOVING, RUNNING, KILLREQ or REMOTEHOSTSTART, + ;; NOW: Do not run test test unless state is LAUNCHED + ;; Mark the test as REMOTEHOSTSTART *IMMEDIATELY* + ;; + ;; This is flawed. It should be a single transaction that tests for NOT_STARTED and updates to REMOTEHOSTSTART + (let ((test-info (rmt:get-testinfo-state-status run-id test-id area-dat))) + ;; + (if (equal? (db:test-get-state test-info) "LAUNCHED") ;; '("REMOVING" "REMOTEHOSTSTART" "RUNNING" "KILLREQ"))) + (tests:test-force-state-status! run-id test-id "REMOTEHOSTSTART" "n/a") + (begin + (debug:print 0 "ERROR: test state is " (db:test-get-state test-info) ", cannot proceed") + (exit)))) + + (debug:print 2 "Exectuing " test-name " (id: " test-id ") on " (get-host-name)) + (set! keys (rmt:get-keys area-dat)) + ;; (runs:set-megatest-env-vars run-id area-dat inkeys: keys inkeyvals: keyvals) ;; these may be needed by the launching process + ;; one of these is defunct/redundant ... + (if (not (launch:setup-for-run area-dat force: #t)) + (begin + (debug:print 0 "Failed to setup, exiting") + ;; (sqlite3:finalize! db) + ;; (sqlite3:finalize! tdb) + (exit 1))) + (change-directory toppath) + + ;; NOTE: Current order is to process runconfigs *before* setting the MT_ vars. This + ;; seems non-ideal but could well break stuff + ;; BUG? BUG? BUG? + + (let ((rconfig (full-runconfigs-read))) ;; (read-config (conc toppath "/runconfigs.config") #f #t sections: (list "default" target)))) + ;; (setup-env-defaults (conc toppath "/runconfigs.config") run-id (make-hash-table) keyvals target) + ;; (set-run-config-vars run-id keyvals target) ;; (db:get-target db run-id)) + ;; Now have runconfigs data loaded, set environment vars + (for-each (lambda (section) + (for-each (lambda (varval) + (let ((var (car varval)) + (val (cadr varval))) + (if (and (string? var)(string? val)) + (begin + (setenv var (config:eval-string-in-environment val))) ;; val) + (debug:print 0 "ERROR: bad variable spec, " var "=" val)))) + (configf:get-section rconfig section))) + (list "default" target))) + (change-directory work-area) + (set! keyvals (keys:target->keyval keys target)) + ;; apply pre-overrides before other variables. The pre-override vars must not + ;; clobbers things from the official sources such as megatest.config and runconfigs.config + (if (string? set-vars) + (let ((varpairs (string-split set-vars ","))) + (debug:print 4 "varpairs: " varpairs) + (map (lambda (varpair) + (let ((varval (string-split varpair "="))) + (if (eq? (length varval) 2) + (let ((var (car varval)) + (val (cadr varval))) + (debug:print 1 "Adding pre-var/val " var " = " val " to the environment") + (setenv var val))))) + varpairs))) + (for-each + (lambda (varval) + (let ((var (car varval)) + (val (cadr varval))) + (if val + (setenv var val) + (begin + (debug:print 0 "ERROR: required variable " var " does not have a valid value. Exiting") + (exit))))) + (list + (list "MT_TEST_RUN_DIR" work-area) + (list "MT_TEST_NAME" test-name) + (list "MT_ITEM_INFO" (conc itemdat)) + (list "MT_ITEMPATH" item-path) + (list "MT_RUNNAME" runname) + (list "MT_MEGATEST" megatest) + (list "MT_TARGET" target) + (list "MT_LINKTREE" (configf:lookup (megatest:area-configdat area-dat) "setup" "linktree")) + (list "MT_TESTSUITENAME" (common:get-testsuite-name)))) + + (if mt-bindir-path (setenv "PATH" (conc (getenv "PATH") ":" mt-bindir-path))) + ;; (change-directory top-path) + ;; Can setup as client for server mode now + ;; (client:setup) + + + ;; environment overrides are done *before* the remaining critical envars. + (alist->env-vars env-ovrd) + (runs:set-megatest-env-vars run-id area-dat inkeys: keys inkeyvals: keyvals) + (set-item-env-vars itemdat) + (save-environment-as-files "megatest") + ;; open-run-close not needed for test-set-meta-info + ;; (tests:set-full-meta-info #f test-id run-id 0 work-area) + ;; (tests:set-full-meta-info test-id run-id 0 work-area) + (tests:set-full-meta-info #f test-id run-id 0 work-area 10) + + (thread-sleep! 0.3) ;; NFS slowness has caused grief here + + (if (args:get-arg "-xterm") + (set! fullrunscript "xterm") + (if (and fullrunscript (not (file-execute-access? fullrunscript))) + (system (conc "chmod ug+x " fullrunscript)))) + ;; We are about to actually kick off the test + ;; so this is a good place to remove the records for + ;; any previous runs + ;; (db:test-remove-steps db run-id testname itemdat) + + (let* ((m (make-mutex)) + (kill-job? #f) + (exit-info (vector #t #t #t 0)) + (job-thread #f) + (keep-going #t) + (runit (lambda () + ;; (let-values + ;; (((pid exit-status exit-code) + ;; (run-n-wait fullrunscript))) + ;; (tests:test-set-status! test-id "RUNNING" "n/a" #f #f) + ;; Since we should have a clean slate at this time there is no need to do + ;; any of the other stuff that tests:test-set-status! does. Let's just + ;; force RUNNING/n/a + + + ;; (thread-sleep! 0.3) + (tests:test-force-state-status! run-id test-id "RUNNING" "n/a") + (rmt:roll-up-pass-fail-counts run-id test-name item-path "RUNNING" area-dat) + ;; (thread-sleep! 0.3) ;; NFS slowness has caused grief here + + ;; if there is a runscript do it first + (if fullrunscript + (let ((pid (process-run fullrunscript))) + (rmt:test-set-top-process-pid run-id test-id pid area-dat) + (let loop ((i 0)) + (let-values + (((pid-val exit-status exit-code) (process-wait pid #t))) + (mutex-lock! m) + (vector-set! exit-info 0 pid) + (vector-set! exit-info 1 exit-status) + (vector-set! exit-info 2 exit-code) + (vector-set! exit-info 3 exit-code) ;; rollup status + (mutex-unlock! m) + (if (eq? pid-val 0) + (begin + (thread-sleep! 2) + (loop (+ i 1))) + ))))) + ;; then, if runscript ran ok (or did not get called) + ;; do all the ezsteps (if any) + (if ezsteps + (let* ((testconfig (read-config (conc work-area "/testconfig") #f #t environ-patt: "pre-launch-env-vars")) ;; FIXME??? is allow-system ok here? + (ezstepslst (hash-table-ref/default testconfig "ezsteps" '()))) + (hash-table-set! *testconfigs* test-name testconfig) ;; cached for lazy reads later ... + (if (not (file-exists? ".ezsteps"))(create-directory ".ezsteps")) + ;; if ezsteps was defined then we are sure to have at least one step but check anyway + (if (not (> (length ezstepslst) 0)) + (debug:print 0 "ERROR: ezsteps defined but ezstepslst is zero length") + (let loop ((ezstep (car ezstepslst)) + (tal (cdr ezstepslst)) + (prevstep #f)) + ;; check exit-info (vector-ref exit-info 1) + (if (vector-ref exit-info 1) + (let ((logpro-used (launch:runstep ezstep run-id test-id exit-info m tal))) + (if (and (steprun-good? logpro-used (vector-ref exit-info 2)) + (not (null? tal))) + (loop (car tal) (cdr tal) stepname))) + (debug:print 4 "WARNING: a prior step failed, stopping at " ezstep)))))))) + (monitorjob (lambda () + (let* ((start-seconds (current-seconds)) + (calc-minutes (lambda () + (inexact->exact + (round + (- + (current-seconds) + start-seconds))))) + (kill-tries 0)) + ;; (tests:set-full-meta-info #f test-id run-id (calc-minutes) work-area) + ;; (tests:set-full-meta-info test-id run-id (calc-minutes) work-area) + (tests:set-full-meta-info #f test-id run-id (calc-minutes) work-area 10) + (let loop ((minutes (calc-minutes))) + (begin + (set! kill-job? (or (test-get-kill-request run-id test-id) ;; run-id test-name itemdat)) + (and runtlim (let* ((run-seconds (- (current-seconds) start-seconds)) + (time-exceeded (> run-seconds runtlim))) + (if time-exceeded + (begin + (debug:print-info 0 "KILLING TEST DUE TO TIME LIMIT EXCEEDED! Runtime=" run-seconds " seconds, limit=" runtlim) + #t) + #f))))) + (tests:update-central-meta-info run-id test-id (get-cpu-load) (get-df (current-directory))(calc-minutes) #f #f) + (if kill-job? + (begin + (mutex-lock! m) + ;; NOTE: The pid can change as different steps are run. Do we need handshaking between this + ;; section and the runit section? Or add a loop that tries three times with a 1/4 second + ;; between tries? + (let* ((pid1 (vector-ref exit-info 0)) + (pid2 (rmt:test-get-top-process-pid run-id test-id area-dat)) + (pids (delete-duplicates (filter number? (list pid1 pid2))))) + (if (not (null? pids)) + (begin + (for-each + (lambda (pid) + (handle-exceptions + exn + (begin + (debug:print-info 0 "Unable to kill process with pid " pid ", possibly already killed.") + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn))) + (debug:print 0 "WARNING: Request received to kill job " pid) ;; " (attempt # " kill-tries ")") + (debug:print-info 0 "Signal mask=" (signal-mask)) + ;; (if (process:alive? pid) + ;; (begin + (map (lambda (pid-num) + (process-signal pid-num signal/term)) + (process:get-sub-pids pid)) + (thread-sleep! 5) + ;; (if (process:process-alive? pid) + (map (lambda (pid-num) + (handle-exceptions + exn + #f + (process-signal pid-num signal/kill))) + (process:get-sub-pids pid)))) + ;; (debug:print-info 0 "not killing process " pid " as it is not alive")))) + pids) + (tests:test-set-status! run-id test-id "KILLED" "KILLED" (args:get-arg "-m") #f)) + (begin + (debug:print 0 "ERROR: Nothing to kill, pid1=" pid1 ", pid2=" pid2) + (tests:test-set-status! run-id test-id "KILLED" "FAILED TO KILL" (args:get-arg "-m") #f) + ))) + (mutex-unlock! m) + ;; no point in sticking around. Exit now. + (exit))) + (if keep-going + (begin + (thread-sleep! 3) ;; (+ 3 (random 6))) ;; add some jitter to the call home time to spread out the db accesses + (if keep-going + (loop (calc-minutes))))))) + (tests:update-central-meta-info run-id test-id (get-cpu-load) (get-df (current-directory))(calc-minutes) #f #f)))) ;; NOTE: Checking twice for keep-going is intentional + (th1 (make-thread monitorjob "monitor job")) + (th2 (make-thread runit "run job"))) + (set! job-thread th2) + (thread-start! th1) + (thread-start! th2) + (thread-join! th2) + (debug:print-info 0 "Megatest exectute of test " test-name ", item path " item-path " complete. Notifying the db ...") + (set! keep-going #f) + (thread-join! th1) + (thread-sleep! 1) ;; give thread th1 a chance to be done TODO: Verify this is needed. At 0.1 I was getting fail to stop, increased to total of 1.1 sec. + (mutex-lock! m) + (let* ((item-path (item-list->path itemdat)) + ;; only state and status needed - use lazy routine + (testinfo (rmt:get-testinfo-state-status run-id test-id area-dat))) + ;; Am I completed? + (if (member (db:test-get-state testinfo) '("REMOTEHOSTSTART" "RUNNING")) ;; NOTE: It should *not* be REMOTEHOSTSTART but for reasons I don't yet understand it sometimes gets stuck in that state ;; (not (equal? (db:test-get-state testinfo) "COMPLETED")) + (let ((new-state (if kill-job? "KILLED" "COMPLETED") ;; (if (eq? (vector-ref exit-info 2) 0) ;; exited with "good" status + ;; "COMPLETED" + ;; (db:test-get-state testinfo))) ;; else preseve the state as set within the test + ) + (new-status (cond + ((not (vector-ref exit-info 1)) "FAIL") ;; job failed to run + ((eq? (vector-ref exit-info 3) 0) + ;; if the current status is AUTO then defer to the calculated value (i.e. leave this AUTO) + (if (equal? (db:test-get-status testinfo) "AUTO") "AUTO" "PASS")) + ((eq? (vector-ref exit-info 3) 1) "FAIL") + ((eq? (vector-ref exit-info 3) 2) + ;; if the current status is AUTO the defer to the calculated value but qualify (i.e. make this AUTO-WARN) + (if (equal? (db:test-get-status testinfo) "AUTO") "AUTO-WARN" "WARN")) + (else "FAIL")))) ;; (db:test-get-status testinfo))) + (debug:print-info 1 "Test exited in state=" (db:test-get-state testinfo) ", setting state/status based on exit code of " (vector-ref exit-info 1) " and rollup-status of " (vector-ref exit-info 3)) + (tests:test-set-status! run-id + test-id + new-state + new-status + (args:get-arg "-m") #f) + ;; need to update the top test record if PASS or FAIL and this is a subtest + ;; NO NEED TO CALL roll-up-pass-fail-counts HERE, THIS IS DONE IN roll-up-pass-fail-counts called by tests:test-set-status! + )) + ;; for automated creation of the rollup html file this is a good place... + ;; (if (and (not (equal? item-path "")) + ;; (< (random (rmt:get-count-tests-running-for-testname run-id test-name)) 5)) + (tests:summarize-items run-id test-id test-name #f) + (tests:summarize-test run-id test-id)) ;; don't force - just update if no + (mutex-unlock! m) + (debug:print 2 "Output from running " fullrunscript ", pid " (vector-ref exit-info 0) " in work area " + work-area ":\n====\n exit code " (vector-ref exit-info 2) "\n" "====\n") + (if (not (vector-ref exit-info 1)) + (exit 4))))))) + +(define (launch:read-cached-config) + (if (get-environment-variable "MT_CMDINFO") ;; we are inside a test - do not reprocess configs + (let ((alistconfig (conc (get-environment-variable "MT_LINKTREE") "/" + (get-environment-variable "MT_TARGET") "/" + (get-environment-variable "MT_RUNNAME") "/" + ".megatest.cfg"))) + (if (file-exists? alistconfig) + (list (configf:read-alist alistconfig) + (get-environment-variable "MT_RUN_AREA_HOME")) + #f)) + #f)) + +(define (launch:read-megatest-config toppath) + (let ((runname (or (args:get-arg "-runname")(args:get-arg ":runname")))) + (if runname (setenv "MT_RUNNAME" runname)) + (find-and-read-config + (if (args:get-arg "-config")(args:get-arg "-config") "megatest.config") + environ-patt: "env-override" + given-toppath: (get-environment-variable "MT_RUN_AREA_HOME") + pathenvvar: "MT_RUN_AREA_HOME"))) + +;; set up the very basics needed for doing anything here. +(define (launch:setup-for-run area-dat #!key (force #f)) + ;; would set values for KEYS in the environment here for better support of env-override but + ;; have chicken/egg scenario. need to read megatest.config then read it again. Going to + ;; pass on that idea for now + ;; special case + (let ((configdat (megatest:area-configdat area-dat))) + (if (or force (not (hash-table? configdat))) ;; no need to re-open on every call + (let* ((newconfiginfo (or (launch:read-cached-config) ;; no config cached - give up + (launch:read-megatest-config (megatest:area-path area-dat)))) + (configdat (car newconfiginfo)) + (toppath (cadr newconfiginfo))) + (megatest:area-configinfo-set! area-dat newconfiginfo) + (megatest:area-configdat-set! area-dat configdat) + (megatest:area-path-set! area-dat toppath) + (let* ((tmptransport (configf:lookup configdat "server" "transport")) + (transport (if tmptransport (string->symbol tmptransport) 'http))) + (if (member transport '(http rpc nmsg)) + (megatest:area-transport-set! area-dat transport) + (begin + (debug:print 0 "ERROR: Unrecognised transport " transport) + (exit)))) + (let ((linktree (configf:lookup configdat "setup" "linktree"))) ;; link tree is critical + (if linktree + (if (not (file-exists? linktree)) + (begin + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Something went wrong when trying to create linktree dir at " linktree) + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) + (exit 1)) + (create-directory linktree #t)))) + (begin + (debug:print 0 "ERROR: linktree not defined in [setup] section of megatest.config") + (exit 1))) + (if linktree + (let ((dbdir (conc linktree "/.db"))) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: failed to create the " dbdir " area for your database files") + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn))) + (if (not (directory-exists? dbdir))(create-directory dbdir))) + (setenv "MT_LINKTREE" linktree)) + (begin + (debug:print 0 "ERROR: linktree is required in your megatest.config [setup] section") + (exit 1))) + (if (and toppath + (directory-exists? toppath)) + (setenv "MT_RUN_AREA_HOME" toppath) + (begin + (debug:print 0 "ERROR: failed to find the top path to your Megatest area.") + (exit 1)))) + toppath)))) + +(define (launch:cache-config area-dat) + ;; if we have a linktree and -runtests and -target and the directory exists dump the config + ;; to megatest-(current-seconds).cfg and symlink it to megatest.cfg + (let ((configdat (megatest:area-configdat area-dat))) + (if (and configdat + (args:get-arg "-runtests")) + (let* ((linktree (get-environment-variable "MT_LINKTREE")) + (target (common:args-get-target)) + (runname (or (args:get-arg "-runname") + (args:get-arg ":runname"))) + (fulldir (conc linktree "/" + target "/" + runname))) + (debug:print-info 0 "Have -runtests with target=" target ", runname=" runname ", fulldir=" fulldir) + (if (file-exists? linktree) ;; can't proceed without linktree + (begin + (if (not (file-exists? fulldir)) + (create-directory fulldir #t)) ;; need to protect with exception handler + (if (and target + runname + (file-exists? fulldir)) + (let ((tmpfile (conc fulldir "/.megatest.cfg." (current-seconds))) + (targfile (conc fulldir "/.megatest.cfg"))) + (debug:print-info 0 "Caching megatest.config in " fulldir "/.megatest.cfg") + (configf:write-alist configdat tmpfile) + (system (conc "ln -sf " tmpfile " " targfile)) + )))))))) + +(define (get-best-disk confdat) + (let* ((disks (hash-table-ref/default confdat "disks" #f)) + (minspace (let ((m (configf:lookup confdat "setup" "minspace"))) + (string->number (or m "10000"))))) + (if disks + (let ((res (common:get-disk-with-most-free-space disks minspace))) ;; min size of 1000, seems tad dumb + (if res + (cdr res) + (begin + (if (common:low-noise-print 20 "no valid disks") + (debug:print 0 "ERROR: No valid disks found in megatest.config. Please add some to your [disks] section and ensure the directory exists!")) + (exit 1))))))) + +;; Desired directory structure: +;; +;; - - -. +;; | +;; v +;; - - -|- +;; +;; dir stored in test is: +;; +;; - - [ - ] +;; +;; All log file links should be stored relative to the top of link path +;; +;; - [ - ] +;; +(define (create-work-area run-id run-info keyvals test-id test-src-path disk-path testname itemdat area-dat #!key (remtries 2)) + (let* ((configdat (megatest:area-configdat area-dat)) + (item-path (if (string? itemdat) itemdat (item-list->path itemdat))) ;; if pass in string - just use it + (runname (if (string? run-info) ;; if we pass in a string as run-info use it as run-name. + run-info + (db:get-value-by-header (db:get-rows run-info) + (db:get-header run-info) + "runname"))) + ;; convert back to db: from rdb: - this is always run at server end + (target (string-intersperse (map cadr keyvals) "/")) + + (not-iterated (equal? "" item-path)) + + ;; all tests are found at /test-base or /test-base + (testtop-base (conc target "/" runname "/" testname)) + (test-base (conc testtop-base (if not-iterated "" "/") item-path)) + + ;; nb// if itempath is not "" then it is prefixed with "/" + (toptest-path (conc disk-path "/" testtop-base)) + (test-path (conc disk-path "/" test-base)) + + ;; ensure this exists first as links to subtests must be created there + (linktree (let ((rd (config-lookup configdat "setup" "linktree"))) + (if rd rd (conc (megatest:area-path area-dat) "/runs")))) + + (lnkbase (conc linktree "/" target "/" runname)) + (lnkpath (conc lnkbase "/" testname)) + (lnkpathf (conc lnkpath (if not-iterated "" "/") item-path)) + (lnktarget (conc lnkpath "/" item-path))) + + ;; Update the rundir path in the test record for all, rundir=physical, shortdir=logical + ;; rundir shortdir + (rmt:general-call 'test-set-rundir-shortdir run-id lnkpathf test-path testname item-path area-dat) + + (debug:print 2 "INFO:\n lnkbase=" lnkbase "\n lnkpath=" lnkpath "\n toptest-path=" toptest-path "\n test-path=" test-path) + (if (not (file-exists? linktree)) + (begin + (debug:print 0 "WARNING: linktree did not exist! Creating it now at " linktree) + (create-directory linktree #t))) ;; (system (conc "mkdir -p " linktree)))) + ;; create the directory for the tests dir links, this is needed no matter what... + (if (and (not (directory-exists? lnkbase)) + (not (file-exists? lnkbase))) + (handle-exceptions + exn + (begin + (debug:print "ERROR: Problem creating linktree base at " lnkbase) + (print-error-message exn (current-error-port))) + (create-directory lnkbase #t))) + + ;; update the toptest record with its location rundir, cache the path + ;; This wass highly inefficient, one db write for every subtest, potentially + ;; thousands of unnecessary updates, cache the fact it was set and don't set it + ;; again. + + ;; Now create the link from the test path to the link tree, however + ;; if the test is iterated it is necessary to create the parent path + ;; to the iteration. use pathname-directory to trim the path by one + ;; level + (if (not not-iterated) ;; i.e. iterated + (let ((iterated-parent (pathname-directory (conc lnkpath "/" item-path)))) + (debug:print-info 2 "Creating iterated parent " iterated-parent) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create directory " iterated-parent ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-directory iterated-parent #t)))) + + (if (symbolic-link? lnkpath) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to remove symlink " lnkpath ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (delete-file lnkpath))) + + (if (not (or (file-exists? lnkpath) + (symbolic-link? lnkpath))) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create symlink " lnkpath ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-symbolic-link toptest-path lnkpath))) + + ;; NB - This was not working right - some top tests are not getting the path set!!! + ;; + ;; Do the setting of this record after the paths are created so that the shortdir can + ;; be set to the real directory location. This is safer for future clean up if the link + ;; tree is damaged or lost. + ;; + (if (not (hash-table-ref/default *toptest-paths* testname #f)) + (let* ((testinfo (rmt:get-test-info-by-id run-id test-id area-dat)) ;; run-id testname item-path)) + (curr-test-path (if testinfo ;; (filedb:get-path *fdb* + ;; (db:get-path dbstruct + ;; (rmt:sdb-qry 'getstr + (db:test-get-rundir testinfo) ;; ) ;; ) + #f))) + (hash-table-set! *toptest-paths* testname curr-test-path) + ;; NB// Was this for the test or for the parent in an iterated test? + (rmt:general-call 'test-set-rundir-shortdir run-id lnkpath + (if (file-exists? lnkpath) + (resolve-pathname lnkpath) + lnkpath) + testname "" area-dat) + ;; (rmt:general-call 'test-set-rundir run-id lnkpath testname "") ;; toptest-path) + (if (or (not curr-test-path) + (not (directory-exists? toptest-path))) + (begin + (debug:print-info 2 "Creating " toptest-path " and link " lnkpath) + (handle-exceptions + exn + #f ;; don't care to catch and deal with errors here for now. + (create-directory toptest-path #t)) + (hash-table-set! *toptest-paths* testname toptest-path))))) + + ;; The toptest path has been created, the link to the test in the linktree has + ;; been created. Now, if this is an iterated test the real test dir must be created + (if (not not-iterated) ;; this is an iterated test + (begin ;; (let ((lnktarget (conc lnkpath "/" item-path))) + (debug:print 2 "Setting up sub test run area") + (debug:print 2 " - creating run area in " test-path) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create directory " test-path ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-directory test-path #t)) + (debug:print 2 + " - creating link from: " test-path "\n" + " to: " lnktarget) + + ;; If there is already a symlink delete it and recreate it. + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to re-create link " lnktarget ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit)) + (if (symbolic-link? lnktarget) (delete-file lnktarget)) + (if (not (file-exists? lnktarget)) (create-symbolic-link test-path lnktarget))))) + + (if (not (directory? test-path)) + (create-directory test-path #t)) ;; this is a hack, I don't know why out of the blue this path does not exist sometimes + + (if (and test-src-path (directory? test-path)) + (begin + (let* ((ovrcmd (let ((cmd (config-lookup configdat "setup" "testcopycmd"))) + (if cmd + ;; substitute the TEST_SRC_PATH and TEST_TARG_PATH + (string-substitute "TEST_TARG_PATH" test-path + (string-substitute "TEST_SRC_PATH" test-src-path cmd #t) #t) + #f))) + (cmd (if ovrcmd + ovrcmd + (conc "rsync -av" (if (debug:debug-mode 1) "" "q") " " test-src-path "/ " test-path "/" + " >> " test-path "/mt_launch.log 2>> " test-path "/mt_launch.log"))) + (status (system cmd))) + (if (not (eq? status 0)) + (debug:print 2 "ERROR: problem with running \"" cmd "\""))) + (list lnkpathf lnkpath )) + (if (and test-src-path (> remtries 0)) + (begin + (debug:print 0 "ERROR: Failed to create work area at " test-path " with link at " lnktarget ", remaining attempts " remtries) + ;; + (create-work-area run-id run-info keyvals test-id test-src-path disk-path testname itemdat remtries: (- remtries 1))) + (list #f #f))))) + +;; 1. look though disks list for disk with most space +;; 2. create run dir on disk, path name is meaningful +;; 3. create link from run dir to megatest runs area +;; 4. remotely run the test on allocated host +;; - could be ssh to host from hosts table (update regularly with load) +;; - could be netbatch +;; (launch-test db (cadr status) test-conf)) +(define (launch-test test-id run-id run-info keyvals runname test-conf test-name test-path itemdat params area-dat) + (let ((toppath (megatest:area-path area-dat)) + (configdat (megatest:area-configdat area-dat))) + (change-directory toppath) + (alist->env-vars ;; consolidate this code with the code in megatest.scm for "-execute" + (list ;; (list "MT_TEST_RUN_DIR" work-area) + (list "MT_RUN_AREA_HOME" toppath) + (list "MT_TEST_NAME" test-name) + ;; (list "MT_ITEM_INFO" (conc itemdat)) + (list "MT_RUNNAME" runname) + ;; (list "MT_TARGET" mt_target) + )) + (let* ((useshell (let ((ush (config-lookup configdat "jobtools" "useshell"))) + (if ush + (if (equal? ush "no") ;; must use "no" to NOT use shell + #f + ush) + #t))) ;; default is yes + (launcher (config-lookup configdat "jobtools" "launcher")) + (runscript (config-lookup test-conf "setup" "runscript")) + (ezsteps (> (length (hash-table-ref/default test-conf "ezsteps" '())) 0)) ;; don't send all the steps, could be big + (diskspace (config-lookup test-conf "requirements" "diskspace")) + (memory (config-lookup test-conf "requirements" "memory")) + (hosts (config-lookup configdat "jobtools" "workhosts")) + (remote-megatest (config-lookup configdat "setup" "executable")) + (run-time-limit (or (configf:lookup test-conf "requirements" "runtimelim") + (configf:lookup configdat "setup" "runtimelim"))) + ;; FIXME SOMEDAY: not good how this is so obtuse, this hack is to + ;; allow running from dashboard. Extract the path + ;; from the called megatest and convert dashboard + ;; or dboard to megatest + (local-megatest (let* ((lm (car (argv))) + (dir (pathname-directory lm)) + (exe (pathname-strip-directory lm))) + (conc (if dir (conc dir "/") "") + (case (string->symbol exe) + ((dboard) "../megatest") + ((mtest) "../megatest") + ((dashboard) "megatest") + (else exe))))) + (item-path (item-list->path itemdat)) + (test-sig (conc test-name ":" item-path)) ;; (item-list->path itemdat))) ;; test-path is the full path including the item-path + (work-area #f) + (toptest-work-area #f) ;; for iterated tests the top test contains data relevant for all + (diskpath #f) + (cmdparms #f) + (fullcmd #f) ;; (define a (with-output-to-string (lambda ()(write x)))) + (mt-bindir-path #f) + (testinfo (rmt:get-test-info-by-id run-id test-id area-dat)) + (mt_target (string-intersperse (map cadr keyvals) "/")) + (debug-param (append (if (args:get-arg "-debug") (list "-debug" (args:get-arg "-debug")) '()) + (if (args:get-arg "-logging")(list "-logging") '())))) + (setenv "MT_ITEMPATH" item-path) + (if hosts (set! hosts (string-split hosts))) + ;; set the megatest to be called on the remote host + (if (not remote-megatest)(set! remote-megatest local-megatest)) ;; "megatest")) + (set! mt-bindir-path (pathname-directory remote-megatest)) + (if launcher (set! launcher (string-split launcher))) + ;; set up the run work area for this test + (if (and (args:get-arg "-preclean") ;; user has requested to preclean for this run + (not (member (db:test-get-rundir testinfo)(list "n/a" "/tmp/badname")))) ;; n/a is a placeholder and thus not a read dir + (begin + (debug:print-info 0 "attempting to preclean directory " (db:test-get-rundir testinfo) " for test " test-name "/" item-path) + (runs:remove-test-directory testinfo 'remove-data-only))) ;; remove data only, do not perturb the record + + ;; prevent overlapping actions - set to LAUNCHED as early as possible + ;; + (tests:test-set-status! run-id test-id "LAUNCHED" "n/a" #f #f) ;; (if launch-results launch-results "FAILED")) + (rmt:roll-up-pass-fail-counts run-id test-name item-path "LAUNCHED" area-dat) + (set! diskpath (get-best-disk configdat)) + (if diskpath + (let ((dat (create-work-area run-id run-info keyvals test-id test-path diskpath test-name itemdat))) + (set! work-area (car dat)) + (set! toptest-work-area (cadr dat)) + (debug:print-info 2 "Using work area " work-area)) + (begin + (set! work-area (conc test-path "/tmp_run")) + (create-directory work-area #t) + (debug:print 0 "WARNING: No disk work area specified - running in the test directory under tmp_run"))) + (set! cmdparms (base64:base64-encode + (z3:encode-buffer + (with-output-to-string + (lambda () ;; (list 'hosts hosts) + (write (list (list 'testpath test-path) + (list 'transport (conc (megatest:area-transport area-dat))) ;; + ;; (list 'serverinf *server-info*) + (list 'toppath toppath) + (list 'work-area work-area) + (list 'test-name test-name) + (list 'runscript runscript) + (list 'run-id run-id ) + (list 'test-id test-id ) + ;; (list 'item-path item-path ) + (list 'itemdat itemdat ) + (list 'megatest remote-megatest) + (list 'ezsteps ezsteps) + (list 'target mt_target) + (list 'runtlim (if run-time-limit (common:hms-string->seconds run-time-limit) #f)) + (list 'env-ovrd (hash-table-ref/default configdat "env-override" '())) + (list 'set-vars (if params (hash-table-ref/default params "-setvars" #f))) + (list 'runname runname) + (list 'mt-bindir-path mt-bindir-path)))))))) + + ;; clean out step records from previous run if they exist + ;; (rmt:delete-test-step-records run-id test-id) + + ;; Moving launch logs to MT_RUN_AREA_HOME/logs + ;; + (let ((launchdir (configf:lookup *configdat* "setup" "launchdir"))) ;; (change-directory work-area) ;; so that log files from the launch process don't clutter the test dir + (if (not launchdir) ;; default + (change-directory (conc *toppath* "/logs")) ;; can assume this exists + (case (string->symbol launchdir) + ((legacy)(change-directory work-area)) + (else (change-directory launchdir))))) + (cond + ((and launcher hosts) ;; must be using ssh hostname + (set! fullcmd (append launcher (car hosts)(list remote-megatest test-sig "-execute" cmdparms) debug-param))) + ;; (set! fullcmd (append launcher (car hosts)(list remote-megatest test-sig "-execute" cmdparms)))) + (launcher + (set! fullcmd (append launcher (list remote-megatest test-sig "-execute" cmdparms) debug-param))) + ;; (set! fullcmd (append launcher (list remote-megatest test-sig "-execute" cmdparms)))) + (else + (if (not useshell)(debug:print 0 "WARNING: internal launching will not work well without \"useshell yes\" in your [jobtools] section")) + (set! fullcmd (append (list remote-megatest test-sig "-execute" cmdparms) debug-param (list (if useshell "&" "")))))) + ;; (set! fullcmd (list remote-megatest test-sig "-execute" cmdparms (if useshell "&" ""))))) + (if (args:get-arg "-xterm")(set! fullcmd (append fullcmd (list "-xterm")))) + (debug:print 1 "Launching " work-area) + ;; set pre-launch-env-vars before launching, keep the vars in prevvals and put the envionment back when done + (debug:print 4 "fullcmd: " fullcmd) + (let* ((commonprevvals (alist->env-vars + (hash-table-ref/default configdat "env-override" '()))) + (testprevvals (alist->env-vars + (hash-table-ref/default test-conf "pre-launch-env-overrides" '()))) + (miscprevvals (alist->env-vars ;; consolidate this code with the code in megatest.scm for "-execute" + (append (list (list "MT_TEST_RUN_DIR" work-area) + (list "MT_TEST_NAME" test-name) + (list "MT_ITEM_INFO" (conc itemdat)) + (list "MT_RUNNAME" runname) + (list "MT_TARGET" mt_target) + (list "MT_ITEMPATH" item-path) + ) + itemdat))) + ;; Launchwait defaults to true, must override it to turn off wait + (launchwait (if (equal? (configf:lookup configdat "setup" "launchwait") "no") #f #t)) + (launch-results (apply (if launchwait + cmd-run-with-stderr->list + process-run) + (if useshell + (let ((cmdstr (string-intersperse fullcmd " "))) + (if launchwait + cmdstr + (conc cmdstr " >> " work-area "/mt_launch.log 2>&1"))) + (car fullcmd)) + (if useshell + '() + (cdr fullcmd))))) + (if (not launchwait) ;; give the OS a little time to allow the process to start + (thread-sleep! 0.01)) + (with-output-to-file (conc work-area "/mt_launch.log") + (lambda () + (if (list? launch-results) + (apply print launch-results) + (print "NOTE: launched \"" fullcmd "\"\n but did not wait for it to proceed. Add the following to megatest.config \n[setup]\nlaunchwait yes\n if you have problems with this")) + #:append)) + (debug:print 2 "Launching completed, updating db") + (debug:print 2 "Launch results: " launch-results) + (if (not launch-results) + (begin + (print "ERROR: Failed to run " (string-intersperse fullcmd " ") ", exiting now") + ;; (sqlite3:finalize! db) + ;; good ole "exit" seems not to work + ;; (_exit 9) + ;; but this hack will work! Thanks go to Alan Post of the Chicken email list + ;; NB// Is this still needed? Should be safe to go back to "exit" now? + (process-signal (current-process-id) signal/kill) + )) + (alist->env-vars miscprevvals) + (alist->env-vars testprevvals) + (alist->env-vars commonprevvals) + launch-results)) + (change-directory toppath)) + ;; added paren below after refactoring above routine. must have missed something? + ) + ADDED launch.scm-original Index: launch.scm-original ================================================================== --- /dev/null +++ launch.scm-original @@ -0,0 +1,969 @@ + +;; Copyright 2006-2013, Matthew Welland. +;; +;; This program is made available under the GNU GPL version 2.0 or +;; greater. See the accompanying file COPYING for details. +;; +;; This program is distributed WITHOUT ANY WARRANTY; without even the +;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. + +;;====================================================================== +;; launch a task - this runs on the originating host, tests themselves +;; +;;====================================================================== + +(use regex regex-case base64 sqlite3 srfi-18 directory-utils posix-extras z3 call-with-environment-variables) + +(import (prefix base64 base64:)) +(import (prefix sqlite3 sqlite3:)) + +(declare (unit launch)) +(declare (uses common)) +(declare (uses configf)) +(declare (uses db)) +;; (declare (uses sdb)) +(declare (uses tdb)) +;; (declare (uses filedb)) + +(include "common_records.scm") +(include "key_records.scm") +(include "db_records.scm") + +;;====================================================================== +;; ezsteps +;;====================================================================== + +;; ezsteps were going to be coded as +;; stepname[,predstep1,predstep2 ...] [{VAR1=first,second,third}] command to execute +;; BUT +;; now are +;; stepname {VAR=first,second,third ...} command ... +;; where the {VAR=first,second,third ...} is optional. + +;; given an exit code and whether or not logpro was used calculate OK/BAD +;; return #t if we are ok, #f otherwise +(define (steprun-good? logpro exitcode) + (or (eq? exitcode 0) + (and logpro (eq? exitcode 2)))) + +;; if handed a string, process it, else look for MT_CMDINFO +(define (launch:get-cmdinfo-assoc-list #!key (encoded-cmd #f)) + (let ((enccmd (if encoded-cmd encoded-cmd (getenv "MT_CMDINFO")))) + (if enccmd + (common:read-encoded-string enccmd) + '()))) + + +(define (launch:runstep ezstep run-id test-id exit-info m tal) + (let* ((stepname (car ezstep)) ;; do stuff to run the step + (stepinfo (cadr ezstep)) + (stepparts (string-match (regexp "^(\\{([^\\}]*)\\}\\s*|)(.*)$") stepinfo)) + (stepparms (list-ref stepparts 2)) ;; for future use, {VAR=1,2,3}, run step for each + (stepcmd (list-ref stepparts 3)) + (script "") ; "#!/bin/bash\n") ;; yep, we depend on bin/bash FIXME!!!\ + (logpro-file (conc stepname ".logpro")) + (html-file (conc stepname ".html")) + (logpro-used (file-exists? logpro-file))) + ;; NB// can safely assume we are in test-area directory + (debug:print 4 "ezsteps:\n stepname: " stepname " stepinfo: " stepinfo " stepparts: " stepparts + " stepparms: " stepparms " stepcmd: " stepcmd) + + ;; ;; first source the previous environment + ;; (let ((prev-env (conc ".ezsteps/" prevstep (if (string-search (regexp "csh") + ;; (get-environment-variable "SHELL")) ".csh" ".sh")))) + ;; (if (and prevstep (file-exists? prev-env)) + ;; (set! script (conc script "source " prev-env)))) + + ;; call the command using mt_ezstep + ;; (set! script (conc "mt_ezstep " stepname " " (if prevstep prevstep "x") " " stepcmd)) + + (debug:print 4 "script: " script) + (rmt:teststep-set-status! run-id test-id stepname "start" "-" #f #f area-dat) + ;; now launch the actual process + (call-with-environment-variables + (list (cons "PATH" (conc (get-environment-variable "PATH") ":."))) + (lambda () ;; (process-run "/bin/bash" "-c" "exec ls -l /tmp/foobar > /tmp/delme-more.log 2>&1") + (let* ((cmd (conc stepcmd " > " stepname ".log 2>&1")) ;; >outfile 2>&1 + (pid (process-run "/bin/bash" (list "-c" cmd)))) + (rmt:test-set-top-process-pid run-id test-id pid area-dat) + (let processloop ((i 0)) + (let-values (((pid-val exit-status exit-code)(process-wait pid #t))) + (mutex-lock! m) + (vector-set! exit-info 0 pid) + (vector-set! exit-info 1 exit-status) + (vector-set! exit-info 2 exit-code) + (mutex-unlock! m) + (if (eq? pid-val 0) + (begin + (thread-sleep! 2) + (processloop (+ i 1)))) + ))))) + (debug:print-info 0 "step " stepname " completed with exit code " (vector-ref exit-info 2)) + ;; now run logpro if needed + (if logpro-used + (let ((pid (process-run (conc "logpro " logpro-file " " (conc stepname ".html") " < " stepname ".log")))) + (let processloop ((i 0)) + (let-values (((pid-val exit-status exit-code)(process-wait pid #t))) + (mutex-lock! m) + (vector-set! exit-info 0 pid) + (vector-set! exit-info 1 exit-status) + (vector-set! exit-info 2 exit-code) + (mutex-unlock! m) + (if (eq? pid-val 0) + (begin + (thread-sleep! 2) + (processloop (+ i 1))))) + (debug:print-info 0 "logpro for step " stepname " exited with code " (vector-ref exit-info 2))))) + + (let ((exinfo (vector-ref exit-info 2)) + (logfna (if logpro-used (conc stepname ".html") ""))) + (rmt:teststep-set-status! run-id test-id stepname "end" exinfo #f logfna area-dat)) + (if logpro-used + (rmt:test-set-log! run-id test-id (conc stepname ".html") area-dat)) + ;; set the test final status + (let* ((this-step-status (cond + ((and (eq? (vector-ref exit-info 2) 2) logpro-used) 'warn) + ((eq? (vector-ref exit-info 2) 0) 'pass) + (else 'fail))) + (overall-status (cond + ((eq? (vector-ref exit-info 3) 2) 'warn) ;; rollup-status + ((eq? (vector-ref exit-info 3) 0) 'pass) + (else 'fail))) + (next-status (cond + ((eq? overall-status 'pass) this-step-status) + ((eq? overall-status 'warn) + (if (eq? this-step-status 'fail) 'fail 'warn)) + (else 'fail))) + (next-state ;; "RUNNING") ;; WHY WAS THIS CHANGED TO NOT USE (null? tal) ?? + (cond + ((null? tal) ;; more to run? + "COMPLETED") + (else "RUNNING"))) + ) + (debug:print 4 "Exit value received: " (vector-ref exit-info 2) " logpro-used: " logpro-used + " this-step-status: " this-step-status " overall-status: " overall-status + " next-status: " next-status " rollup-status: " (vector-ref exit-info 3)) + (case next-status + ((warn) + (vector-set! exit-info 3 2) ;; rollup-status + ;; NB// test-set-status! does rdb calls under the hood + (tests:test-set-status! run-id test-id next-state "WARN" + (if (eq? this-step-status 'warn) "Logpro warning found" #f) + #f)) + ((pass) + (tests:test-set-status! run-id test-id next-state "PASS" #f #f)) + (else ;; 'fail + (vector-set! exit-info 3 1) ;; force fail, this used to be next-state but that doesn't make sense. should always be "COMPLETED" + (tests:test-set-status! run-id test-id "COMPLETED" "FAIL" (conc "Failed at step " stepname) #f) + ))) + logpro-used)) + +(define (launch:execute encoded-cmd area-dat) + (let* ((cmdinfo (common:read-encoded-string encoded-cmd))) + (setenv "MT_CMDINFO" encoded-cmd) + (if (list? cmdinfo) ;; ((testpath /tmp/mrwellan/jazzmind/src/example_run/tests/sqlitespeed) + ;; (test-name sqlitespeed) (runscript runscript.rb) (db-host localhost) (run-id 1)) + (let* ((testpath (assoc/default 'testpath cmdinfo)) ;; testpath is the test spec area + (top-path (assoc/default 'toppath cmdinfo)) + (work-area (assoc/default 'work-area cmdinfo)) ;; work-area is the test run area + (test-name (assoc/default 'test-name cmdinfo)) + (runscript (assoc/default 'runscript cmdinfo)) + (ezsteps (assoc/default 'ezsteps cmdinfo)) + ;; (runremote (assoc/default 'runremote cmdinfo)) + (transport (assoc/default 'transport cmdinfo)) + ;; (serverinf (assoc/default 'serverinf cmdinfo)) + (port (assoc/default 'port cmdinfo)) + (run-id (assoc/default 'run-id cmdinfo)) + (test-id (assoc/default 'test-id cmdinfo)) + (target (assoc/default 'target cmdinfo)) + (itemdat (assoc/default 'itemdat cmdinfo)) + (env-ovrd (assoc/default 'env-ovrd cmdinfo)) + (set-vars (assoc/default 'set-vars cmdinfo)) ;; pre-overrides from -setvar + (runname (assoc/default 'runname cmdinfo)) + (megatest (assoc/default 'megatest cmdinfo)) + (runtlim (assoc/default 'runtlim cmdinfo)) + (item-path (item-list->path itemdat)) + (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo)) + (keys #f) + (keyvals #f) + (fullrunscript (if (not runscript) + #f + (if (substring-index "/" runscript) + runscript ;; use unadultered if contains slashes + (let ((fulln (conc testpath "/" runscript))) + (if (and (file-exists? fulln) + (file-execute-access? fulln)) + fulln + runscript))))) ;; assume it is on the path + ;; (rollup-status 0) + ) + (change-directory top-path) + + ;; (set-signal-handler! signal/int (lambda () + + ;; Do not run the test if it is REMOVING, RUNNING, KILLREQ or REMOTEHOSTSTART, + ;; Mark the test as REMOTEHOSTSTART *IMMEDIATELY* + ;; + (let ((test-info (rmt:get-testinfo-state-status run-id test-id area-dat))) + (if (not (member (db:test-get-state test-info) '("REMOVING" "REMOTEHOSTSTART" "RUNNING" "KILLREQ"))) + (tests:test-force-state-status! run-id test-id "REMOTEHOSTSTART" "n/a") + (begin + (debug:print 0 "ERROR: test state is " (db:test-get-state test-info) ", cannot proceed") + (exit)))) + + (debug:print 2 "Exectuing " test-name " (id: " test-id ") on " (get-host-name)) + (set! keys (rmt:get-keys area-dat)) + ;; (runs:set-megatest-env-vars run-id area-dat inkeys: keys inkeyvals: keyvals) ;; these may be needed by the launching process + ;; one of these is defunct/redundant ... + (if (not (launch:setup-for-run area-dat force: #t)) + (begin + (debug:print 0 "Failed to setup, exiting") + ;; (sqlite3:finalize! db) + ;; (sqlite3:finalize! tdb) + (exit 1))) + (change-directory toppath) + + ;; NOTE: Current order is to process runconfigs *before* setting the MT_ vars. This + ;; seems non-ideal but could well break stuff + ;; BUG? BUG? BUG? + + (let ((rconfig (full-runconfigs-read))) ;; (read-config (conc toppath "/runconfigs.config") #f #t sections: (list "default" target)))) + ;; (setup-env-defaults (conc toppath "/runconfigs.config") run-id (make-hash-table) keyvals target) + ;; (set-run-config-vars run-id keyvals target) ;; (db:get-target db run-id)) + ;; Now have runconfigs data loaded, set environment vars + (for-each (lambda (section) + (for-each (lambda (varval) + (let ((var (car varval)) + (val (cadr varval))) + (if (and (string? var)(string? val)) + (begin + (setenv var (config:eval-string-in-environment val))) ;; val) + (debug:print 0 "ERROR: bad variable spec, " var "=" val)))) + (configf:get-section rconfig section))) + (list "default" target))) + (change-directory work-area) + (set! keyvals (keys:target->keyval keys target)) + ;; apply pre-overrides before other variables. The pre-override vars must not + ;; clobbers things from the official sources such as megatest.config and runconfigs.config + (if (string? set-vars) + (let ((varpairs (string-split set-vars ","))) + (debug:print 4 "varpairs: " varpairs) + (map (lambda (varpair) + (let ((varval (string-split varpair "="))) + (if (eq? (length varval) 2) + (let ((var (car varval)) + (val (cadr varval))) + (debug:print 1 "Adding pre-var/val " var " = " val " to the environment") + (setenv var val))))) + varpairs))) + (for-each + (lambda (varval) + (let ((var (car varval)) + (val (cadr varval))) + (if val + (setenv var val) + (begin + (debug:print 0 "ERROR: required variable " var " does not have a valid value. Exiting") + (exit))))) + (list + (list "MT_TEST_RUN_DIR" work-area) + (list "MT_TEST_NAME" test-name) + (list "MT_ITEM_INFO" (conc itemdat)) + (list "MT_ITEMPATH" item-path) + (list "MT_RUNNAME" runname) + (list "MT_MEGATEST" megatest) + (list "MT_TARGET" target) + (list "MT_LINKTREE" (configf:lookup (megatest:area-configdat area-dat) "setup" "linktree")) + (list "MT_TESTSUITENAME" (common:get-testsuite-name)))) + + (if mt-bindir-path (setenv "PATH" (conc (getenv "PATH") ":" mt-bindir-path))) + ;; (change-directory top-path) + ;; Can setup as client for server mode now + ;; (client:setup) + + + ;; environment overrides are done *before* the remaining critical envars. + (alist->env-vars env-ovrd) + (runs:set-megatest-env-vars run-id area-dat inkeys: keys inkeyvals: keyvals) + (set-item-env-vars itemdat) + (save-environment-as-files "megatest") + ;; open-run-close not needed for test-set-meta-info + ;; (tests:set-full-meta-info #f test-id run-id 0 work-area) + ;; (tests:set-full-meta-info test-id run-id 0 work-area) + (tests:set-full-meta-info #f test-id run-id 0 work-area 10) + + (thread-sleep! 0.3) ;; NFS slowness has caused grief here + + (if (args:get-arg "-xterm") + (set! fullrunscript "xterm") + (if (and fullrunscript (not (file-execute-access? fullrunscript))) + (system (conc "chmod ug+x " fullrunscript)))) + ;; We are about to actually kick off the test + ;; so this is a good place to remove the records for + ;; any previous runs + ;; (db:test-remove-steps db run-id testname itemdat) + + (let* ((m (make-mutex)) + (kill-job? #f) + (exit-info (vector #t #t #t 0)) + (job-thread #f) + (keep-going #t) + (runit (lambda () + ;; (let-values + ;; (((pid exit-status exit-code) + ;; (run-n-wait fullrunscript))) + ;; (tests:test-set-status! test-id "RUNNING" "n/a" #f #f) + ;; Since we should have a clean slate at this time there is no need to do + ;; any of the other stuff that tests:test-set-status! does. Let's just + ;; force RUNNING/n/a + + + ;; (thread-sleep! 0.3) + (tests:test-force-state-status! run-id test-id "RUNNING" "n/a") + (rmt:roll-up-pass-fail-counts run-id test-name item-path "RUNNING" area-dat) + ;; (thread-sleep! 0.3) ;; NFS slowness has caused grief here + + ;; if there is a runscript do it first + (if fullrunscript + (let ((pid (process-run fullrunscript))) + (rmt:test-set-top-process-pid run-id test-id pid area-dat) + (let loop ((i 0)) + (let-values + (((pid-val exit-status exit-code) (process-wait pid #t))) + (mutex-lock! m) + (vector-set! exit-info 0 pid) + (vector-set! exit-info 1 exit-status) + (vector-set! exit-info 2 exit-code) + (vector-set! exit-info 3 exit-code) ;; rollup status + (mutex-unlock! m) + (if (eq? pid-val 0) + (begin + (thread-sleep! 2) + (loop (+ i 1))) + ))))) + ;; then, if runscript ran ok (or did not get called) + ;; do all the ezsteps (if any) + (if ezsteps + (let* ((testconfig (read-config (conc work-area "/testconfig") #f #t environ-patt: "pre-launch-env-vars")) ;; FIXME??? is allow-system ok here? + (ezstepslst (hash-table-ref/default testconfig "ezsteps" '()))) + (hash-table-set! *testconfigs* test-name testconfig) ;; cached for lazy reads later ... + (if (not (file-exists? ".ezsteps"))(create-directory ".ezsteps")) + ;; if ezsteps was defined then we are sure to have at least one step but check anyway + (if (not (> (length ezstepslst) 0)) + (debug:print 0 "ERROR: ezsteps defined but ezstepslst is zero length") + (let loop ((ezstep (car ezstepslst)) + (tal (cdr ezstepslst)) + (prevstep #f)) + ;; check exit-info (vector-ref exit-info 1) + (if (vector-ref exit-info 1) + (let ((logpro-used (launch:runstep ezstep run-id test-id exit-info m tal))) + (if (and (steprun-good? logpro-used (vector-ref exit-info 2)) + (not (null? tal))) + (loop (car tal) (cdr tal) stepname))) + (debug:print 4 "WARNING: a prior step failed, stopping at " ezstep)))))))) + (monitorjob (lambda () + (let* ((start-seconds (current-seconds)) + (calc-minutes (lambda () + (inexact->exact + (round + (- + (current-seconds) + start-seconds))))) + (kill-tries 0)) + ;; (tests:set-full-meta-info #f test-id run-id (calc-minutes) work-area) + ;; (tests:set-full-meta-info test-id run-id (calc-minutes) work-area) + (tests:set-full-meta-info #f test-id run-id (calc-minutes) work-area 10) + (let loop ((minutes (calc-minutes))) + (begin + (set! kill-job? (or (test-get-kill-request run-id test-id) ;; run-id test-name itemdat)) + (and runtlim (let* ((run-seconds (- (current-seconds) start-seconds)) + (time-exceeded (> run-seconds runtlim))) + (if time-exceeded + (begin + (debug:print-info 0 "KILLING TEST DUE TO TIME LIMIT EXCEEDED! Runtime=" run-seconds " seconds, limit=" runtlim) + #t) + #f))))) + (tests:update-central-meta-info run-id test-id (get-cpu-load) (get-df (current-directory))(calc-minutes) #f #f) + (if kill-job? + (begin + (mutex-lock! m) + ;; NOTE: The pid can change as different steps are run. Do we need handshaking between this + ;; section and the runit section? Or add a loop that tries three times with a 1/4 second + ;; between tries? + (let* ((pid1 (vector-ref exit-info 0)) + (pid2 (rmt:test-get-top-process-pid run-id test-id area-dat)) + (pids (delete-duplicates (filter number? (list pid1 pid2))))) + (if (not (null? pids)) + (begin + (for-each + (lambda (pid) + (handle-exceptions + exn + (begin + (debug:print-info 0 "Unable to kill process with pid " pid ", possibly already killed.") + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn))) + (debug:print 0 "WARNING: Request received to kill job " pid) ;; " (attempt # " kill-tries ")") + (debug:print-info 0 "Signal mask=" (signal-mask)) + ;; (if (process:alive? pid) + ;; (begin + (map (lambda (pid-num) + (process-signal pid-num signal/term)) + (process:get-sub-pids pid)) + (thread-sleep! 5) + ;; (if (process:process-alive? pid) + (map (lambda (pid-num) + (handle-exceptions + exn + #f + (process-signal pid-num signal/kill))) + (process:get-sub-pids pid)))) + ;; (debug:print-info 0 "not killing process " pid " as it is not alive")))) + pids) + (tests:test-set-status! run-id test-id "KILLED" "KILLED" (args:get-arg "-m") #f)) + (begin + (debug:print 0 "ERROR: Nothing to kill, pid1=" pid1 ", pid2=" pid2) + (tests:test-set-status! run-id test-id "KILLED" "FAILED TO KILL" (args:get-arg "-m") #f) + ))) + (mutex-unlock! m) + ;; no point in sticking around. Exit now. + (exit))) + (if keep-going + (begin + (thread-sleep! 3) ;; (+ 3 (random 6))) ;; add some jitter to the call home time to spread out the db accesses + (if keep-going + (loop (calc-minutes))))))) + (tests:update-central-meta-info run-id test-id (get-cpu-load) (get-df (current-directory))(calc-minutes) #f #f)))) ;; NOTE: Checking twice for keep-going is intentional + (th1 (make-thread monitorjob "monitor job")) + (th2 (make-thread runit "run job"))) + (set! job-thread th2) + (thread-start! th1) + (thread-start! th2) + (thread-join! th2) + (debug:print-info 0 "Megatest exectute of test " test-name ", item path " item-path " complete. Notifying the db ...") + (set! keep-going #f) + (thread-join! th1) + (thread-sleep! 1) ;; give thread th1 a chance to be done TODO: Verify this is needed. At 0.1 I was getting fail to stop, increased to total of 1.1 sec. + (mutex-lock! m) + (let* ((item-path (item-list->path itemdat)) + ;; only state and status needed - use lazy routine + (testinfo (rmt:get-testinfo-state-status run-id test-id area-dat))) + ;; Am I completed? + (if (member (db:test-get-state testinfo) '("REMOTEHOSTSTART" "RUNNING")) ;; NOTE: It should *not* be REMOTEHOSTSTART but for reasons I don't yet understand it sometimes gets stuck in that state ;; (not (equal? (db:test-get-state testinfo) "COMPLETED")) + (let ((new-state (if kill-job? "KILLED" "COMPLETED") ;; (if (eq? (vector-ref exit-info 2) 0) ;; exited with "good" status + ;; "COMPLETED" + ;; (db:test-get-state testinfo))) ;; else preseve the state as set within the test + ) + (new-status (cond + ((not (vector-ref exit-info 1)) "FAIL") ;; job failed to run + ((eq? (vector-ref exit-info 3) 0) + ;; if the current status is AUTO then defer to the calculated value (i.e. leave this AUTO) + (if (equal? (db:test-get-status testinfo) "AUTO") "AUTO" "PASS")) + ((eq? (vector-ref exit-info 3) 1) "FAIL") + ((eq? (vector-ref exit-info 3) 2) + ;; if the current status is AUTO the defer to the calculated value but qualify (i.e. make this AUTO-WARN) + (if (equal? (db:test-get-status testinfo) "AUTO") "AUTO-WARN" "WARN")) + (else "FAIL")))) ;; (db:test-get-status testinfo))) + (debug:print-info 1 "Test exited in state=" (db:test-get-state testinfo) ", setting state/status based on exit code of " (vector-ref exit-info 1) " and rollup-status of " (vector-ref exit-info 3)) + (tests:test-set-status! run-id + test-id + new-state + new-status + (args:get-arg "-m") #f) + ;; need to update the top test record if PASS or FAIL and this is a subtest + ;; NO NEED TO CALL roll-up-pass-fail-counts HERE, THIS IS DONE IN roll-up-pass-fail-counts called by tests:test-set-status! + )) + ;; for automated creation of the rollup html file this is a good place... + ;; (if (and (not (equal? item-path "")) + ;; (< (random (rmt:get-count-tests-running-for-testname run-id test-name)) 5)) + (tests:summarize-items run-id test-id test-name #f) + (tests:summarize-test run-id test-id)) ;; don't force - just update if no + (mutex-unlock! m) + (debug:print 2 "Output from running " fullrunscript ", pid " (vector-ref exit-info 0) " in work area " + work-area ":\n====\n exit code " (vector-ref exit-info 2) "\n" "====\n") + (if (not (vector-ref exit-info 1)) + (exit 4))))))) + +(define (launch:read-cached-config) + (if (get-environment-variable "MT_CMDINFO") ;; we are inside a test - do not reprocess configs + (let ((alistconfig (conc (get-environment-variable "MT_LINKTREE") "/" + (get-environment-variable "MT_TARGET") "/" + (get-environment-variable "MT_RUNNAME") "/" + ".megatest.cfg"))) + (if (file-exists? alistconfig) + (list (configf:read-alist alistconfig) + (get-environment-variable "MT_RUN_AREA_HOME")) + #f)) + #f)) + +(define (launch:read-megatest-config toppath) + (let ((runname (or (args:get-arg "-runname")(args:get-arg ":runname")))) + (if runname (setenv "MT_RUNNAME" runname)) + (find-and-read-config + (if (args:get-arg "-config")(args:get-arg "-config") "megatest.config") + environ-patt: "env-override" + given-toppath: (get-environment-variable "MT_RUN_AREA_HOME") + pathenvvar: "MT_RUN_AREA_HOME"))) + +;; set up the very basics needed for doing anything here. +(define (launch:setup-for-run area-dat #!key (force #f)) + ;; would set values for KEYS in the environment here for better support of env-override but + ;; have chicken/egg scenario. need to read megatest.config then read it again. Going to + ;; pass on that idea for now + ;; special case + (let ((configdat (megatest:area-configdat area-dat))) + (if (or force (not (hash-table? configdat))) ;; no need to re-open on every call + (let* ((newconfiginfo (or (launch:read-cached-config) ;; no config cached - give up + (launch:read-megatest-config (megatest:area-path area-dat)))) + (configdat (car newconfiginfo)) + (toppath (cadr newconfiginfo))) + (megatest:area-configinfo-set! area-dat newconfiginfo) + (megatest:area-configdat-set! area-dat configdat) + (megatest:area-path-set! area-dat toppath) + (let* ((tmptransport (configf:lookup configdat "server" "transport")) + (transport (if tmptransport (string->symbol tmptransport) 'http))) + (if (member transport '(http rpc nmsg)) + (megatest:area-transport-set! area-dat transport) + (begin + (debug:print 0 "ERROR: Unrecognised transport " transport) + (exit)))) + (let ((linktree (configf:lookup configdat "setup" "linktree"))) ;; link tree is critical + (if linktree + (if (not (file-exists? linktree)) + (begin + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Something went wrong when trying to create linktree dir at " linktree) + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) + (exit 1)) + (create-directory linktree #t)))) + (begin + (debug:print 0 "ERROR: linktree not defined in [setup] section of megatest.config") + (exit 1))) + (if linktree + (let ((dbdir (conc linktree "/.db"))) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: failed to create the " dbdir " area for your database files") + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn))) + (if (not (directory-exists? dbdir))(create-directory dbdir))) + (setenv "MT_LINKTREE" linktree)) + (begin + (debug:print 0 "ERROR: linktree is required in your megatest.config [setup] section") + (exit 1))) + (if (and toppath + (directory-exists? toppath)) + (setenv "MT_RUN_AREA_HOME" toppath) + (begin + (debug:print 0 "ERROR: failed to find the top path to your Megatest area.") + (exit 1)))) + toppath)))) + +(define (launch:cache-config area-dat) + ;; if we have a linktree and -runtests and -target and the directory exists dump the config + ;; to megatest-(current-seconds).cfg and symlink it to megatest.cfg + (let ((configdat (megatest:area-configdat area-dat))) + (if (and configdat + (args:get-arg "-runtests")) + (let* ((linktree (get-environment-variable "MT_LINKTREE")) + (target (common:args-get-target)) + (runname (or (args:get-arg "-runname") + (args:get-arg ":runname"))) + (fulldir (conc linktree "/" + target "/" + runname))) + (debug:print-info 0 "Have -runtests with target=" target ", runname=" runname ", fulldir=" fulldir) + (if (file-exists? linktree) ;; can't proceed without linktree + (begin + (if (not (file-exists? fulldir)) + (create-directory fulldir #t)) ;; need to protect with exception handler + (if (and target + runname + (file-exists? fulldir)) + (let ((tmpfile (conc fulldir "/.megatest.cfg." (current-seconds))) + (targfile (conc fulldir "/.megatest.cfg"))) + (debug:print-info 0 "Caching megatest.config in " fulldir "/.megatest.cfg") + (configf:write-alist configdat tmpfile) + (system (conc "ln -sf " tmpfile " " targfile)) + )))))))) + +(define (get-best-disk confdat) + (let* ((disks (hash-table-ref/default confdat "disks" #f)) + (minspace (let ((m (configf:lookup confdat "setup" "minspace"))) + (string->number (or m "10000"))))) + (if disks + (let ((res (common:get-disk-with-most-free-space disks minspace))) ;; min size of 1000, seems tad dumb + (if res + (cdr res) + (begin + (if (common:low-noise-print 20 "no valid disks") + (debug:print 0 "ERROR: No valid disks found in megatest.config. Please add some to your [disks] section and ensure the directory exists!")) + (exit 1))))))) + +;; Desired directory structure: +;; +;; - - -. +;; | +;; v +;; - - -|- +;; +;; dir stored in test is: +;; +;; - - [ - ] +;; +;; All log file links should be stored relative to the top of link path +;; +;; - [ - ] +;; +(define (create-work-area run-id run-info keyvals test-id test-src-path disk-path testname itemdat area-dat #!key (remtries 2)) + (let* ((configdat (megatest:area-configdat area-dat)) + (item-path (if (string? itemdat) itemdat (item-list->path itemdat))) ;; if pass in string - just use it + (runname (if (string? run-info) ;; if we pass in a string as run-info use it as run-name. + run-info + (db:get-value-by-header (db:get-rows run-info) + (db:get-header run-info) + "runname"))) + ;; convert back to db: from rdb: - this is always run at server end + (target (string-intersperse (map cadr keyvals) "/")) + + (not-iterated (equal? "" item-path)) + + ;; all tests are found at /test-base or /test-base + (testtop-base (conc target "/" runname "/" testname)) + (test-base (conc testtop-base (if not-iterated "" "/") item-path)) + + ;; nb// if itempath is not "" then it is prefixed with "/" + (toptest-path (conc disk-path "/" testtop-base)) + (test-path (conc disk-path "/" test-base)) + + ;; ensure this exists first as links to subtests must be created there + (linktree (let ((rd (config-lookup configdat "setup" "linktree"))) + (if rd rd (conc (megatest:area-path area-dat) "/runs")))) + + (lnkbase (conc linktree "/" target "/" runname)) + (lnkpath (conc lnkbase "/" testname)) + (lnkpathf (conc lnkpath (if not-iterated "" "/") item-path)) + (lnktarget (conc lnkpath "/" item-path))) + + ;; Update the rundir path in the test record for all, rundir=physical, shortdir=logical + ;; rundir shortdir + (rmt:general-call 'test-set-rundir-shortdir run-id lnkpathf test-path testname item-path area-dat) + + (debug:print 2 "INFO:\n lnkbase=" lnkbase "\n lnkpath=" lnkpath "\n toptest-path=" toptest-path "\n test-path=" test-path) + (if (not (file-exists? linktree)) + (begin + (debug:print 0 "WARNING: linktree did not exist! Creating it now at " linktree) + (create-directory linktree #t))) ;; (system (conc "mkdir -p " linktree)))) + ;; create the directory for the tests dir links, this is needed no matter what... + (if (and (not (directory-exists? lnkbase)) + (not (file-exists? lnkbase))) + (handle-exceptions + exn + (begin + (debug:print "ERROR: Problem creating linktree base at " lnkbase) + (print-error-message exn (current-error-port))) + (create-directory lnkbase #t))) + + ;; update the toptest record with its location rundir, cache the path + ;; This wass highly inefficient, one db write for every subtest, potentially + ;; thousands of unnecessary updates, cache the fact it was set and don't set it + ;; again. + + ;; Now create the link from the test path to the link tree, however + ;; if the test is iterated it is necessary to create the parent path + ;; to the iteration. use pathname-directory to trim the path by one + ;; level + (if (not not-iterated) ;; i.e. iterated + (let ((iterated-parent (pathname-directory (conc lnkpath "/" item-path)))) + (debug:print-info 2 "Creating iterated parent " iterated-parent) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create directory " iterated-parent ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-directory iterated-parent #t)))) + + (if (symbolic-link? lnkpath) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to remove symlink " lnkpath ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (delete-file lnkpath))) + + (if (not (or (file-exists? lnkpath) + (symbolic-link? lnkpath))) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create symlink " lnkpath ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-symbolic-link toptest-path lnkpath))) + + ;; NB - This was not working right - some top tests are not getting the path set!!! + ;; + ;; Do the setting of this record after the paths are created so that the shortdir can + ;; be set to the real directory location. This is safer for future clean up if the link + ;; tree is damaged or lost. + ;; + (if (not (hash-table-ref/default *toptest-paths* testname #f)) + (let* ((testinfo (rmt:get-test-info-by-id run-id test-id area-dat)) ;; run-id testname item-path)) + (curr-test-path (if testinfo ;; (filedb:get-path *fdb* + ;; (db:get-path dbstruct + ;; (rmt:sdb-qry 'getstr + (db:test-get-rundir testinfo) ;; ) ;; ) + #f))) + (hash-table-set! *toptest-paths* testname curr-test-path) + ;; NB// Was this for the test or for the parent in an iterated test? + (rmt:general-call 'test-set-rundir-shortdir run-id lnkpath + (if (file-exists? lnkpath) + (resolve-pathname lnkpath) + lnkpath) + testname "" area-dat) + ;; (rmt:general-call 'test-set-rundir run-id lnkpath testname "") ;; toptest-path) + (if (or (not curr-test-path) + (not (directory-exists? toptest-path))) + (begin + (debug:print-info 2 "Creating " toptest-path " and link " lnkpath) + (handle-exceptions + exn + #f ;; don't care to catch and deal with errors here for now. + (create-directory toptest-path #t)) + (hash-table-set! *toptest-paths* testname toptest-path))))) + + ;; The toptest path has been created, the link to the test in the linktree has + ;; been created. Now, if this is an iterated test the real test dir must be created + (if (not not-iterated) ;; this is an iterated test + (begin ;; (let ((lnktarget (conc lnkpath "/" item-path))) + (debug:print 2 "Setting up sub test run area") + (debug:print 2 " - creating run area in " test-path) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create directory " test-path ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-directory test-path #t)) + (debug:print 2 + " - creating link from: " test-path "\n" + " to: " lnktarget) + + ;; If there is already a symlink delete it and recreate it. + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to re-create link " lnktarget ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit)) + (if (symbolic-link? lnktarget) (delete-file lnktarget)) + (if (not (file-exists? lnktarget)) (create-symbolic-link test-path lnktarget))))) + + (if (not (directory? test-path)) + (create-directory test-path #t)) ;; this is a hack, I don't know why out of the blue this path does not exist sometimes + + (if (and test-src-path (directory? test-path)) + (begin + (let* ((ovrcmd (let ((cmd (config-lookup configdat "setup" "testcopycmd"))) + (if cmd + ;; substitute the TEST_SRC_PATH and TEST_TARG_PATH + (string-substitute "TEST_TARG_PATH" test-path + (string-substitute "TEST_SRC_PATH" test-src-path cmd #t) #t) + #f))) + (cmd (if ovrcmd + ovrcmd + (conc "rsync -av" (if (debug:debug-mode 1) "" "q") " " test-src-path "/ " test-path "/" + " >> " test-path "/mt_launch.log 2>> " test-path "/mt_launch.log"))) + (status (system cmd))) + (if (not (eq? status 0)) + (debug:print 2 "ERROR: problem with running \"" cmd "\""))) + (list lnkpathf lnkpath )) + (if (and test-src-path (> remtries 0)) + (begin + (debug:print 0 "ERROR: Failed to create work area at " test-path " with link at " lnktarget ", remaining attempts " remtries) + ;; + (create-work-area run-id run-info keyvals test-id test-src-path disk-path testname itemdat remtries: (- remtries 1))) + (list #f #f))))) + +;; 1. look though disks list for disk with most space +;; 2. create run dir on disk, path name is meaningful +;; 3. create link from run dir to megatest runs area +;; 4. remotely run the test on allocated host +;; - could be ssh to host from hosts table (update regularly with load) +;; - could be netbatch +;; (launch-test db (cadr status) test-conf)) +(define (launch-test test-id run-id run-info keyvals runname test-conf test-name test-path itemdat params area-dat) + (let ((toppath (megatest:area-path area-dat)) + (configdat (megatest:area-configdat area-dat))) + (change-directory toppath) + (alist->env-vars ;; consolidate this code with the code in megatest.scm for "-execute" + (list ;; (list "MT_TEST_RUN_DIR" work-area) + (list "MT_RUN_AREA_HOME" toppath) + (list "MT_TEST_NAME" test-name) + ;; (list "MT_ITEM_INFO" (conc itemdat)) + (list "MT_RUNNAME" runname) + ;; (list "MT_TARGET" mt_target) + )) + (let* ((useshell (let ((ush (config-lookup configdat "jobtools" "useshell"))) + (if ush + (if (equal? ush "no") ;; must use "no" to NOT use shell + #f + ush) + #t))) ;; default is yes + (launcher (config-lookup configdat "jobtools" "launcher")) + (runscript (config-lookup test-conf "setup" "runscript")) + (ezsteps (> (length (hash-table-ref/default test-conf "ezsteps" '())) 0)) ;; don't send all the steps, could be big + (diskspace (config-lookup test-conf "requirements" "diskspace")) + (memory (config-lookup test-conf "requirements" "memory")) + (hosts (config-lookup configdat "jobtools" "workhosts")) + (remote-megatest (config-lookup configdat "setup" "executable")) + (run-time-limit (or (configf:lookup test-conf "requirements" "runtimelim") + (configf:lookup configdat "setup" "runtimelim"))) + ;; FIXME SOMEDAY: not good how this is so obtuse, this hack is to + ;; allow running from dashboard. Extract the path + ;; from the called megatest and convert dashboard + ;; or dboard to megatest + (local-megatest (let* ((lm (car (argv))) + (dir (pathname-directory lm)) + (exe (pathname-strip-directory lm))) + (conc (if dir (conc dir "/") "") + (case (string->symbol exe) + ((dboard) "../megatest") + ((mtest) "../megatest") + ((dashboard) "megatest") + (else exe))))) + (item-path (item-list->path itemdat)) + (test-sig (conc test-name ":" item-path)) ;; (item-list->path itemdat))) ;; test-path is the full path including the item-path + (work-area #f) + (toptest-work-area #f) ;; for iterated tests the top test contains data relevant for all + (diskpath #f) + (cmdparms #f) + (fullcmd #f) ;; (define a (with-output-to-string (lambda ()(write x)))) + (mt-bindir-path #f) + (testinfo (rmt:get-test-info-by-id run-id test-id area-dat)) + (mt_target (string-intersperse (map cadr keyvals) "/")) + (debug-param (append (if (args:get-arg "-debug") (list "-debug" (args:get-arg "-debug")) '()) + (if (args:get-arg "-logging")(list "-logging") '())))) + (setenv "MT_ITEMPATH" item-path) + (if hosts (set! hosts (string-split hosts))) + ;; set the megatest to be called on the remote host + (if (not remote-megatest)(set! remote-megatest local-megatest)) ;; "megatest")) + (set! mt-bindir-path (pathname-directory remote-megatest)) + (if launcher (set! launcher (string-split launcher))) + ;; set up the run work area for this test + (if (and (args:get-arg "-preclean") ;; user has requested to preclean for this run + (not (member (db:test-get-rundir testinfo)(list "n/a" "/tmp/badname")))) ;; n/a is a placeholder and thus not a read dir + (begin + (debug:print-info 0 "attempting to preclean directory " (db:test-get-rundir testinfo) " for test " test-name "/" item-path) + (runs:remove-test-directory testinfo 'remove-data-only))) ;; remove data only, do not perturb the record + + ;; prevent overlapping actions - set to LAUNCHED as early as possible + ;; + (tests:test-set-status! run-id test-id "LAUNCHED" "n/a" #f #f) ;; (if launch-results launch-results "FAILED")) + (rmt:roll-up-pass-fail-counts run-id test-name item-path "LAUNCHED" area-dat) + (set! diskpath (get-best-disk configdat)) + (if diskpath + (let ((dat (create-work-area run-id run-info keyvals test-id test-path diskpath test-name itemdat))) + (set! work-area (car dat)) + (set! toptest-work-area (cadr dat)) + (debug:print-info 2 "Using work area " work-area)) + (begin + (set! work-area (conc test-path "/tmp_run")) + (create-directory work-area #t) + (debug:print 0 "WARNING: No disk work area specified - running in the test directory under tmp_run"))) + (set! cmdparms (base64:base64-encode + (z3:encode-buffer + (with-output-to-string + (lambda () ;; (list 'hosts hosts) + (write (list (list 'testpath test-path) + (list 'transport (conc (megatest:area-transport area-dat))) ;; + ;; (list 'serverinf *server-info*) + (list 'toppath toppath) + (list 'work-area work-area) + (list 'test-name test-name) + (list 'runscript runscript) + (list 'run-id run-id ) + (list 'test-id test-id ) + ;; (list 'item-path item-path ) + (list 'itemdat itemdat ) + (list 'megatest remote-megatest) + (list 'ezsteps ezsteps) + (list 'target mt_target) + (list 'runtlim (if run-time-limit (common:hms-string->seconds run-time-limit) #f)) + (list 'env-ovrd (hash-table-ref/default configdat "env-override" '())) + (list 'set-vars (if params (hash-table-ref/default params "-setvars" #f))) + (list 'runname runname) + (list 'mt-bindir-path mt-bindir-path)))))))) + + ;; clean out step records from previous run if they exist + ;; (rmt:delete-test-step-records run-id test-id) + (change-directory work-area) ;; so that log files from the launch process don't clutter the test dir + (cond + ((and launcher hosts) ;; must be using ssh hostname + (set! fullcmd (append launcher (car hosts)(list remote-megatest test-sig "-execute" cmdparms) debug-param))) + ;; (set! fullcmd (append launcher (car hosts)(list remote-megatest test-sig "-execute" cmdparms)))) + (launcher + (set! fullcmd (append launcher (list remote-megatest test-sig "-execute" cmdparms) debug-param))) + ;; (set! fullcmd (append launcher (list remote-megatest test-sig "-execute" cmdparms)))) + (else + (if (not useshell)(debug:print 0 "WARNING: internal launching will not work well without \"useshell yes\" in your [jobtools] section")) + (set! fullcmd (append (list remote-megatest test-sig "-execute" cmdparms) debug-param (list (if useshell "&" "")))))) + ;; (set! fullcmd (list remote-megatest test-sig "-execute" cmdparms (if useshell "&" ""))))) + (if (args:get-arg "-xterm")(set! fullcmd (append fullcmd (list "-xterm")))) + (debug:print 1 "Launching " work-area) + ;; set pre-launch-env-vars before launching, keep the vars in prevvals and put the envionment back when done + (debug:print 4 "fullcmd: " fullcmd) + (let* ((commonprevvals (alist->env-vars + (hash-table-ref/default configdat "env-override" '()))) + (testprevvals (alist->env-vars + (hash-table-ref/default test-conf "pre-launch-env-overrides" '()))) + (miscprevvals (alist->env-vars ;; consolidate this code with the code in megatest.scm for "-execute" + (append (list (list "MT_TEST_RUN_DIR" work-area) + (list "MT_TEST_NAME" test-name) + (list "MT_ITEM_INFO" (conc itemdat)) + (list "MT_RUNNAME" runname) + (list "MT_TARGET" mt_target) + (list "MT_ITEMPATH" item-path) + ) + itemdat))) + ;; Launchwait defaults to true, must override it to turn off wait + (launchwait (if (equal? (configf:lookup configdat "setup" "launchwait") "no") #f #t)) + (launch-results (apply (if launchwait + cmd-run-with-stderr->list + process-run) + (if useshell + (let ((cmdstr (string-intersperse fullcmd " "))) + (if launchwait + cmdstr + (conc cmdstr " >> mt_launch.log 2>&1"))) + (car fullcmd)) + (if useshell + '() + (cdr fullcmd))))) + (if (not launchwait) ;; give the OS a little time to allow the process to start + (thread-sleep! 0.01)) + (with-output-to-file "mt_launch.log" + (lambda () + (if (list? launch-results) + (apply print launch-results) + (print "NOTE: launched \"" fullcmd "\"\n but did not wait for it to proceed. Add the following to megatest.config \n[setup]\nlaunchwait yes\n if you have problems with this")) + #:append)) + (debug:print 2 "Launching completed, updating db") + (debug:print 2 "Launch results: " launch-results) + (if (not launch-results) + (begin + (print "ERROR: Failed to run " (string-intersperse fullcmd " ") ", exiting now") + ;; (sqlite3:finalize! db) + ;; good ole "exit" seems not to work + ;; (_exit 9) + ;; but this hack will work! Thanks go to Alan Post of the Chicken email list + ;; NB// Is this still needed? Should be safe to go back to "exit" now? + (process-signal (current-process-id) signal/kill) + )) + (alist->env-vars miscprevvals) + (alist->env-vars testprevvals) + (alist->env-vars commonprevvals) + launch-results)) + (change-directory toppath)) + ;; added paren below after refactoring above routine. must have missed something? + ) + ADDED loadwatch/launch-many Index: loadwatch/launch-many ================================================================== --- /dev/null +++ loadwatch/launch-many cannot compute difference between binary files ADDED loadwatch/queuefeeder Index: loadwatch/queuefeeder ================================================================== --- /dev/null +++ loadwatch/queuefeeder cannot compute difference between binary files ADDED loadwatch/queuefeeder-server Index: loadwatch/queuefeeder-server ================================================================== --- /dev/null +++ loadwatch/queuefeeder-server cannot compute difference between binary files ADDED megatest-fossil-hash.new Index: megatest-fossil-hash.new ================================================================== --- /dev/null +++ megatest-fossil-hash.new @@ -0,0 +1,1 @@ +(define megatest-fossil-hash "f207341131c2bfc09d36174b5a83e4963e93148a") ADDED megatest-version.scm-baseline Index: megatest-version.scm-baseline ================================================================== --- /dev/null +++ megatest-version.scm-baseline @@ -0,0 +1,7 @@ +;; Always use two or four digit decimal +;; 1.01, 1.02...1.10,1.11,1,1101 ... 1.99,2.00.. + +(declare (unit megatest-version)) + +(define megatest-version 1.6009) + ADDED megatest-version.scm-merge Index: megatest-version.scm-merge ================================================================== --- /dev/null +++ megatest-version.scm-merge @@ -0,0 +1,7 @@ +;; Always use two or four digit decimal +;; 1.01, 1.02...1.10,1.11,1,1101 ... 1.99,2.00.. + +(declare (unit megatest-version)) + +(define megatest-version 1.6013) + ADDED megatest-version.scm-original Index: megatest-version.scm-original ================================================================== --- /dev/null +++ megatest-version.scm-original @@ -0,0 +1,7 @@ +;; Always use two or four digit decimal +;; 1.01, 1.02...1.10,1.11,1,1101 ... 1.99,2.00.. + +(declare (unit megatest-version)) + +(define megatest-version 1.6014) + ADDED multi-dboard Index: multi-dboard ================================================================== --- /dev/null +++ multi-dboard cannot compute difference between binary files ADDED ndboard Index: ndboard ================================================================== --- /dev/null +++ ndboard cannot compute difference between binary files ADDED odboard Index: odboard ================================================================== --- /dev/null +++ odboard cannot compute difference between binary files ADDED readline-fix.scm Index: readline-fix.scm ================================================================== --- /dev/null +++ readline-fix.scm @@ -0,0 +1,2 @@ +(use-legacy-bindings) +(define (toplevel-command . a) #f) ADDED refdb Index: refdb ================================================================== --- /dev/null +++ refdb cannot compute difference between binary files ADDED tasks.scm.saved Index: tasks.scm.saved ================================================================== --- /dev/null +++ tasks.scm.saved @@ -0,0 +1,793 @@ +;; Copyright 2006-2012, Matthew Welland. +;; +;; This program is made available under the GNU GPL version 2.0 or +;; greater. See the accompanying file COPYING for details. +;; +;; This program is distributed WITHOUT ANY WARRANTY; without even the +;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. + +;; strftime('%m/%d/%Y %H:%M:%S','now','localtime') + +(use sqlite3 srfi-1 posix regex regex-case srfi-69 dot-locking format) +(import (prefix sqlite3 sqlite3:)) + +(declare (unit tasks)) +(declare (uses db)) +(declare (uses rmt)) +(declare (uses common)) + +(include "task_records.scm") + +;;====================================================================== +;; Tasks db +;;====================================================================== + +;; wait up to aprox n seconds for a journal to go away +;; +(define (tasks:wait-on-journal path n #!key (remove #f)(waiting-msg #f)) + (if (not (string? path)) + (debug:print 0 "ERROR: Called tasks:wait-on-journal with path=" path " (not a string)") + (let ((fullpath (conc path "-journal"))) + (handle-exceptions + exn + (begin + (print-call-chain (current-error-port)) + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) + (debug:print 0 " exn=" (condition->list exn)) + (debug:print 0 "tasks:wait-on-journal failed. Continuing on, you can ignore this call-chain") + #t) ;; if stuff goes wrong just allow it to move on + (let loop ((journal-exists (file-exists? fullpath)) + (count n)) ;; wait ten times ... + (if journal-exists + (begin + (if (and waiting-msg + (eq? (modulo n 30) 0)) + (debug:print 0 waiting-msg)) + (if (> count 0) + (begin + (thread-sleep! 1) + (loop (file-exists? fullpath) + (- count 1))) + (begin + (if remove (system (conc "rm -rf " fullpath))) + #f))) + #t)))))) + +(define (tasks:get-task-db-path) + (let* ((linktree (configf:lookup *configdat* "setup" "linktree")) + (dbpath (conc linktree "/.db"))) + dbpath)) + + + +;; If file exists AND +;; file readable +;; ==> open it +;; If file exists AND +;; file NOT readable +;; ==> open in-mem version +;; If file NOT exists +;; ==> open in-mem version +;; +(define (tasks:open-db #!key (numretries 4)) + (if *task-db* + *task-db* + (handle-exceptions + exn + (if (> numretries 0) + (begin + (print-call-chain (current-error-port)) + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) + (debug:print 0 " exn=" (condition->list exn)) + (thread-sleep! 1) + (tasks:open-db numretries (- numretries 1))) + (begin + (print-call-chain (current-error-port)) + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) + (debug:print 0 " exn=" (condition->list exn)))) + (let* ((dbpath (tasks:get-task-db-path)) + (dbfile (conc dbpath "/monitor.db")) + (avail (tasks:wait-on-journal dbpath 10)) ;; wait up to about 10 seconds for the journal to go away + (exists (file-exists? dbpath)) + (write-access (file-write-access? dbpath)) + (mdb (cond ;; what the hek is *toppath* doing here? + ((and (string? *toppath*)(file-write-access? *toppath*)) + (sqlite3:open-database dbfile)) + ((file-read-access? dbpath) (sqlite3:open-database dbfile)) + (else (sqlite3:open-database ":memory:")))) ;; (never-give-up-open-db dbpath)) + (handler (make-busy-timeout 36000))) + (if (and exists + (not write-access)) + (set! *db-write-access* write-access)) ;; only unset so other db's also can use this control + (sqlite3:set-busy-handler! mdb handler) + (db:set-sync mdb) ;; (sqlite3:execute mdb (conc "PRAGMA synchronous = 0;")) + ;; (if (or (and (not exists) + ;; (file-write-access? *toppath*)) + ;; (not (file-read-access? dbpath))) + ;; (begin + ;; + ;; TASKS QUEUE MOVED TO main.db + ;; + ;; (sqlite3:execute mdb "CREATE TABLE IF NOT EXISTS tasks_queue (id INTEGER PRIMARY KEY, + ;; action TEXT DEFAULT '', + ;; owner TEXT, + ;; state TEXT DEFAULT 'new', + ;; target TEXT DEFAULT '', + ;; name TEXT DEFAULT '', + ;; testpatt TEXT DEFAULT '', + ;; keylock TEXT, + ;; params TEXT, + ;; creation_time TIMESTAMP, + ;; execution_time TIMESTAMP);") + (sqlite3:execute mdb "CREATE TABLE IF NOT EXISTS monitors (id INTEGER PRIMARY KEY, + pid INTEGER, + start_time TIMESTAMP, + last_update TIMESTAMP, + hostname TEXT, + username TEXT, + CONSTRAINT monitors_constraint UNIQUE (pid,hostname));") + (sqlite3:execute mdb "CREATE TABLE IF NOT EXISTS servers (id INTEGER PRIMARY KEY, + pid INTEGER, + interface TEXT, + hostname TEXT, + port INTEGER, + pubport INTEGER, + start_time TIMESTAMP, + priority INTEGER, + state TEXT, + mt_version TEXT, + heartbeat TIMESTAMP, + transport TEXT, + run_id INTEGER);") + ;; CONSTRAINT servers_constraint UNIQUE (pid,hostname,port));") + (sqlite3:execute mdb "CREATE TABLE IF NOT EXISTS clients (id INTEGER PRIMARY KEY, + server_id INTEGER, + pid INTEGER, + hostname TEXT, + cmdline TEXT, + login_time TIMESTAMP, + logout_time TIMESTAMP DEFAULT -1, + CONSTRAINT clients_constraint UNIQUE (pid,hostname));") + + ;)) + (set! *task-db* (cons mdb dbpath)) + *task-db*)))) + +;;====================================================================== +;; Server and client management +;;====================================================================== + +;; make-vector-record tasks hostinfo id interface port pubport transport pid hostname +(define (tasks:hostinfo-get-id vec) (vector-ref vec 0)) +(define (tasks:hostinfo-get-interface vec) (vector-ref vec 1)) +(define (tasks:hostinfo-get-port vec) (vector-ref vec 2)) +(define (tasks:hostinfo-get-pubport vec) (vector-ref vec 3)) +(define (tasks:hostinfo-get-transport vec) (vector-ref vec 4)) +(define (tasks:hostinfo-get-pid vec) (vector-ref vec 5)) +(define (tasks:hostinfo-get-hostname vec) (vector-ref vec 6)) + +(define (tasks:server-lock-slot mdb run-id) + (tasks:server-clean-out-old-records-for-run-id mdb run-id " tasks:server-lock-slot") + (if (< (tasks:num-in-available-state mdb run-id) 4) + (begin + (tasks:server-set-available mdb run-id) + ;; (thread-sleep! 2) ;; Try removing this. It may not be needed. + (tasks:server-am-i-the-server? mdb run-id)) + #f)) + +;; register that this server may come online (first to register goes though with the process) +(define (tasks:server-set-available mdb run-id) + (sqlite3:execute + mdb + "INSERT INTO servers (pid,hostname,port,pubport,start_time, priority,state,mt_version,heartbeat, interface,transport,run_id) + VALUES(?, ?, ?, ?, strftime('%s','now'), ?, ?, ?,-1,?, ?, ?);" + (current-process-id) ;; pid + (get-host-name) ;; hostname + -1 ;; port + -1 ;; pubport + (random 1000) ;; priority (used a tiebreaker on get-available) + "available" ;; state + (common:version-signature) ;; mt_version + -1 ;; interface + "http" ;; transport + run-id + )) + +(define (tasks:num-in-available-state mdb run-id) + (let ((res 0)) + (sqlite3:for-each-row + (lambda (num-in-queue) + (set! res num-in-queue)) + mdb + "SELECT count(id) FROM servers WHERE run_id=? AND state = 'available' AND (strftime('%s','now') - start_time) < 30 ;" + run-id) + res)) + +(define (tasks:num-servers-non-zero-running mdb) + (let ((res 0)) + (sqlite3:for-each-row + (lambda (num-running) + (set! res num-running)) + mdb + "SELECT count(id) FROM servers WHERE run_id != 0 AND state = 'running';") + res)) + +(define (tasks:server-clean-out-old-records-for-run-id mdb run-id tag) + (sqlite3:execute mdb "UPDATE servers SET state=?,heartbeat=strftime('%s','now') WHERE state in ('available','dbprep','shutting-down') AND (strftime('%s','now') - start_time) > 50 AND run_id=?;" + (conc "defunct" tag) run-id)) + +(define (tasks:server-force-clean-running-records-for-run-id mdb run-id tag) + (sqlite3:execute mdb "UPDATE servers SET state=?,heartbeat=strftime('%s','now') WHERE state = 'running' AND run_id=?;" + (conc "defunct" tag) run-id)) + +(define (tasks:server-force-clean-run-record mdb run-id iface port tag) + (sqlite3:execute mdb "UPDATE servers SET state=?,heartbeat=strftime('%s','now') WHERE state = 'running' AND run_id=? AND interface=? AND port=?;" + (conc "defunct" tag) run-id iface port)) + +(define (tasks:server-delete-records-for-this-pid mdb tag) + (sqlite3:execute mdb "UPDATE servers SET state=?,heartbeat=strftime('%s','now') WHERE hostname=? AND pid=?;" + (conc "defunct" tag) (get-host-name) (current-process-id))) + +(define (tasks:server-delete-record mdb server-id tag) + (sqlite3:execute mdb "UPDATE servers SET state=?,heartbeat=strftime('%s','now') WHERE id=?;" + (conc "defunct" tag) server-id) + ;; use this opportuntity to clean out records over one month old or over 10 minutes old with port = -1 (i.e. a never used placeholder) + (sqlite3:execute mdb "DELETE FROM servers WHERE state not in ('running','shutting-down','dbprep') AND (strftime('%s','now') - start_time) > 2628000;") + (sqlite3:execute mdb "DELETE FROM servers WHERE state like 'defunct%' AND port=-1 AND (strftime('%s','now') - start_time) > 600;") + ) + +(define (tasks:server-set-state! mdb server-id state) + (sqlite3:execute mdb "UPDATE servers SET state=?,heartbeat=strftime('%s','now') WHERE id=?;" state server-id)) + +(define (tasks:server-set-interface-port mdb server-id interface port) + (sqlite3:execute mdb "UPDATE servers SET interface=?,port=?,heartbeat=strftime('%s','now') WHERE id=?;" interface port server-id)) + +;; Get random port not used in long time +;; +(define (tasks:server-get-next-port mdb) + (let* ((lownum 30000) + (highnum 64000) + (used-ports '()) + (get-rand-port (lambda () + (+ lownum (random (- highnum lownum))))) + (port-param (if (and (args:get-arg "-port") + (string->number (args:get-arg "-port"))) + (string->number (args:get-arg "-port")) + #f)) + ;; (config-port (if (and (config-lookup *configdat* "server" "port") + ;; (string->number (config-lookup *configdat* "server" "port"))) + ;; (string->number (config-lookup *configdat* "server" "port")) + ;; #f)) + ) + (sqlite3:for-each-row + (lambda (port) + (set! used-ports (cons port used-ports))) + mdb + "SELECT port FROM servers;") + (cond + ((and port-param res) (if (> res port-param) res port-param)) + (port-param port-param) + ;; ((and config-port res) (if (> res config-port) res config-port)) + ;; (config-port config-port) + (else + (let loop ((port (get-rand-port)) + (remtries 100)) + (if (member port used-ports) + (if (> remtries 0) + (loop (get-rand-port)(- remtries 1)) + (get-rand-port)) + port)))))) + +(define (tasks:server-am-i-the-server? mdb run-id) + (let* ((all (tasks:server-get-servers-vying-for-run-id mdb run-id)) + (first (if (null? all) + (begin (debug:print 0 "ERROR: no servers listed, should be at least one by now.") + (sqlite3:finalize! mdb) + (exit 1)) + (car (db:get-rows all)))) + (header (db:get-header all)) + (id (db:get-value-by-header first header "id")) + (hostname (db:get-value-by-header first header "hostname")) + (pid (db:get-value-by-header first header "pid")) + (priority (db:get-value-by-header first header "priority"))) + (debug:print 0 "INFO: am-i-the-server got record " first) + ;; for now a basic check. add tiebreaking by priority later + (if (and (equal? hostname (get-host-name)) + (equal? pid (current-process-id))) + id + #f))) + +;; Use: (db:get-value-by-header (car (db:get-rows dat)) (db:get-header dat) "fieldname") +;; to extract info from the structure returned +;; +(define (tasks:server-get-servers-vying-for-run-id mdb run-id) + (let* ((header (list "id" "hostname" "pid" "interface" "port" "pubport" "state" "run_id" "priority" "start_time")) + (selstr (string-intersperse header ",")) + (res '())) + (sqlite3:for-each-row + (lambda (a . b) + (set! res (cons (apply vector a b) res))) + mdb + (conc "SELECT " selstr " FROM servers WHERE run_id=? AND state in ('available','running','dbprep') ORDER BY start_time DESC;") + run-id) + (vector header res))) + +(define (tasks:get-server mdb run-id #!key (retries 10)) + (let ((res #f) + (best #f)) + (handle-exceptions + exn + (begin + (print-call-chain (current-error-port)) + (debug:print 0 "WARNING: tasks:get-server db access error.") + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) + (debug:print 0 " for run " run-id) + (print-call-chain (current-error-port)) + (if (> retries 0) + (begin + (debug:print 0 " trying call to tasks:get-server again in 10 seconds") + (thread-sleep! 10) + (tasks:get-server mdb run-id retries: (- retries 0))) + (debug:print 0 "10 tries of tasks:get-server all crashed and burned. Giving up and returning \"no server found\""))) + (sqlite3:for-each-row + (lambda (id interface port pubport transport pid hostname) + (set! res (vector id interface port pubport transport pid hostname))) + mdb + ;; removed: + ;; strftime('%s','now')-heartbeat < 10 AND mt_version = ? + "SELECT id,interface,port,pubport,transport,pid,hostname FROM servers + WHERE run_id=? AND state='running' + ORDER BY start_time DESC LIMIT 1;" run-id) ;; (common:version-signature) run-id) + res))) + +(define (tasks:server-running-or-starting? mdb run-id) + (let ((res #f)) + (sqlite3:for-each-row + (lambda (id) + (set! res id)) + mdb ;; NEEDS dbprep ADDED + "SELECT id FROM servers WHERE run_id=? AND (state = 'running' OR (state = 'dbprep' AND (strftime('%s','now') - start_time) < 60));" run-id) + res)) + +(define (tasks:server-running? mdb run-id) + (let ((res #f)) + (sqlite3:for-each-row + (lambda (id) + (set! res id)) + mdb ;; NEEDS dbprep ADDED + "SELECT id FROM servers WHERE run_id=? AND state = 'running';" run-id) + res)) + +(define (tasks:need-server run-id) + (let ((forced (configf:lookup *configdat* "server" "required")) + (maxqry (cdr (rmt:get-max-query-average run-id))) + (threshold (string->number (or (configf:lookup *configdat* "server" "server-query-threshold") "10")))) + (cond + (forced + (if (common:low-noise-print 60 run-id "server required is set") + (debug:print-info 0 "Server required is set, starting server.")) + #t) + ((> maxqry threshold) + (if (common:low-noise-print 60 run-id "Max query time execeeded") + (debug:print-info 0 "Max avg query time of " maxqry "ms exceeds limit of " threshold "ms, starting server.")) + #t) + (else + #f)))) + +;; try to start a server and wait for it to be available +;; +(define (tasks:start-and-wait-for-server tdbdat run-id delay-max-tries) + ;; ensure a server is running for this run + (let loop ((server-dat (tasks:get-server (db:delay-if-busy tdbdat) run-id)) + (delay-time 0)) + (if (and (not server-dat) + (< delay-time delay-max-tries)) + (begin + (if (common:low-noise-print 60 "tasks:start-and-wait-for-server" run-id) + (debug:print 0 "Try starting server for run-id " run-id)) + (server:kind-run run-id) + (thread-sleep! (min delay-time 5)) + (loop (tasks:get-server (db:delay-if-busy tdbdat) run-id)(+ delay-time 1)))))) + +(define (tasks:get-all-servers mdb) + (let ((res '())) + (sqlite3:for-each-row + (lambda (id pid hostname interface port pubport start-time priority state mt-version last-update transport run-id) + ;; 0 1 2 3 4 5 6 7 8 9 10 11 12 + (set! res (cons (vector id pid hostname interface port pubport start-time priority state mt-version last-update transport run-id) res))) + mdb + "SELECT id,pid,hostname,interface,port,pubport,start_time,priority,state,mt_version,strftime('%s','now')-heartbeat AS last_update,transport,run_id FROM servers WHERE state NOT LIKE 'defunct%' ORDER BY start_time DESC;") + res)) + +;; no elegance here ... +;; +(define (tasks:kill-server hostname pid) + (debug:print-info 0 "Attempting to kill server process " pid " on host " hostname) + (setenv "TARGETHOST" hostname) + (setenv "TARGETHOST_LOGF" "server-kills.log") + (system (conc "nbfake kill " pid)) + (unsetenv "TARGETHOST_LOGF") + (unsetenv "TARGETHOST")) + +;; look up a server by run-id and send it a kill, also delete the record for that server +;; +(define (tasks:kill-server-run-id run-id #!key (tag "default")) + (let* ((tdbdat (tasks:open-db)) + (sdat (tasks:get-server (db:delay-if-busy tdbdat) run-id))) + (if sdat + (let ((hostname (vector-ref sdat 6)) + (pid (vector-ref sdat 5)) + (server-id (vector-ref sdat 0))) + (tasks:server-set-state! (db:delay-if-busy tdbdat) server-id "killed") + (debug:print-info 0 "Killing server " server-id " for run-id " run-id " on host " hostname " with pid " pid) + (tasks:kill-server hostname pid) + (tasks:server-delete-record (db:delay-if-busy tdbdat) server-id tag) ) + (debug:print-info 0 "No server found for run-id " run-id ", nothing to kill")) + ;; (sqlite3:finalize! tdb) + )) + +;;====================================================================== +;; M O N I T O R S +;;====================================================================== + +(define (tasks:remove-monitor-record mdb) + (sqlite3:execute mdb "DELETE FROM monitors WHERE pid=? AND hostname=?;" + (current-process-id) + (get-host-name))) + +(define (tasks:get-monitors mdb) + (let ((res '())) + (sqlite3:for-each-row + (lambda (a . rem) + (set! res (cons (apply vector a rem) res))) + mdb + "SELECT id,pid,strftime('%m/%d/%Y %H:%M',datetime(start_time,'unixepoch'),'localtime'),strftime('%m/%d/%Y %H:%M:%S',datetime(last_update,'unixepoch'),'localtime'),hostname,username FROM monitors ORDER BY last_update ASC;") + (reverse res) + )) + +(define (tasks:monitors->text-table monitors) + (let ((fmtstr "~4a~8a~20a~20a~10a~10a")) + (conc (format #f fmtstr "id" "pid" "start time" "last update" "hostname" "user") "\n" + (string-intersperse + (map (lambda (monitor) + (format #f fmtstr + (tasks:monitor-get-id monitor) + (tasks:monitor-get-pid monitor) + (tasks:monitor-get-start_time monitor) + (tasks:monitor-get-last_update monitor) + (tasks:monitor-get-hostname monitor) + (tasks:monitor-get-username monitor))) + monitors) + "\n")))) + +;; update the last_update field with the current time and +;; if any monitors appear dead, remove them +(define (tasks:monitors-update mdb) + (sqlite3:execute mdb "UPDATE monitors SET last_update=strftime('%s','now') WHERE pid=? AND hostname=?;" + (current-process-id) + (get-host-name)) + (let ((deadlist '())) + (sqlite3:for-each-row + (lambda (id pid host last-update delta) + (print "Going to delete stale record for monitor with pid " pid " on host " host " last updated " delta " seconds ago") + (set! deadlist (cons id deadlist))) + mdb + "SELECT id,pid,hostname,last_update,strftime('%s','now')-last_update AS delta FROM monitors WHERE delta > 700;") + (sqlite3:execute mdb (conc "DELETE FROM monitors WHERE id IN ('" (string-intersperse (map conc deadlist) "','") "');"))) + ) +(define (tasks:register-monitor db mdb) + (let* ((pid (current-process-id)) + (hostname (get-host-name)) + (userinfo (user-information (current-user-id))) + (username (car userinfo))) + (print "Register monitor, pid: " pid ", hostname: " hostname ", username: " username) + (sqlite3:execute mdb "INSERT INTO monitors (pid,start_time,last_update,hostname,username) VALUES (?,strftime('%s','now'),strftime('%s','now'),?,?);" + pid hostname username))) + +(define (tasks:get-num-alive-monitors mdb) + (let ((res 0)) + (sqlite3:for-each-row + (lambda (count) + (set! res count)) + mdb + "SELECT count(id) FROM monitors WHERE last_update < (strftime('%s','now') - 300) AND username=?;" + (car (user-information (current-user-id)))) + res)) + +;; +(define (tasks:start-monitor db mdb) + (if (> (tasks:get-num-alive-monitors mdb) 2) ;; have two running, no need for more + (debug:print-info 1 "Not starting monitor, already have more than two running") + (let* ((megatestdb (conc *toppath* "/megatest.db")) + (monitordbf (conc (configf:lookup *configdat* "setup" "linktree") "/.db/monitor.db")) + (last-db-update 0)) ;; (file-modification-time megatestdb))) + (task:register-monitor mdb) + (let loop ((count 0) + (next-touch 0)) ;; next-touch is the time where we need to update last_update + ;; if the db has been modified we'd best look at the task queue + (let ((modtime (file-modification-time megatestdbpath ))) + (if (> modtime last-db-update) + (tasks:process-queue db mdb last-db-update megatestdb next-touch)) + ;; WARNING: Possible race conditon here!! + ;; should this update be immediately after the task-get-action call above? + (if (> (current-seconds) next-touch) + (begin + (tasks:monitors-update mdb) + (loop (+ count 1)(+ (current-seconds) 240))) + (loop (+ count 1) next-touch))))))) + +;;====================================================================== +;; T A S K S Q U E U E +;; +;; NOTE:: These operate on task_queue which is in main.db +;; +;;====================================================================== + +;; NOTE: It might be good to add one more layer of checking to ensure +;; that no task gets run in parallel. + + + +;; register a task +(define (tasks:add dbstruct action owner target runname testpatt params) + (db:with-db + dbstruct #f #t + (lambda (db) + (sqlite3:execute db "INSERT INTO tasks_queue (action,owner,state,target,name,testpatt,params,creation_time,execution_time) + VALUES (?,?,'new',?,?,?,?,strftime('%s','now'),0);" + action + owner + target + runname + testpatt + (if params params ""))))) + +(define (keys:key-vals-hash->target keys key-params) + (let ((tmp (hash-table-ref/default key-params (vector-ref (car keys) 0) ""))) + (if (> (length keys) 1) + (for-each (lambda (key) + (set! tmp (conc tmp "/" (hash-table-ref/default key-params (vector-ref key 0) "")))) + (cdr keys))) + tmp)) + +;; for use from the gui, not ported +;; +;; (define (tasks:add-from-params mdb action keys key-params var-params) +;; (let ((target (keys:key-vals-hash->target keys key-params)) +;; (owner (car (user-information (current-user-id)))) +;; (runname (hash-table-ref/default var-params "runname" #f)) +;; (testpatts (hash-table-ref/default var-params "testpatts" "%")) +;; (params (hash-table-ref/default var-params "params" ""))) +;; (tasks:add mdb action owner target runname testpatts params))) + +;; return one task from those who are 'new' OR 'waiting' AND more than 10sec old +;; +(define (tasks:snag-a-task dbstruct) + (let ((res #f) + (keytxt (conc (current-process-id) "-" (get-host-name) "-" (car (user-information (current-user-id)))))) + (db:with-db + dbstruct #f #t + (lambda (db) + ;; first randomly set a new to pid-hostname-hostname + (sqlite3:execute + db + "UPDATE tasks_queue SET keylock=? WHERE id IN + (SELECT id FROM tasks_queue + WHERE state='new' OR + (state='waiting' AND (strftime('%s','now')-execution_time) > 10) OR + state='reset' + ORDER BY RANDOM() LIMIT 1);" keytxt) + + (sqlite3:for-each-row + (lambda (id . rem) + (set! res (apply vector id rem))) + db + "SELECT id,action,owner,state,target,name,test,item,params,creation_time,execution_time FROM tasks_queue WHERE keylock=? ORDER BY execution_time ASC LIMIT 1;" keytxt) + (if res ;; yep, have work to be done + (begin + (sqlite3:execute db "UPDATE tasks_queue SET state='inprogress',execution_time=strftime('%s','now') WHERE id=?;" + (tasks:task-get-id res)) + res) + #f))))) + +(define (tasks:reset-stuck-tasks dbstruct) + (let ((res '())) + (db:with-db + dbstruct #f #t + (lambda (db) + (sqlite3:for-each-row + (lambda (id delta) + (set! res (cons id res))) + db + "SELECT id,strftime('%s','now')-execution_time AS delta FROM tasks_queue WHERE state='inprogress' AND delta>700 ORDER BY delta DESC LIMIT 2;") + (sqlite3:execute + db + (conc "UPDATE tasks_queue SET state='reset' WHERE id IN ('" (string-intersperse (map conc res) "','") "');") + ))))) + +;; return all tasks in the tasks_queue table +;; +(define (tasks:get-tasks dbstruct types states) + (let ((res '())) + (db:with-db + dbstruct #f #f + (lambda (db) + (sqlite3:for-each-row + (lambda (id . rem) + (set! res (cons (apply vector id rem) res))) + db + (conc "SELECT id,action,owner,state,target,name,test,item,params,creation_time,execution_time + FROM tasks_queue " + ;; WHERE + ;; state IN " statesstr " AND + ;; action IN " actionsstr + " ORDER BY creation_time DESC;")) + res)))) + +;; remove tasks given by a string of numbers comma separated +(define (tasks:remove-queue-entries dbstruct task-ids) + (db:with-db + dbstruct #f #t + (lambda (db) + (sqlite3:execute db (conc "DELETE FROM tasks_queue WHERE id IN (" task-ids ");"))))) + +(define (tasks:process-queue dbstruct) + (let* ((task (tasks:snag-a-task dbstruct)) + (action (if task (tasks:task-get-action task) #f))) + (if action (print "tasks:process-queue task: " task)) + (if action + (case (string->symbol action) + ((run) (tasks:start-run dbstruct task)) + ((remove) (tasks:remove-runs dbstruct task)) + ((lock) (tasks:lock-runs dbstruct task)) + ;; ((monitor) (tasks:start-monitor db task)) + ((rollup) (tasks:rollup-runs dbstruct task)) + ((updatemeta)(tasks:update-meta dbstruct task)) + ((kill) (tasks:kill-monitors dbstruct task)))))) + +(define (tasks:tasks->text tasks) + (let ((fmtstr "~10a~10a~10a~12a~20a~12a~12a~10a")) + (conc (format #f fmtstr "id" "action" "owner" "state" "target" "runname" "testpatts" "params") "\n" + (string-intersperse + (map (lambda (task) + (format #f fmtstr + (tasks:task-get-id task) + (tasks:task-get-action task) + (tasks:task-get-owner task) + (tasks:task-get-state task) + (tasks:task-get-target task) + (tasks:task-get-name task) + (tasks:task-get-test task) + ;; (tasks:task-get-item task) + (tasks:task-get-params task))) + tasks) "\n")))) + +(define (tasks:set-state dbstruct task-id state) + (db:with-db + dbstruct #f #t + (lambda (db) + (sqlite3:execute db "UPDATE tasks_queue SET state=? WHERE id=?;" + state + task-id)))) + +;;====================================================================== +;; Access using task key (stored in params; (hash-table->alist flags) hostname pid +;;====================================================================== + +(define (tasks:param-key->id dbstruct task-params) + (db:with-db + dbstruct #f #f + (lambda (db) + (handle-exceptions + exn + #f + (sqlite3:first-result db "SELECT id FROM tasks_queue WHERE params LIKE ?;" + task-params))))) + +(define (tasks:set-state-given-param-key dbstruct param-key new-state) + (db:with-db + dbstruct #f #t + (lambda (db) + (sqlite3:execute db "UPDATE tasks_queue SET state=? WHERE params LIKE ?;" new-state param-key)))) + +(define (tasks:get-records-given-param-key dbstruct param-key state-patt action-patt test-patt) + (db:with-db + dbstruct #f #f + (lambda (db) + (handle-exceptions + exn + '() + (sqlite3:first-row db "SELECT id,action,owner,state,target,name,testpatt,keylock,params WHERE + params LIKE ? AND state LIKE ? AND action LIKE ? AND testpatt LIKE ?;" + param-key state-patt action-patt test-patt))))) + + +(define (tasks:find-task-queue-records dbstruct target run-name test-patt state-patt action-patt) + ;; (handle-exceptions + ;; exn + ;; '() + ;; (sqlite3:first-row + (let ((db (db:delay-if-busy (db:get-db dbstruct #f))) + (res '())) + (sqlite3:for-each-row + (lambda (a . b) + (set! res (cons (cons a b) res))) + db "SELECT id,action,owner,state,target,name,testpatt,keylock,params FROM tasks_queue + WHERE + target = ? AND name = ? AND state LIKE ? AND action LIKE ? AND testpatt LIKE ?;" + target run-name state-patt action-patt test-patt) + res)) ;; ) + +;; kill any runner processes (i.e. processes handling -runtests) that match target/runname +;; +;; do a remote call to get the task queue info but do the killing as self here. +;; +(define (tasks:kill-runner target run-name) + (let ((records (rmt:tasks-find-task-queue-records target run-name "%" "running" "run-tests")) + (hostpid-rx (regexp "\\s+(\\w+)\\s+(\\d+)$"))) ;; host pid is at end of param string + (if (null? records) + (debug:print 0 "No run launching processes found for " target " / " run-name) + (debug:print 0 "Found " (length records) " run(s) to kill.")) + (for-each + (lambda (record) + (let* ((param-key (list-ref record 8)) + (match-dat (string-search hostpid-rx param-key))) + (if match-dat + (let ((hostname (cadr match-dat)) + (pid (string->number (caddr match-dat)))) + (debug:print 0 "Sending SIGINT to process " pid " on host " hostname) + (if (equal? (get-host-name) hostname) + (if (process:alive? pid) + (begin + (handle-exceptions + exn + (begin + (debug:print 0 "Kill of process " pid " on host " hostname " failed.") + (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) + #t) + (process-signal pid signal/int) + (thread-sleep! 5) + (if (process:alive? pid) + (process-signal pid signal/kill))))) + ;; (call-with-environment-variables + (let ((old-targethost (getenv "TARGETHOST"))) + (setenv "TARGETHOST" hostname) + (setenv "TARGETHOST_LOGF" "server-kills.log") + (system (conc "nbfake kill " pid)) + (if old-targethost (setenv "TARGETHOST" old-targethost)) + (unsetenv "TARGETHOST") + (unsetenv "TARGETHOST_LOGF")))) + (debug:print 0 "ERROR: no record or improper record for " target "/" run-name " in tasks_queue in main.db")))) + records))) + +;; (define (tasks:start-run dbstruct mdb task) +;; (let ((flags (make-hash-table))) +;; (hash-table-set! flags "-rerun" "NOT_STARTED") +;; (if (not (string=? (tasks:task-get-params task) "")) +;; (hash-table-set! flags "-setvars" (tasks:task-get-params task))) +;; (print "Starting run " task) +;; ;; sillyness, just call the damn routine with the task vector and be done with it. FIXME SOMEDAY +;; (runs:run-tests db +;; (tasks:task-get-target task) +;; (tasks:task-get-name task) +;; (tasks:task-get-test task) +;; (tasks:task-get-item task) +;; (tasks:task-get-owner task) +;; flags) +;; (tasks:set-state mdb (tasks:task-get-id task) "waiting"))) +;; +;; (define (tasks:rollup-runs db mdb task) +;; (let* ((flags (make-hash-table)) +;; (keys (db:get-keys db)) +;; (keyvals (keys:target-keyval keys (tasks:task-get-target task)))) +;; ;; (hash-table-set! flags "-rerun" "NOT_STARTED") +;; (print "Starting rollup " task) +;; ;; sillyness, just call the damn routine with the task vector and be done with it. FIXME SOMEDAY +;; (runs:rollup-run db +;; keys +;; keyvals +;; (tasks:task-get-name task) +;; (tasks:task-get-owner task)) +;; (tasks:set-state mdb (tasks:task-get-id task) "waiting"))) + ADDED testreadline Index: testreadline ================================================================== --- /dev/null +++ testreadline cannot compute difference between binary files ADDED testreadline-old Index: testreadline-old ================================================================== --- /dev/null +++ testreadline-old cannot compute difference between binary files ADDED testreadline-old.scm Index: testreadline-old.scm ================================================================== --- /dev/null +++ testreadline-old.scm @@ -0,0 +1,10 @@ +(use readline apropos) +(import readline) +(import apropos) +(gnu-history-install-file-manager + (string-append + (or (get-environment-variable "HOME") ".") "/.megatest_history")) +(current-input-port (make-gnu-readline-port "megatest> ")) +;; (current-input-port (make-readline-port)) +;; (install-history-file #f "/.csi.history") +(repl) ADDED testreadline.scm Index: testreadline.scm ================================================================== --- /dev/null +++ testreadline.scm @@ -0,0 +1,7 @@ +(use readline apropos) +(import readline) +(import apropos) +(import csi) +(current-input-port (make-readline-port)) +(install-history-file #f "/.csi.history") +(repl) DELETED tests/Makefile Index: tests/Makefile ================================================================== --- tests/Makefile +++ /dev/null @@ -1,211 +0,0 @@ -# -# run some tests - -BINPATH = $(shell readlink -m $(PWD)/../bin) -MEGATEST = $(BINPATH)/megatest -DASHBOARD = $(BINPATH)/dashboard -PATH := $(BINPATH):$(PATH) -RUNNAME := $(shell date +w%V.%u.%H.%M) -IPADDR := "-" -RUNID := 1 -SERVER = -DEBUG = 1 -LOGGING = -ROWS = 20 - -OS = $(shell grep ID /etc/*-release|cut -d= -f2) -FS = $(shell df -T .|tail -1|awk '{print $$2}') -VER = $(shell fsl info|grep checkout|awk '{print $$2}'|cut -c 1-5) - -# The NEWTARGET causes some tests to fail. Do not use until this is fixed. -NEWTARGET = "$(OS)/$(FS)/$(VER)" -TARGET = "ubuntu/nfs/none" - -all : build unit test1 test2 test3 test4 test5 test6 test7 test8 test9 - -unit : basicserver.log runs.log misc.log - -rel : - cd release;dashboard -rows 25 & - -## basicserver.log : unittests/basicserver.scm -## script -c "./rununittest.sh basicserver $(DEBUG)" basicserver.log - -%.log : build unittests/%.scm - script -c "./rununittest.sh $* $(DEBUG)" $*.log - if logpro unit.logpro $*.html < $*.log > /dev/null;then echo ALLPASS;else echo ALLFAIL;mv $*.log $*.log.FAIL;fi - -server : - cd fullrun;$(MEGATEST) -server - -debug $(DEBUG) -run-id $(RUNID) - -stopserver : - cd fullrun;$(MEGATEST) -stop-server 0 - -repl : - cd fullrun;$(MEGATEST) -:b -repl - -test0 : cleanprep - cd simplerun ; $(MEGATEST) -server - -debug $(DEBUG) - -test1 : cleanprep - -test2 : fullprep - cd fullrun;$(MEGATEST) -preclean -runtests ez_pass,runfirst/a/% -reqtarg ubuntu/nfs/none :runname $(RUNNAME) -debug $(DEBUG) $(LOGGING) - cd fullrun;megatest -preclean -runtests % -target ubuntu/nfs/none :runname $(RUNNAME)_01 -testpatt %/,%/ai -debug $(DEBUG) - cd fullrun;megatest -preclean -runtests %/,%/ai -target ubuntu/nfs/none :runname $(RUNAME)_02 -debug $(DEBUG) - cd fullrun;megatest -preclean -runtests runfirst/%,%/ai -target ubuntu/nfs/none :runname $(RUNNAME)_02 -debug $(DEBUG) - cd fullrun;megatest -runtests %/,%/winter -target ubuntu/nfs/none :runname $(RUNNAME)_03 -debug $(DEBUG) - sleep 40;cd fullrun;megatest -target ubuntu/nfs/none :runname $(RUNNAME) -set-state-status COMPLETED,FORCED :state COMPLETED :status PASS -testpatt ez_p%s,runfirst/ -debug $(DEBUG) $(LOGGING) - - -test3 : fullprep test3a test3b - -test3a : - @echo Run runfirst and any waitons. - cd fullrun;$(MEGATEST) -preclean -runtests runfirst -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b - -test3b : - @echo Run all_toplevel and all waitons - cd fullrun;$(MEGATEST) -preclean -runtests all_toplevel -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_c - -test4 : cleanprep - @echo "WARNING: No longer running fullprep, test converage may be lessened" - cd fullrun;time $(MEGATEST) -debug $(DEBUG) -run-wait -runtests % -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b -m "This is a comment specific to a run" -v $(LOGGING) - -test4a : cleanprep - cd fullrun;time $(MEGATEST) -debug $(DEBUG) -preclean -runtests all_toplevel -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b -m "This is a comment specific to a run" -v $(LOGGING) - -# NOTE: Only one instance can be a server -test5 : cleanprep - rm -f fullrun/a*.log fullrun/logs/* - @echo "WARNING: No longer running fullprep, test converage may be lessened" - cd fullrun;sleep 0;$(MEGATEST) -preclean -runtests % -target $(TARGET) :runname $(RUNNAME)_aa -debug $(DEBUG) $(LOGGING) > aa.log 2> aa.log & - cd fullrun;sleep 0;$(MEGATEST) -preclean -runtests % -target ubuntu/nfs/sleep1 :runname $(RUNNAME)_ae -debug $(DEBUG) $(LOGGING) > ae.log 2> ae.log & - cd fullrun;sleep 0;$(MEGATEST) -preclean -runtests % -target ubuntu/nfs/sleep10 :runname $(RUNNAME)_ab -debug $(DEBUG) $(LOGGING) > ab.log 2> ab.log & - cd fullrun;sleep 5;$(MEGATEST) -preclean -runtests % -target ubuntu/nfs/sleep60 :runname $(RUNNAME)_ac -debug $(DEBUG) $(LOGGING) > ac.log 2> ac.log & - cd fullrun;sleep 8;$(MEGATEST) -preclean -runtests % -target ubuntu/nfs/sleep240 :runname $(RUNNAME)_ad -debug $(DEBUG) $(LOGGING) > ad.log 2> ad.log & -# cd fullrun;sleep 0;$(MEGATEST) -preclean -runtests % -target $(TARGET) :runname $(RUNNAME)_af -debug $(DEBUG) $(LOGGING) > af.log 2> af.log & - -# MUST ADD THIS BACK IN ASAP!!!! - # cd fullrun;sleep 10;$(MEGATEST) -run-wait -target $(TARGET) :runname % -testpatt % :state RUNNING,LAUNCHED,NOT_STARTED,REMOTEHOSTSTART;echo ALL DONE - -test6: fullprep - cd fullrun;$(MEGATEST) -preclean -runtests runfirst -testpatt %/1 -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_itempatt -v - cd fullrun;$(MEGATEST) -preclean -runtests runfirst -testpatt %blahha% -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_itempatt -debug 10 - cd fullrun;$(MEGATEST) -rollup :runname newrun -target ubuntu/nfs/none -debug 10 - -test7: - @echo Only a/c testname c should remain. If there is a run a/b/c then there is a cache issue. - cd simplerun;$(DASHBOARD) & - (cd simplerun; \ - $(MEGATEST) -server - -daemonize; \ - $(MEGATEST) -remove-runs -target %/% :runname % -testpatt %; \ - $(MEGATEST) -preclean -runtests % -target a/b :runname c; sleep 5; \ - $(MEGATEST) -remove-runs -target a/c :runname c; \ - $(MEGATEST) -preclean -runtests % -target a/c :runname c; \ - $(MEGATEST) -remove-runs -target a/b :runname c -testpatt % ; \ - $(MEGATEST) -preclean -runtests % -target a/d :runname c;$(MEGATEST) -list-runs %|egrep ^Run:) > test7.log 2> test7.log - logpro test7.logpro test7.html < test7.log - @echo - @echo Run \"firefox test7.html\" to see the results. - -# This one failed with v1.55 -test8a : - cd fullrun;$(MEGATEST) -preclean -runtests priority_10_waiton_1 -target ubuntu/nfs/none :runname $(RUNNAME)_waiton_single - -test8 : test8a - cd fullrun;$(MEGATEST) -preclean -runtests lineitem_fail 1 -target ubuntu/nfs/none :runname $(RUNNAME)_singletest - cd fullrun;$(MEGATEST) -preclean -runtests runfirst/fall 1 -target ubuntu/nfs/none :runname $(RUNNAME)_singleitem - cd fullrun;$(MEGATEST) -preclean -runtests test_mt_vars/2 -target ubuntu/nfs/none :runname $(RUNNAME)_singleitem_waiton - -# Some simple checks for bootstrapping and run loop logic - -test9 : minsetup test9a test9b test9c test9d test9e - -test9a : - @echo Run super-simple mintest e, no waitons. - cd mintest;$(DASHBOARD)& - cd mintest;$(MEGATEST) -preclean -runtests e -target $(VER) -runname $(shell date +%H.%M.%S) -debug $(DEBUG) - -test9b : - @echo Run simple mintest d with one waiton c - cd mintest;$(MEGATEST) -preclean -runtests d -target $(VER) -runname `date +%H.%M.%S` -debug $(DEBUG) - -test9c : - @echo Run mintest a with full waiton chain a -> b -> c -> d -> e - cd mintest;$(MEGATEST) -preclean -runtests a -target $(VER) -runname `date +%H.%M.%S` -debug $(DEBUG) - -test9d : - @echo Run an itemized test with no items - cd mintest;$(MEGATEST) -preclean -runtests g -target $(VER) -runname `date +%H.%M.%S` -debug $(DEBUG) - -test9e : - @echo Run mintest a1 with full waiton chain with d1fail: a1 -> b1 -> c1 -> d1fail -> e1 - cd mintest;$(MEGATEST) -preclean -runtests a1 -target $(VER) -runname `date +%H.%M.%S` -debug $(DEBUG) - -test10 : - @echo Run a bunch of different targets simultaneously - (cd fullrun;$(MEGATEST) -server - ;sleep 2)& - for targ in mint/btrfs/mintdir sunos/sshfs/loc; do \ - (cd fullrun;$(MEGATEST) -preclean -runtests priority_10_waiton_1 -target $$targ :runname $(RUNNAME) &); done - for sys in ubuntu suse redhat debian;do \ - for fs in afs nfs zfs; do \ - for dpath in none tmp; do \ - (cd fullrun;$(MEGATEST) -preclean -runtests priority_10_waiton_1 -target $$sys/$$fs/$$dpath :runname $(RUNNAME) &);\ - done;done;done - -test11 : - cd fullrun;time (for a in 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 ;do (megatest -test-paths -target %/%/% > /dev/null ) & done; wait; ) - -build : ../*.scm - cd ..;make -j && make install - touch build - -cleanstart : - if killall mtest -v ;then sleep 5;killall mtest -v -9;fi;true - killall mtest -v;if [ ! $$? ];then sleep 5;killall mtest -v -9;fi - -minsetup : build - mkdir -p mintest/runs mintest/links - cd mintest;$(MEGATEST) -stop-server 0 - cd mintest;$(MEGATEST) -server - -debug $(DEBUG) > server.log 2> server.log & - sleep 3 - cd mintest;$(DASHBOARD) -rows 18 & - -cleanprep : ../*.scm Makefile */*.config build - mkdir -p fullrun/tmp/mt_runs fullrun/tmp/mt_links /tmp/$(USER)/adisk1 - rm -f */logging.db - touch cleanprep - -fullprep : cleanprep - cd fullrun;$(MEGATEST) -remove-runs :runname $(RUNNAME)% -target %/%/% -testpatt %/% - cd fullrun;$(BINPATH)/dashboard -rows 15 & - -dashboard : cleanprep - cd fullrun && $(BINPATH)/dashboard -rows $(ROWS) & - -newdashboard : cleanprep - cd fullrun && $(BINPATH)/newdashboard & - -mdboard : cleanprep - cd fullrun && $(BINPATH)/mdboard & - -remove : - cd fullrun;$(MEGATEST) -remove-runs :runname $(RUN) -testpatt % -itempatt % :sysname % :fsname % :datapath % - -clean : - rm cleanprep - -kill : - killall -v mtest main.sh dboard || true - rm -rf /tmp/.$(USER)-portlogger.db *run/db/* */megatest.db */logging.db */monitor.db fullrun/tmp/mt_*/* fullrun/tmp/mt_*/.db* fullrun/logs/*.log fullrun/*.log || true - killall -v mtest dboard || true - -hardkill : kill - sleep 2;killall -v mtest main.sh dboard -9 - -listservers : - cd fullrun;$(MEGATEST) -list-servers - -runforever : - while(ls); do runname=`date +%F-%R:%S`;(cd fullrun;$(MEGATEST) -runall -target ubuntu/nfs/none :runname $$runname;/home/matt/data/megatest/megatest -runall -target ubuntu/nfs/none :runname $$runname;/home/matt/data/megatest/megatest -runall -target ubuntu/nfs/none :runname $$runname);done DELETED tests/dep-tests/common.testconfig Index: tests/dep-tests/common.testconfig ================================================================== --- tests/dep-tests/common.testconfig +++ /dev/null @@ -1,34 +0,0 @@ -[ezsteps] -delay sleep $SPEED;echo "Delayed $SPEED seconds" - -# lookup table for waitons -# -[std] -genlib setup -test1 genlib -aggregate test1 -test2 aggregate -results test2 - -# simple removes the challenging "aggregate" dependency between test1 and test2. -# and the itempatt irregularity from genlib -> test1 -# -[simple] -test1 setup -test2 test1 -results test2 - -[test_meta] -author matt -owner matt -description This is a common testconfig shared by all the tests - -[logpro] -delay ;; Delay step logpro - (expect:required in "LogFileBody" > 0 "Delayed message" #/Delayed \d+ seconds/) - -reviewed 09/10/2011, by Matt - -[requirements] -mode itemwait - DELETED tests/dep-tests/common_itemstable.testconfig Index: tests/dep-tests/common_itemstable.testconfig ================================================================== --- tests/dep-tests/common_itemstable.testconfig +++ /dev/null @@ -1,4 +0,0 @@ -[itemstable] -VIEW layout layout layout schematic schematic schematic -CELL ntran ptran diode ntran ptran diode - DELETED tests/dep-tests/megatest.config Index: tests/dep-tests/megatest.config ================================================================== --- tests/dep-tests/megatest.config +++ /dev/null @@ -1,67 +0,0 @@ -[fields] -# this field changes the dep tree -DEPS TEXT - -# this field changes the test run time; 0 .. N or random -SPEED TEXT - -[dashboard] -pre-command xterm -geometry 180x20 -e " -post-command |& tee results.log ;echo Press any key to continue;bash -c 'read -n 1 -s'" & -testsort -event_time - -[misc] -home #{shell readlink -f $MT_RUN_AREA_HOME} -parent #{shell readlink -f $MT_RUN_AREA_HOME/..} - -[setup] -linktree #{get misc parent}/links -max_concurrent_jobs 100000 -# It is possible (but not recommended) to override the rsync command used -# to populate the test directories. For test development the following -# example can be useful -# -testcopycmd cp --remove-destination -rsv TEST_SRC_PATH/. TEST_TARG_PATH/. >> TEST_TARG_PATH/mt_launch.log 2>> TEST_TARG_PATH/mt_launch.log - -# or for hard links - -# testcopycmd cp --remove-destination -rlv TEST_SRC_PATH/. TEST_TARG_PATH/. - -# override the logview command -# -logviewer (%MTCMD%) 2> /dev/null > /dev/null - -# override the html viewer launch command -# -# htmlviewercmd firefox -new-window -htmlviewercmd arora - -[env-override] -# MT_XTERM_CMD overrides the terminal command -# MT_XTERM_CMD xterm -bg lightgreen -fg black - -## disks are: -## name host:/path/to/area -## -or- -## name /path/to/area -[disks] -disk0 #{get misc parent}/runs - -#====================================================================== -# Machine flavors -# -# These specify lists of hosts or scripts to use or call for various -# flavors of task. -# -#====================================================================== - -[flavors] - -plain hosts: xena, phoebe -strong command: NBFAKE_HOST=zeus nbfake -arm hosts: cubian - -# Uncomment these to emulate a job queue with a long time (look in bin/sleeprunner for the time) -[jobtools] -launcher nbfake -maxload 2.0 DELETED tests/dep-tests/runconfigs.config Index: tests/dep-tests/runconfigs.config ================================================================== --- tests/dep-tests/runconfigs.config +++ /dev/null @@ -1,8 +0,0 @@ -[default] - -# [DEPS/SPEED] - -[simple/0] - -[std/0] - DELETED tests/dep-tests/tests/aggregate/testconfig Index: tests/dep-tests/tests/aggregate/testconfig ================================================================== --- tests/dep-tests/tests/aggregate/testconfig +++ /dev/null @@ -1,4 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - -[requirements] -waiton #{get #{getenv DEPS} aggregate} DELETED tests/dep-tests/tests/genlib/testconfig Index: tests/dep-tests/tests/genlib/testconfig ================================================================== --- tests/dep-tests/tests/genlib/testconfig +++ /dev/null @@ -1,8 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - -[itemstable] -VIEWTYPE layout schematic - -[requirements] -waiton #{get #{getenv DEPS} genlib} -# itemmap /.* DELETED tests/dep-tests/tests/results/testconfig Index: tests/dep-tests/tests/results/testconfig ================================================================== --- tests/dep-tests/tests/results/testconfig +++ /dev/null @@ -1,5 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - -[requirements] -waiton #{get #{getenv DEPS} results} - DELETED tests/dep-tests/tests/setup/testconfig Index: tests/dep-tests/tests/setup/testconfig ================================================================== --- tests/dep-tests/tests/setup/testconfig +++ /dev/null @@ -1,2 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - DELETED tests/dep-tests/tests/test1/testconfig Index: tests/dep-tests/tests/test1/testconfig ================================================================== --- tests/dep-tests/tests/test1/testconfig +++ /dev/null @@ -1,11 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - -[include #{getenv MT_RUN_AREA_HOME}/common_itemstable.testconfig] - -[requirements] -waiton #{get #{getenv DEPS} test1} - -# itemmap maps these items back to previous test -# NB// mapping is in reverse - NOT forwards! -# -itemmap /.* DELETED tests/dep-tests/tests/test2/testconfig Index: tests/dep-tests/tests/test2/testconfig ================================================================== --- tests/dep-tests/tests/test2/testconfig +++ /dev/null @@ -1,7 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - -[include #{getenv MT_RUN_AREA_HOME}/common_itemstable.testconfig] - -[requirements] -waiton #{get #{getenv DEPS} test2} - DELETED tests/dynamic-waiton-example/common.testconfig Index: tests/dynamic-waiton-example/common.testconfig ================================================================== --- tests/dynamic-waiton-example/common.testconfig +++ /dev/null @@ -1,16 +0,0 @@ -[ezsteps] -delay sleep $SPEED;echo "Delayed $SPEED seconds" - -[requirements] -#{getenv WAITON_#{getenv MT_TEST_NAME}} - -[test_meta] -author matt -owner matt -description This is a common testconfig shared by all the tests - -[logpro] -delay ;; Delay step logpro - (expect:required in "LogFileBody" > 0 "Delayed message" #/Delayed \d+ seconds/) - -reviewed 09/10/2011, by Matt DELETED tests/dynamic-waiton-example/common_itemstable.testconfig Index: tests/dynamic-waiton-example/common_itemstable.testconfig ================================================================== --- tests/dynamic-waiton-example/common_itemstable.testconfig +++ /dev/null @@ -1,4 +0,0 @@ -[itemstable] -VIEW layout layout layout schematic schematic schematic -CELL ntran ptran diode ntran ptran diode - DELETED tests/dynamic-waiton-example/megatest.config Index: tests/dynamic-waiton-example/megatest.config ================================================================== --- tests/dynamic-waiton-example/megatest.config +++ /dev/null @@ -1,67 +0,0 @@ -[fields] -# this field changes the dep tree -DEPS TEXT - -# this field changes the test run time; 0 .. N or random -SPEED TEXT - -[dashboard] -pre-command xterm -geometry 180x20 -e " -post-command |& tee results.log ;echo Press any key to continue;bash -c 'read -n 1 -s'" & -testsort -event_time - -[misc] -home #{shell readlink -f $MT_RUN_AREA_HOME} -parent #{shell readlink -f $MT_RUN_AREA_HOME/..} - -[setup] -linktree #{get misc parent}/links -max_concurrent_jobs 100000 -# It is possible (but not recommended) to override the rsync command used -# to populate the test directories. For test development the following -# example can be useful -# -testcopycmd cp --remove-destination -rsv TEST_SRC_PATH/. TEST_TARG_PATH/. >> TEST_TARG_PATH/mt_launch.log 2>> TEST_TARG_PATH/mt_launch.log - -# or for hard links - -# testcopycmd cp --remove-destination -rlv TEST_SRC_PATH/. TEST_TARG_PATH/. - -# override the logview command -# -logviewer (%MTCMD%) 2> /dev/null > /dev/null - -# override the html viewer launch command -# -# htmlviewercmd firefox -new-window -htmlviewercmd arora - -[env-override] -# MT_XTERM_CMD overrides the terminal command -# MT_XTERM_CMD xterm -bg lightgreen -fg black - -## disks are: -## name host:/path/to/area -## -or- -## name /path/to/area -[disks] -disk0 #{get misc parent}/runs - -#====================================================================== -# Machine flavors -# -# These specify lists of hosts or scripts to use or call for various -# flavors of task. -# -#====================================================================== - -[flavors] - -plain hosts: xena, phoebe -strong command: NBFAKE_HOST=zeus nbfake -arm hosts: cubian - -# Uncomment these to emulate a job queue with a long time (look in bin/sleeprunner for the time) -[jobtools] -launcher nbfake -maxload 2.0 DELETED tests/dynamic-waiton-example/runconfigs.config Index: tests/dynamic-waiton-example/runconfigs.config ================================================================== --- tests/dynamic-waiton-example/runconfigs.config +++ /dev/null @@ -1,11 +0,0 @@ -[default] -WAITON_setup -WAITON_genlib waiton setup -WAITON_test1 waiton genlib -WAITON_aggregate waiton test1 -WAITON_test2 waiton aggregate - -# [DEPS/SPEED] - -[std/0] - DELETED tests/dynamic-waiton-example/tests/aggregate/testconfig Index: tests/dynamic-waiton-example/tests/aggregate/testconfig ================================================================== --- tests/dynamic-waiton-example/tests/aggregate/testconfig +++ /dev/null @@ -1,2 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - DELETED tests/dynamic-waiton-example/tests/genlib/testconfig Index: tests/dynamic-waiton-example/tests/genlib/testconfig ================================================================== --- tests/dynamic-waiton-example/tests/genlib/testconfig +++ /dev/null @@ -1,5 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - -[itemstable] -VIEWTYPE layout schematic - DELETED tests/dynamic-waiton-example/tests/results/testconfig Index: tests/dynamic-waiton-example/tests/results/testconfig ================================================================== --- tests/dynamic-waiton-example/tests/results/testconfig +++ /dev/null @@ -1,2 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - DELETED tests/dynamic-waiton-example/tests/setup/testconfig Index: tests/dynamic-waiton-example/tests/setup/testconfig ================================================================== --- tests/dynamic-waiton-example/tests/setup/testconfig +++ /dev/null @@ -1,2 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - DELETED tests/dynamic-waiton-example/tests/test1/testconfig Index: tests/dynamic-waiton-example/tests/test1/testconfig ================================================================== --- tests/dynamic-waiton-example/tests/test1/testconfig +++ /dev/null @@ -1,3 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - -[include #{getenv MT_RUN_AREA_HOME}/common_itemstable.testconfig] DELETED tests/dynamic-waiton-example/tests/test2/testconfig Index: tests/dynamic-waiton-example/tests/test2/testconfig ================================================================== --- tests/dynamic-waiton-example/tests/test2/testconfig +++ /dev/null @@ -1,3 +0,0 @@ -[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] - -[include #{getenv MT_RUN_AREA_HOME}/common_itemstable.testconfig] DELETED tests/fdktestqa/fdk.config Index: tests/fdktestqa/fdk.config ================================================================== --- tests/fdktestqa/fdk.config +++ /dev/null @@ -1,36 +0,0 @@ -[fields] -SYSTEM TEXT -RELEASE TEXT - -[setup] -# Adjust max_concurrent_jobs to limit how much you load your machines -# max_concurrent_jobs 150 -max_concurrent_jobs 1000 - -# This is your link path, you can move it but it is generally better to keep it stable -linktree #{shell readlink -f #{getenv MT_RUN_AREA_HOME}/../simplelinks} - -[include testqa/configs/megatest.abc.config] - -# timeout 0.025 - -[jobtools] -maxload 4 -launcher nbfake - -[server] -# timeout 0.01 -# homehost xena -# homehost 143.182.225.38 - -# force server -server-query-threshold 0 - - -[jobtools] -# launcher nbq -P ch_vp -C SLES11_EM64T_4G -Q /ciaf/fdk -launcher nbfake -maxload 4 - -# launcher bsub -q priority -o $MT_TEST_RUN_DIR/openlava.log - DELETED tests/fdktestqa/testqa/Makefile Index: tests/fdktestqa/testqa/Makefile ================================================================== --- tests/fdktestqa/testqa/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -BINDIR = $(PWD)/../../../bin -PATH := $(BINDIR):$(PATH) -MEGATEST = $(BINDIR)/megatest -DASHBOARD = $(BINDIR)/dashboard -NEWDASHBOARD = $(BINDIR)/newdashboard -RUNNAME = a -NUMTESTS = 20 - -all : - $(MEGATEST) -remove-runs -target a/b :runname c -testpatt %/% - $(MEGATEST) -runtests % -target a/b :runname c - -bigbig : - for tn in a b c d;do \ - ($(MEGATEST) -runtests % -target a/b :runname $tn & ) ; \ - done - -waitonpatt : - megatest -remove-runs -runname waitonpatt -target a/b -testpatt % - NUMTESTS=15 megatest -run -target a/b -runname waitonpatt -testpatt bigrun3/%8 - -waitonall : - megatest -remove-runs -runname waitonall -target a/b -testpatt % - NUMTESTS=20 megatest -run -target a/b -runname waitonall -testpatt alltop - -bigrun : - NUMTESTS=$(NUMTESTS) $(MEGATEST) -runtests bigrun -target a/bigrun :runname a$(shell date +%V) - -bigrun2 : - NUMTESTS=$(NUMTESTS) $(MEGATEST) -runtests bigrun2 -target a/bigrun2 :runname a$(shell date +%V) - -bigrun3 : - NUMTESTS=$(NUMTESTS) $(MEGATEST) -runtests bigrun3 -target a/bigrun3 :runname $(RUNNAME) - -dashboard : - mkdir -p ../simpleruns - $(DASHBOARD) -rows 20 & - -newdashboard : - $(NEWDASHBOARD) & - -compile : - (cd ../../..;make -j && make install) - -clean : - rm -rf ../simple*/*/* megatest.db db/* ../simple*/.db/* logs/* monitor.db DELETED tests/fdktestqa/testqa/README Index: tests/fdktestqa/testqa/README ================================================================== --- tests/fdktestqa/testqa/README +++ /dev/null @@ -1,1 +0,0 @@ -set NUMTESTS to set the number of tests that will be run. A small number (say 20) illustrates itemwait well. DELETED tests/fdktestqa/testqa/configs/megatest.abc.config Index: tests/fdktestqa/testqa/configs/megatest.abc.config ================================================================== --- tests/fdktestqa/testqa/configs/megatest.abc.config +++ /dev/null @@ -1,9 +0,0 @@ -# Valid values for state and status for steps, NB// It is not recommended you use this -[validvalues] -state start end completed - -# Job tools are more advanced ways to control how your jobs are launched -[jobtools] -# useshell yes - -[include megatest.def.config] DELETED tests/fdktestqa/testqa/configs/megatest.def.config Index: tests/fdktestqa/testqa/configs/megatest.def.config ================================================================== --- tests/fdktestqa/testqa/configs/megatest.def.config +++ /dev/null @@ -1,8 +0,0 @@ -# You can override environment variables for all your tests here -[env-override] -EXAMPLE_VAR example value - -# As you run more tests you may need to add additional disks, the names are arbitrary but must be unique -[disks] -disk0 #{scheme (nice-path "#{getenv MT_RUN_AREA_HOME}/../simpleruns")} - DELETED tests/fdktestqa/testqa/megatest.config Index: tests/fdktestqa/testqa/megatest.config ================================================================== --- tests/fdktestqa/testqa/megatest.config +++ /dev/null @@ -1,11 +0,0 @@ -[setup] -testcopycmd cp --remove-destination -rlv TEST_SRC_PATH/. TEST_TARG_PATH/. >> TEST_TARG_PATH/mt_launch.log 2>> TEST_TARG_PATH/mt_launch.log -# launchwait no - -# All these are overridden in ../fdk.config -# [jobtools] -# launcher nbfake -# launcher bsub -q priority -o $MT_TEST_RUN_DIR/openlava.log - -[include ../fdk.config] - DELETED tests/fdktestqa/testqa/runconfigs.config Index: tests/fdktestqa/testqa/runconfigs.config ================================================================== --- tests/fdktestqa/testqa/runconfigs.config +++ /dev/null @@ -1,6 +0,0 @@ -[default] -ALLTESTS see this variable - -# Your variables here are grouped by targets [SYSTEM/RELEASE] -[SYSTEM_val/RELEASE_val] -ANOTHERVAR only defined if target is SYSTEM_val/RELEASE_val DELETED tests/fdktestqa/testqa/runsuite.sh Index: tests/fdktestqa/testqa/runsuite.sh ================================================================== --- tests/fdktestqa/testqa/runsuite.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -(cd ../../..;make && make install) || exit 1 -export PATH=$PWD/../../../bin:$PATH - -for i in a b c d e f;do - # g h i j k l m n o p q r s t u v w x y z;do - megatest -runtests % -target a/b :runname $i & -done - -echo "" > num-running.log -while true; do - foo=`megatest -list-runs % | grep RUNNING | wc -l` - echo "Num running at `date` $foo" - echo "$foo at `date`" >> num-running.log - # to make the test go at a reasonable clip only gather this info ever minute - sleep 1m -done DELETED tests/fdktestqa/testqa/tests/alltop/testconfig Index: tests/fdktestqa/testqa/tests/alltop/testconfig ================================================================== --- tests/fdktestqa/testqa/tests/alltop/testconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[vars] -step1var step1.sh - -[ezsteps] -step1 megatest -list-runs $MT_RUNNAME -target $MT_TARGET -itempatt % - -# Test requirements are specified here -[requirements] -waiton setup bigrun bigrun3 bigrun2 -priority 0 - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description An example test -tags tagone,tagtwo -reviewed never DELETED tests/fdktestqa/testqa/tests/bigrun/step1.sh Index: tests/fdktestqa/testqa/tests/bigrun/step1.sh ================================================================== --- tests/fdktestqa/testqa/tests/bigrun/step1.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -if [ $NUMBER -lt 10 ];then - sleep 20 - sleep `echo 4 * $NUMBER | bc` -else - sleep 130 -fi - -if [[ $RANDOM -lt 10000 ]];then - exit 1 -else - exit 0 -fi DELETED tests/fdktestqa/testqa/tests/bigrun/testconfig Index: tests/fdktestqa/testqa/tests/bigrun/testconfig ================================================================== --- tests/fdktestqa/testqa/tests/bigrun/testconfig +++ /dev/null @@ -1,23 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[vars] -step1var step1.sh - -[ezsteps] -step1 #{get vars step1var} - -# Test requirements are specified here -[requirements] -waiton setup -priority 0 - -# Iteration for your tests are controlled by the items section -[items] -NUMBER #{scheme (string-intersperse (map number->string (sort (let loop ((a 0)(res '()))(if (<= a (or (any->number (get-environment-variable "NUMTESTS")) 2500))(loop (+ a 1)(cons a res)) res)) <)) " ")} - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description An example test -tags tagone,tagtwo -reviewed never DELETED tests/fdktestqa/testqa/tests/bigrun2/step1.sh Index: tests/fdktestqa/testqa/tests/bigrun2/step1.sh ================================================================== --- tests/fdktestqa/testqa/tests/bigrun2/step1.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# prev_test=`$MT_MEGATEST -test-paths -target $MT_TARGET :runname $MT_RUNNAME -testpatt bigrun/$NUMBER` -# if [ -e $prev_test/testconfig ]; then -# exit 0 -# else -# exit 1 -# fi - -exit 0 DELETED tests/fdktestqa/testqa/tests/bigrun2/testconfig Index: tests/fdktestqa/testqa/tests/bigrun2/testconfig ================================================================== --- tests/fdktestqa/testqa/tests/bigrun2/testconfig +++ /dev/null @@ -1,26 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -step1 step1.sh - -# Test requirements are specified here -[requirements] -waiton bigrun -priority 0 -mode itemwait -itemmap .*/ - -# Iteration for your tests are controlled by the items section -[items] -NUMBER #{scheme (string-intersperse (map (lambda (x)(conc "blah/" x)) \ - (map number->string (sort (let loop ((a 0)(res '())) \ - (if (<= a (or (any->number (get-environment-variable "NUMTESTS")) 2500)) \ - (loop (+ a 1)(cons a res)) res)) <))) " ")} - - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description An example test -tags tagone,tagtwo -reviewed never DELETED tests/fdktestqa/testqa/tests/bigrun3/step1.sh Index: tests/fdktestqa/testqa/tests/bigrun3/step1.sh ================================================================== --- tests/fdktestqa/testqa/tests/bigrun3/step1.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# prev_test=`$MT_MEGATEST -test-paths -target $MT_TARGET :runname $MT_RUNNAME -testpatt bigrun/$NUMBER` -# if [ -e $prev_test/testconfig ]; then -# exit 0 -# else -# exit 1 -# fi - -exit 0 DELETED tests/fdktestqa/testqa/tests/bigrun3/testconfig Index: tests/fdktestqa/testqa/tests/bigrun3/testconfig ================================================================== --- tests/fdktestqa/testqa/tests/bigrun3/testconfig +++ /dev/null @@ -1,33 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -step1 step1.sh - -# Test requirements are specified here -[requirements] -waiton bigrun2 -priority 0 -mode itemwait -# pattern replacement -# -# Remove everything up to the last / -# itemmap .*/ -# -# Replace foo/ with bar/ -# itemmap foo/ bar/ -# -itemmap .*/ - -# Iteration for your tests are controlled by the items section -[items] -NUMBER #{scheme (string-intersperse (map (lambda (x)(conc "blah/" x)) \ - (map number->string (sort (let loop ((a 0)(res '())) \ - (if (<= a (or (any->number (get-environment-variable "NUMTESTS")) 2500)) \ - (loop (+ a 1)(cons a res)) res)) <))) " ")} - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description An example test -tags tagone,tagtwo -reviewed never DELETED tests/fixpath.csh Index: tests/fixpath.csh ================================================================== --- tests/fixpath.csh +++ /dev/null @@ -1,1 +0,0 @@ -setenv PATH `readlink -f ../bin`:$PATH DELETED tests/fixpath.sh Index: tests/fixpath.sh ================================================================== --- tests/fixpath.sh +++ /dev/null @@ -1,1 +0,0 @@ -export PATH=$(readlink -f ../bin):$PATH DELETED tests/fslsync/megatest.config Index: tests/fslsync/megatest.config ================================================================== --- tests/fslsync/megatest.config +++ /dev/null @@ -1,20 +0,0 @@ -[fields] -YEAR TEXT -WEEKNUM TEXT -DAY TEXT - -[setup] -# Adjust max_concurrent_jobs to limit how much you load your machines -max_concurrent_jobs 50 - -# This is your link path, you can move it but it is generally better to keep it stable -linktree #{shell readlink -f #{getenv MT_RUN_AREA_HOME}/fslsynclinks} - -# Job tools are more advanced ways to control how your jobs are launched -[jobtools] -useshell yes -launcher nbfind - -# As you run more tests you may need to add additional disks, the names are arbitrary but must be unique -[disks] -disk0 #{shell readlink -f #{getenv MT_RUN_AREA_HOME}/fslsyncruns} DELETED tests/fslsync/runconfigs.config Index: tests/fslsync/runconfigs.config ================================================================== --- tests/fslsync/runconfigs.config +++ /dev/null @@ -1,5 +0,0 @@ -[default] -WORKAREA /tmp/#{getenv USER}/fslsync -FSLSAREA /tmp/#{getenv USER}/fsls -AREANAMES code data -SITENAMES #{shell cat $MT_RUN_AREA_HOME/sites.dat} DELETED tests/fslsync/sites.dat.template Index: tests/fslsync/sites.dat.template ================================================================== --- tests/fslsync/sites.dat.template +++ /dev/null @@ -1,1 +0,0 @@ -site1 DELETED tests/fslsync/tests/setup/mkdirs.logpro Index: tests/fslsync/tests/setup/mkdirs.logpro ================================================================== --- tests/fslsync/tests/setup/mkdirs.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "done" #/done/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/fslsync/tests/setup/mkdirs.sh Index: tests/fslsync/tests/setup/mkdirs.sh ================================================================== --- tests/fslsync/tests/setup/mkdirs.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -# Create needed directories both local and remote - -# Remote -ssh $SITENAME mkdir -vp $WORKAREA/$SITENAME/$AREANAME - -# Local -mkdir -vp $WORKAREA/$SITENAME/$AREANAME - -echo done DELETED tests/fslsync/tests/setup/seedcache.logpro Index: tests/fslsync/tests/setup/seedcache.logpro ================================================================== --- tests/fslsync/tests/setup/seedcache.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "done" #/done/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/fslsync/tests/setup/seedcache.sh Index: tests/fslsync/tests/setup/seedcache.sh ================================================================== --- tests/fslsync/tests/setup/seedcache.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# Copy any non-existant files to the cache before doing the rsync -# in the hopes of saving some time. - -echo done DELETED tests/fslsync/tests/setup/testconfig Index: tests/fslsync/tests/setup/testconfig ================================================================== --- tests/fslsync/tests/setup/testconfig +++ /dev/null @@ -1,21 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -mkdirs mkdirs.sh -seedcache seedcache.sh - -# Test requirements are specified here -[requirements] -priority 0 - -# Iteration for your tests are controlled by the items section -[items] -AREANAME #{getenv AREANAMES} -SITENAME #{getenv SITENAMES} - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Setup needed directories and seed the caches -tags tagone,tagtwo -reviewed never DELETED tests/fslsync/tests/sync/fsync.logpro Index: tests/fslsync/tests/sync/fsync.logpro ================================================================== --- tests/fslsync/tests/sync/fsync.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "done" #/done/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/fslsync/tests/sync/fsync.sh Index: tests/fslsync/tests/sync/fsync.sh ================================================================== --- tests/fslsync/tests/sync/fsync.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# Get the list of fossils from the cache - -FILES=$(ls $FSLSAREA/$AREANAME|grep fossil) - -# Do the remote sync from CACHE to FOSSILS -ssh $SITENAME /bin/bash < 0 "done" #/done/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/fslsync/tests/sync/rsync.sh Index: tests/fslsync/tests/sync/rsync.sh ================================================================== --- tests/fslsync/tests/sync/rsync.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -# Sync to remote cache -rsync -avz $FSLSAREA/$AREANAME/ $SITENAME:$WORKAREA/$SITENAME/$AREANAME/ & -# Sync to local cache -rsync -avz $SITENAME:$FSLSAREA/$AREANAME/ $WORKAREA/$SITENAME/$AREANAME/ & - -# Wait until rsyncs complete -wait - -echo done DELETED tests/fslsync/tests/sync/testconfig Index: tests/fslsync/tests/sync/testconfig ================================================================== --- tests/fslsync/tests/sync/testconfig +++ /dev/null @@ -1,22 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -rsync rsync.sh -fsync fsync.sh - -# Test requirements are specified here -[requirements] -waiton setup -priority 0 - -# Iteration for your tests are controlled by the items section -[items] -AREANAME #{getenv AREANAMES} -SITENAME #{getenv SITENAMES} - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Sync fossils to remote -tags tagone,tagtwo -reviewed never DELETED tests/fullrun/afs.config Index: tests/fullrun/afs.config ================================================================== --- tests/fullrun/afs.config +++ /dev/null @@ -1,1 +0,0 @@ -TESTSTORUN priority_6 sqlitespeed/ag DELETED tests/fullrun/common_runconfigs.config Index: tests/fullrun/common_runconfigs.config ================================================================== --- tests/fullrun/common_runconfigs.config +++ /dev/null @@ -1,17 +0,0 @@ -[default] -FOOBARBAZZZZ not a useful value -BIGBOB $FOOBARBAZZZZ/bobby -FREDDY $sysname/$fsname -TOMMY [system pwd] - -[/tmp/mrwellan/env/ubuntu/afs] -BOGOUS Bob - -[default/ubuntu/nfs] -CURRENT /blah -ALT_VAR we should not see this one - -[ubuntu/nfs/none] -CURRENT /tmp/nada -UNIQUEVAR this one should be set - DELETED tests/fullrun/configs/mt_include_1.config Index: tests/fullrun/configs/mt_include_1.config ================================================================== --- tests/fullrun/configs/mt_include_1.config +++ /dev/null @@ -1,23 +0,0 @@ -[setup] -# exectutable /path/to/megatest -max_concurrent_jobs 250 - -linktree #{getenv MT_RUN_AREA_HOME}/tmp/mt_links - -[jobtools] -useshell yes -# ## launcher launches jobs, the job is managed on the target host -## by megatest, comment out launcher to run local -# workhosts localhost hermes -# launcher exec nbfake - -launcher nbfake -# launcher echo - -# launcher nbfind -# launcher nodanggood - -## use "xterm -e csi -- " as a launcher to examine the launch environment. -## exit with (exit) -## get a shell with (system "bash") -# launcher xterm -e csi -- DELETED tests/fullrun/configs/mt_include_2.config Index: tests/fullrun/configs/mt_include_2.config ================================================================== --- tests/fullrun/configs/mt_include_2.config +++ /dev/null @@ -1,2 +0,0 @@ -[disks] -disk0 #{getenv MT_RUN_AREA_HOME}/tmp/mt_runs DELETED tests/fullrun/ez_pass_linked/testconfig Index: tests/fullrun/ez_pass_linked/testconfig ================================================================== --- tests/fullrun/ez_pass_linked/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] - -[ezsteps] -lookittmp ls /tmp -lookithome ls /home - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass, no logpro file. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/megatest.config Index: tests/fullrun/megatest.config ================================================================== --- tests/fullrun/megatest.config +++ /dev/null @@ -1,298 +0,0 @@ -[fields] -sysname TEXT -fsname TEXT -datapath TEXT - -# refareas can be searched to find previous runs -# the path points to where megatest.db exists -[refareas] -area1 /tmp/oldarea/megatest - -[include ./configs/mt_include_1.config] - -[dashboard] -pre-command xterm -geometry 180x20 -e " -post-command |& tee results.log ;echo Press any key to continue;bash -c 'read -n 1 -s'" & -testsort -event_time - -[misc] -home #{shell readlink -f $MT_RUN_AREA_HOME} -parent #{shell readlink -f $MT_RUN_AREA_HOME/..} -testsuite #{shell basename $MT_RUN_AREA_HOME} - -[tests-paths] -1 #{get misc parent}/simplerun/tests - -[setup] - -# turn off faststart, put monitor.db in MT_RUN_AREA_HOME/db -# and set the dbdir to /var/tmp/$USER/mt_db to enable keeping -# the raw db in /var/tmp/$USER -# -faststart no -monitordir #{getenv MT_RUN_AREA_HOME}/db -dbdir #{getenv MT_RUN_AREA_HOME}/db - -# sync more aggressively to megatest-db -megatest-db yes - -# Set launchwait to no to use the more agressive code that does not wait for the launch to complete before proceeding -# this may save a few milliseconds on launching tests -# launchwait no -waivercommentpatt ^WW\d+ [a-z].* -incomplete-timeout 1 - -# wait for runs to completely complete. yes, anything else is no -run-wait yes - -# If set to "default" the old code is used. Otherwise defaults to 200 or uses -# numeric value given. -# -runqueue 20 - -# Default runtimelim 1d 1h 1m 10s -# -runtimelim 20m - -# Deadtime - when to consider tests dead (i.e. haven't heard from them in too long) -# Number in seconds, set to 20 seconds here to trigger a little trouble. Default is -# 1800 -# -deadtime 600 - -# It is possible (but not recommended) to override the rsync command used -# to populate the test directories. For test development the following -# example can be useful -# -testcopycmd cp --remove-destination -rsv TEST_SRC_PATH/. TEST_TARG_PATH/. >> TEST_TARG_PATH/mt_launch.log 2>> TEST_TARG_PATH/mt_launch.log - -# or for hard links - -# testcopycmd cp --remove-destination -rlv TEST_SRC_PATH/. TEST_TARG_PATH/. - -# FULL or 2, NORMAL or 1, OFF or 0 -synchronous 0 -# Throttle roughly scales the db access milliseconds to seconds delay -throttle 0.2 -# Max retries allows megatest to re-check that a tests status has changed -# as tests can have transient FAIL status occasionally -maxretries 20 - -# Setup continued. -[setup] - -# override the logview command -# -logviewer (%MTCMD%) 2> /dev/null > /dev/null - -# override the html viewer launch command -# -# htmlviewercmd firefox -new-window -htmlviewercmd arora - -# -runtests automatically deletes the records for tests with the listed states on starting up a run allowing them to re-run -# (nb// this is in addition to NOT_STARTED which is automatically re-run) -# -allow-auto-rerun INCOMPLETE ZERO_ITEMS -# could add: STUCK STUCK/DEAD UNKNOWN KILLED KILLREQ PREQ_DISCARD - -[validvalues] -state start end 0 1 - 2 -status pass fail n/a 0 1 running - 2 - -# These are set before all tests, override them -# in the testconfig [pre-launch-env-overrides] section -[env-override] - - -ALL_TOPLEVEL_TESTS exit_0 exit_1 ez_exit2_fail ez_fail ez_pass ezlog_fail \ - ezlog_fail_then_pass ezlog_pass ezlog_warn lineitem_fail lineitem_pass logpro_required_fail \ - manual_example neverrun priority_1 priority_10 priority_10_waiton_1 \ - priority_3 priority_4 priority_5 priority_6 priority_7 priority_8 \ - priority_9 runfirst singletest singletest2 sqlitespeed test_mt_vars \ - ez_fail_quick test1 test2 - -# This variable is honored by the loadrunner script. The value is in percent -MAX_ALLOWED_LOAD 200 - -# MT_XTERM_CMD overrides the terminal command -# MT_XTERM_CMD xterm -bg lightgreen -fg black - -SPECIAL_ENV_VARS overide them here - should be seen at launch and in the runs -TESTVAR [system readlink -f .] -DEADVAR [system ls] -VARWITHDOLLAR $HOME/.zshrc -WACKYVAR #{system ls > /dev/null} -WACKYVAR2 #{get validvalues state} -WACKYVAR3 #{getenv USER} -WACKYVAR4 #{scheme (+ 5 6 7)} -WACKYVAR5 #{getenv sysname}/#{getenv fsname}/#{getenv datapath} -WACKYVAR6 #{scheme (args:get-arg "-target")} -PREDICTABLE the_ans -MRAH MT_RUN_AREA_HOME=#{getenv MT_RUN_AREA_HOME} -# The empty var should have a definition with null string -EMPTY_VAR - -WRAPPEDVAR This var should have the work blah thrice: \ -blah \ -blah - -MYRUNNAME1 /this/is/#{getenv MT_RUNNAME}/my/runname -MYRUNNAME2 /this/is/[system echo $MT_RUNNAME]/my/runname - - -# XTERM [system xterm] -# RUNDEAD [system exit 56] - -[server] - -# force use of server always -required yes - -# Use http instead of direct filesystem access -transport http -# transport fs -# transport nmsg - -synchronous 0 - -# If the server can't be started on this port it will try the next port until -# it succeeds -port 9080 - -# This server will keep running this number of hours after last access. -# Three minutes is 0.05 hours -# timeout 0.025 -timeout 0.061 - -# faststart; unless no, start server but proceed with writes until server started -faststart no -# faststart yes - -# Start server when average query takes longer than this -# server-query-threshold 55500 -server-query-threshold 1000 -timeout 0.01 - -# daemonize yes -# hostname #{scheme (get-host-name)} - -## disks are: -## name host:/path/to/area -## -or- -## name /path/to/area -[disks] -disk0 /foobarbazz -disk1 not-a-disk - -[include ./configs/mt_include_2.config] - -[include #{getenv USER}_testing.config] - -[jobgroups] - -# NOTE: job groups will falsely count the toplevel test as a job. If possible add N -# to your jobgroups where N is the number of parallel runs you are likely to see -# -sqlite3 6 -blockz 10 -# to your jobgroups where N is the number of parallel runs you are likely to see -# - -#====================================================================== -# Machine flavors -# -# These specify lists of hosts or scripts to use or call for various -# flavors of task. -# -#====================================================================== - -[flavors] - -plain hosts: xena, phoebe -strong command: NBFAKE_HOST=zeus nbfake -arm hosts: cubian - -[archive] - -# where to get bup executable -# bup /path/to/bup - -# use machines of these flavor -useflavors plain -targsize 2G - -# minimum space required on an archive disk before allowing archiving to start (MB) -minspace 10 - -[archive-disks] - -# Archives will be organised under these paths like this: -# / -# Within the archive the data is structured like this: -# /// -disk0 /tmp/#{getenv USER}/adisk1 - -# Uncomment these to emulate a job queue with a long time (look in bin/sleeprunner for the time) -[jobtools] -launcher #{scheme (case (string->symbol (conc (getenv "datapath"))) \ - ((none) "nbfake") \ - ((openlava) "bsub -o $MT_LINKTREE/$MT_TARGET/$MT_RUNNAME.$MT_TESTNAME-$MT_ITEM_PATH.log") \ - ((sleeprunner) "sleeprunner") \ - (else "nbfake"))} - -# launcher bsub -q priority -o $MT_TEST_RUN_DIR/openlava.log - -# launcher #{shell if which bsub > /dev/null;then echo bsub -q priority -o openlava.log;else echo sleeprunner;fi} -# launcher nbfake - -[configf:settings trim-trailing-spaces yes] - -# Override the rollup for specific tests -[testrollup] -runfirst ls - -[test] -# VAL1 has trailing spaces -VAL1 Foo -VAL2 ==>#{get test VAL1}Bar<== no spaces between Foo and Bar to pass - -ltest #{scheme (case (string->symbol (conc (getenv "datapath"))) \ - ((none) "nbfake") \ - ((openlava) "bsub -o $MT_LINKTREE/$MT_TARGET/$MT_RUNNAME.$MT_TESTNAME-$MT_ITEM_PATH.log") \ - (else "sleeprunner"))} - -#================================================================ -# Flexi-launcher -#================================================================ -# -# [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 - -[jobtools] -flexi-launcher yes - -[host-types] -general bsub -alt #{get jobtools launcher} -local nbfake -remote #{get jobtools launcher} - -[launchers] -runfirst/sum% remote -% general DELETED tests/fullrun/multi-dboard-load-all.scm Index: tests/fullrun/multi-dboard-load-all.scm ================================================================== --- tests/fullrun/multi-dboard-load-all.scm +++ /dev/null @@ -1,13 +0,0 @@ - -(require-library margs) -(load "../../common.scm") -(load "../../common_records.scm") -(load "../../margs.scm") -(load "../../megatest-version.scm") -(load "../../portlogger.scm") -(load "../../tasks.scm") -(load "../../db.scm") -(load "../../configf.scm") -(load "../../keys.scm") -(load "../../tree.scm") -(load "../../multi-dboard.scm") DELETED tests/fullrun/multi-dboard.sh Index: tests/fullrun/multi-dboard.sh ================================================================== --- tests/fullrun/multi-dboard.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -csi -I ../.. multi-dboard-load-all.scm DELETED tests/fullrun/nfs.config Index: tests/fullrun/nfs.config ================================================================== --- tests/fullrun/nfs.config +++ /dev/null @@ -1,1 +0,0 @@ -TESTSTORUN priority_4 test_mt_vars DELETED tests/fullrun/run-each-proc.sh Index: tests/fullrun/run-each-proc.sh ================================================================== --- tests/fullrun/run-each-proc.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -for x in `cat all-db-procs.txt`;do - cat > ~/.megatestrc <' '-_g'` - megatest -runtests sqlitespeed,test2,ez% -target ubuntu/nfs/none :runname $fname > $fname.log -done - - DELETED tests/fullrun/runconfigs.config Index: tests/fullrun/runconfigs.config ================================================================== --- tests/fullrun/runconfigs.config +++ /dev/null @@ -1,46 +0,0 @@ -[default] -SOMEVAR This should show up in SOMEVAR3 - -# target based getting of config file, look at afs.config and nfs.config -[include #{getenv fsname}.config] - -[include #{getenv MT_RUN_AREA_HOME}/common_runconfigs.config] - -# #{system echo 'VACKYVAR #{shell pwd}' > $MT_RUN_AREA_HOME/configs/$USER.config} -[include ./configs/#{getenv USER}.config] - - -WACKYVAR0 #{get ubuntu/nfs/none CURRENT} -WACKYVAR1 #{scheme (args:get-arg "-target")} - -[default/ubuntu/nfs] -WACKYVAR2 #{runconfigs-get CURRENT} - -[ubuntu/nfs/none] -WACKYVAR2 #{runconfigs-get CURRENT} -SOMEVAR2 This should show up in SOMEVAR4 if the target is ubuntu/nfs/none -VARWITHDOLLARSIGNS The$USER/signs/should/be/replaced/with/variable - -[default] -SOMEVAR3 #{rget SOMEVAR} -SOMEVAR4 #{rget SOMEVAR2} -SOMEVAR5 #{runconfigs-get SOMEVAR2} - -[ubuntu/nfs/all_toplevel] -TESTPATT all_toplevel - -[this/a/test] -BLAHFOO 123 - -[ubuntu/nfs/sleep1] -SLEEPRUNNER 1 - -[ubuntu/nfs/sleep10] -SLEEPRUNNER 10 - -[ubuntu/nfs/sleep60] -SLEEPRUNNER 60 - -[ubuntu/nfs/sleep240] -SLEEPRUNNER 240 - DELETED tests/fullrun/tests/all_toplevel/calcresults.logpro Index: tests/fullrun/tests/all_toplevel/calcresults.logpro ================================================================== --- tests/fullrun/tests/all_toplevel/calcresults.logpro +++ /dev/null @@ -1,140 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ("exit_0" 1 20) - ("ezlog_fail_then_pass" 1 20) - ("ezlog_pass" 1 20) - ("ez_pass" 1 20) - ("lineitem_pass" 1 20) - ("priority_1" 1 20) - ("priority_10" 1 20) - ("priority_10_waiton_1" 1 20) - ("priority_3" 1 20) - ("priority_4" 1 20) - ;; ("priority_5" 1 20) - ("priority_6" 1 20) -;; ("priority_7" 1 20) - ("priority_8" 1 20) - ("priority_9" 1 20) - ("runfirst" 7 20) - ("singletest" 1 20) - ("singletest2" 1 20) - ("special" 1 20) - ("sqlitespeed" 10 20) - ("test1" 1 20) - ("test2" 6 20) - ("test_mt_vars" 6 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - ("exit_1" 1 20) - ("ez_exit2_fail" 1 20) - ("ez_fail" 1 20) - ("ez_fail_quick" 1 20) - ("ezlog_fail" 1 20) - ("lineitem_fail" 1 20) - ("logpro_required_fail" 1 20) - ("manual_example" 1 20) - ("neverrun" 1 20))) - -(define warn-specs '(("ezlog_warn" 1 20))) - -(define nost-specs '(("wait_no_items1" 1 20) - ("wait_no_items2" 1 20) - ("wait_no_items3" 1 20) - ("wait_no_items4" 1 20) - ;; ("no_items" 1 20) - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -(expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -(expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -(expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -(expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -(expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -(expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) -(expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -(expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -(expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/fullrun/tests/all_toplevel/testconfig Index: tests/fullrun/tests/all_toplevel/testconfig ================================================================== --- tests/fullrun/tests/all_toplevel/testconfig +++ /dev/null @@ -1,8 +0,0 @@ -[ezsteps] -calcresults megatest -list-runs $MT_RUNNAME -target $MT_TARGET - -[requirements] -waiton #{getenv ALL_TOPLEVEL_TESTS} - -# This is a "toplevel" test, it does not require waitons to be non-FAIL to run -mode toplevel DELETED tests/fullrun/tests/blocktestxz/main.sh Index: tests/fullrun/tests/blocktestxz/main.sh ================================================================== --- tests/fullrun/tests/blocktestxz/main.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -$MT_MEGATEST -test-status :state $THESTATE :status $THESTATUS -setlog "nada.html" - -# By exiting with non-zero we tell Megatest to preseve the state and status -exit 1 DELETED tests/fullrun/tests/blocktestxz/testconfig Index: tests/fullrun/tests/blocktestxz/testconfig ================================================================== --- tests/fullrun/tests/blocktestxz/testconfig +++ /dev/null @@ -1,22 +0,0 @@ -[setup] -runscript main.sh - -[items] -THESTATE UNKNOWN INCOMPLETE KILLED KILLREQ STUCK BOZZLEBLONKED STUCK/DEAD -THESTATUS PASS FAIL STUCK/DEAD SKIP - -[requirements] -waiton sqlitespeed - -[test_meta] -author matt -owner bob -description This test will fail causing the dependent test "testxz"\ - to never run. This triggers the code that must determine\ - that a test will never be run and thus remove it from\ - the queue of tests to be run. - -tags first,single -reviewed 1/1/1965 - -jobgroup blockz DELETED tests/fullrun/tests/db_sync/calcresults.logpro Index: tests/fullrun/tests/db_sync/calcresults.logpro ================================================================== --- tests/fullrun/tests/db_sync/calcresults.logpro +++ /dev/null @@ -1,44 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/fullrun/tests/db_sync/dbdelta.scm Index: tests/fullrun/tests/db_sync/dbdelta.scm ================================================================== --- tests/fullrun/tests/db_sync/dbdelta.scm +++ /dev/null @@ -1,44 +0,0 @@ - -(use sql-de-lite) - -(define megatest.db (conc (get-environment-variable "MT_RUN_AREA_HOME") "/megatest.db")) - -(define runsquery "sysname||'/'||fsname||'/'||datapath||'/'||runname||'/'||runs.state||'-'||runs.status") -(define bigquery - (conc - "SELECT " runsquery "||testname||'/'||item_path||'-'||'-'||tests.state||'-'||tests.status||'-'||runs.id AS outdat FROM runs INNER JOIN tests ON runs.id=tests.run_id WHERE runs.state NOT LIKE 'deleted' AND tests.state NOT LIKE 'deleted' AND testname NOT LIKE 'db_sync' ORDER BY outdat ASC ;")) - -(print "Creating file for legacy db") -(with-output-to-file "legacy-db-dump" - (lambda () - (let ((db (open-database megatest.db))) - (query (for-each-row - (lambda (res) - (print res))) - (sql db bigquery)) - (close-database db)))) - -(define main.db (conc (get-environment-variable "MT_DBDIR") "/main.db")) - -(print "Creating file for current db") -(with-output-to-file "current-db-dump" - (lambda () - (let* ((mdb (open-database main.db)) - (run-ids (query fetch-column (sql mdb (conc "select id," runsquery " AS rq from runs ORDER BY rq ASC;")))) - (dbdir (get-environment-variable "MT_DBDIR"))) - (for-each - (lambda (rid) - (let ((dbfile (conc dbdir "/" rid ".db"))) - (if (file-exists? dbfile) - (begin - (exec (sql mdb (conc "ATTACH DATABASE '" dbfile "' AS testsdb;"))) - (query (for-each-row - (lambda (res) - (print res))) - (sql mdb bigquery)) - (exec (sql mdb "DETACH DATABASE testsdb;"))) - (print "ERROR: No file " dbfile " found")))) - run-ids) - (close-database mdb)))) - - DELETED tests/fullrun/tests/db_sync/getdbdir.scm Index: tests/fullrun/tests/db_sync/getdbdir.scm ================================================================== --- tests/fullrun/tests/db_sync/getdbdir.scm +++ /dev/null @@ -1,1 +0,0 @@ -(db:dbfile-path #f) DELETED tests/fullrun/tests/db_sync/showdiff.logpro Index: tests/fullrun/tests/db_sync/showdiff.logpro ================================================================== --- tests/fullrun/tests/db_sync/showdiff.logpro +++ /dev/null @@ -1,46 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) - -(expect:error in "LogFileBody" = 0 "Any diff is failure" #/.+/) DELETED tests/fullrun/tests/db_sync/testconfig Index: tests/fullrun/tests/db_sync/testconfig ================================================================== --- tests/fullrun/tests/db_sync/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[pre-launch-env-vars] - -MT_DBDIR #{scheme (db:dbfile-path #f)} - -[ezsteps] -calcresults csi -b dbdelta.scm -showdiff diff current-db-dump legacy-db-dump - -[requirements] -waiton #{getenv ALL_TOPLEVEL_TESTS} - -# This is a "toplevel" test, it does not require waitons to be non-FAIL to run -mode toplevel DELETED tests/fullrun/tests/dynamic_waiton/testconfig Index: tests/fullrun/tests/dynamic_waiton/testconfig ================================================================== --- tests/fullrun/tests/dynamic_waiton/testconfig +++ /dev/null @@ -1,21 +0,0 @@ -[ezsteps] -listfiles ls - -[requirements] -waiton #{scheme (string-intersperse \ - (tests:filter-test-names \ - (hash-table-keys (tests:get-all)) \ - (or (args:get-arg "-runtests") \ - (args:get-arg "-testpatt") "")) " ")} - -[items] - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass \ -but there is an items definition with no items. This should evoke an \ -error. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/exit_0/main.sh Index: tests/fullrun/tests/exit_0/main.sh ================================================================== --- tests/fullrun/tests/exit_0/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/fullrun/tests/exit_0/testconfig Index: tests/fullrun/tests/exit_0/testconfig ================================================================== --- tests/fullrun/tests/exit_0/testconfig +++ /dev/null @@ -1,15 +0,0 @@ -[setup] -runscript main.sh - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt - -[triggers] -NOT_STARTED/ xterm -e bash -s -- -RUNNING/ xterm -e bash -s -- - DELETED tests/fullrun/tests/exit_1/main.sh Index: tests/fullrun/tests/exit_1/main.sh ================================================================== --- tests/fullrun/tests/exit_1/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 1 DELETED tests/fullrun/tests/exit_1/testconfig Index: tests/fullrun/tests/exit_1/testconfig ================================================================== --- tests/fullrun/tests/exit_1/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 9 - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/ez_exit2_fail/testconfig Index: tests/fullrun/tests/ez_exit2_fail/testconfig ================================================================== --- tests/fullrun/tests/ez_exit2_fail/testconfig +++ /dev/null @@ -1,15 +0,0 @@ -[setup] - -[ezsteps] -exit2 exit 2 -lookithome ls /home - -[test_meta] -author matt -owner bob -description This test runs two steps; the first exits with\ - code 2 (a fail because not using logpro) and the second\ - is a pass - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/ez_fail/testconfig Index: tests/fullrun/tests/ez_fail/testconfig ================================================================== --- tests/fullrun/tests/ez_fail/testconfig +++ /dev/null @@ -1,19 +0,0 @@ -[setup] - -[requirements] -priority 10 - -[ezsteps] -lookittmp sleep 5s;ls /tmp -lookithome sleep 2;ls /home -# should fail on next step -lookitnada sleep 3;ls /nada -lookitusr sleep 2;ls /usr - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass, no logpro file. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/ez_fail_quick/testconfig Index: tests/fullrun/tests/ez_fail_quick/testconfig ================================================================== --- tests/fullrun/tests/ez_fail_quick/testconfig +++ /dev/null @@ -1,18 +0,0 @@ -[requirements] -priority 10 - -[ezsteps] -# should fail on next step -lookitnada ls /nada - -[triggers] -# run like this: cmd test-id test-rundir trigger -COMPLETED/FAIL xterm;echo - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which fails immediately. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/ez_pass/testconfig Index: tests/fullrun/tests/ez_pass/testconfig ================================================================== --- tests/fullrun/tests/ez_pass/testconfig +++ /dev/null @@ -1,15 +0,0 @@ -[setup] - -[ezsteps] -lookittmp sleep 1;ls /tmp -lookithome sleep 1;ls /home -isrunname1 sleep 1;echo $MYRUNNAME1 | grep -v '#f' -isrunname2 sleep 1;echo $MYRUNNAME2 | grep -v '#f' - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass, no logpro file. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/ez_pass_linked Index: tests/fullrun/tests/ez_pass_linked ================================================================== --- tests/fullrun/tests/ez_pass_linked +++ /dev/null @@ -1,1 +0,0 @@ -../ez_pass_linked/ DELETED tests/fullrun/tests/ezlog_fail/example.logpro Index: tests/fullrun/tests/ezlog_fail/example.logpro ================================================================== --- tests/fullrun/tests/ezlog_fail/example.logpro +++ /dev/null @@ -1,44 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -;; define your hooks -(hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -(hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -(hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") - -;; first ensure your run at least started -;; -(trigger "Init" #/This is a header/) -(trigger "InitEnd" #/^\s*$/) -(section "Init" "Init" "InitEnd") - -(trigger "Body" #/^.*$/) ;; anything starts the body -;; (trigger "EndBody" #/This had better never match/) - -(section "Body" "Body" "EndBody") - -(trigger "Blah2" #/^begin Blah2/) -(trigger "Blah2End" #/^end Blah2/) -(section "Blah2" "Blah2" "Blah2End") - -(expect:required in "Init" = 1 "Header" #/This is a header/) -(expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -(expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -(expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -(expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -(expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -(expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) - -;; Using match number -(expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) - -;; Comparison instead of tolerance -(expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) - -(expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -(expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "Body" = 0 "Any warning" #/WARNING/) -(expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors - -;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/fullrun/tests/ezlog_fail/lookithome.logpro Index: tests/fullrun/tests/ezlog_fail/lookithome.logpro ================================================================== --- tests/fullrun/tests/ezlog_fail/lookithome.logpro +++ /dev/null @@ -1,10 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - - -(expect:required in "LogFileBody" > 0 "Must be some files in the dir" #/.*/) - -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/fullrun/tests/ezlog_fail/lookittmp.logpro Index: tests/fullrun/tests/ezlog_fail/lookittmp.logpro ================================================================== --- tests/fullrun/tests/ezlog_fail/lookittmp.logpro +++ /dev/null @@ -1,6 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/.*/)) ;; force an error DELETED tests/fullrun/tests/ezlog_fail/testconfig Index: tests/fullrun/tests/ezlog_fail/testconfig ================================================================== --- tests/fullrun/tests/ezlog_fail/testconfig +++ /dev/null @@ -1,28 +0,0 @@ -[setup] - -[ezsteps] -lookittmp ls /tmp -lookithome ls /home - -# logpro_file input_glob -# matching file(s) will be diff'd with previous run and logpro applied -# if PASS or WARN result from logpro then WAIVER state is set -# -[waivers] -waiver_1 logpro lookittmp.log - -[waiver_rules] - -# This builtin rule is the default if there is no .logpro file -# diff diff %file1% %file2% - -# This builtin rule is applied if a .logpro file exists -# logpro diff %file1% %file2% | logpro %waivername%.logpro %waivername%.html - -[test_meta] -author matt -owner bob -description This test runs two ezstep, the first of which is expected to fail using a simple logpro file. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/ezlog_fail/waiver_1.logpro Index: tests/fullrun/tests/ezlog_fail/waiver_1.logpro ================================================================== --- tests/fullrun/tests/ezlog_fail/waiver_1.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(expect:warning in "Body" = 0 "Any warning" #/WARNING/) DELETED tests/fullrun/tests/ezlog_fail_then_pass/firststep.logpro Index: tests/fullrun/tests/ezlog_fail_then_pass/firststep.logpro ================================================================== --- tests/fullrun/tests/ezlog_fail_then_pass/firststep.logpro +++ /dev/null @@ -1,10 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - - -(expect:required in "LogFileBody" > 0 "Must be some files in the dir" #/.*/) - -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/fullrun/tests/ezlog_fail_then_pass/main.sh Index: tests/fullrun/tests/ezlog_fail_then_pass/main.sh ================================================================== --- tests/fullrun/tests/ezlog_fail_then_pass/main.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -megatest -step yepstep :state start :status n/a -ls /tmp -megatest -step yepstep :state end :status $? - -megatest -load-test-data << EOF -OPER,du, 1.2, 1.2, < , GBytes ,System didn't use too much space -EOF - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -megatest -test-status :state COMPLETED :status AUTO DELETED tests/fullrun/tests/ezlog_fail_then_pass/testconfig Index: tests/fullrun/tests/ezlog_fail_then_pass/testconfig ================================================================== --- tests/fullrun/tests/ezlog_fail_then_pass/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] - -[ezsteps] -firststep main.sh - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is logpro clean\ - but fails based on -test-data loaded. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/ezlog_pass/example.logpro Index: tests/fullrun/tests/ezlog_pass/example.logpro ================================================================== --- tests/fullrun/tests/ezlog_pass/example.logpro +++ /dev/null @@ -1,44 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -;; define your hooks -(hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -(hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -(hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") - -;; first ensure your run at least started -;; -(trigger "Init" #/This is a header/) -(trigger "InitEnd" #/^\s*$/) -(section "Init" "Init" "InitEnd") - -(trigger "Body" #/^.*$/) ;; anything starts the body -;; (trigger "EndBody" #/This had better never match/) - -(section "Body" "Body" "EndBody") - -(trigger "Blah2" #/^begin Blah2/) -(trigger "Blah2End" #/^end Blah2/) -(section "Blah2" "Blah2" "Blah2End") - -(expect:required in "Init" = 1 "Header" #/This is a header/) -(expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -(expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -(expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -(expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -(expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -(expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) - -;; Using match number -(expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) - -;; Comparison instead of tolerance -(expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) - -(expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -(expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "Body" = 0 "Any warning" #/WARNING/) -(expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors - -;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/fullrun/tests/ezlog_pass/lookittmp.logpro Index: tests/fullrun/tests/ezlog_pass/lookittmp.logpro ================================================================== --- tests/fullrun/tests/ezlog_pass/lookittmp.logpro +++ /dev/null @@ -1,10 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - - -(expect:required in "LogFileBody" > 0 "Must be some files in the dir" #/.*/) - -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/fullrun/tests/ezlog_pass/testconfig Index: tests/fullrun/tests/ezlog_pass/testconfig ================================================================== --- tests/fullrun/tests/ezlog_pass/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] - -[ezsteps] -lookittmp ls /tmp -lookithome ls /home - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass using a simple logpro file. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/ezlog_warn/lookithome.logpro Index: tests/fullrun/tests/ezlog_warn/lookithome.logpro ================================================================== --- tests/fullrun/tests/ezlog_warn/lookithome.logpro +++ /dev/null @@ -1,11 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - - -;; Force a warn for this test -(expect:required in "LogFileBody" > 0 "Must be some files in the dir" #/.*/) - -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/fullrun/tests/ezlog_warn/lookittmp.logpro Index: tests/fullrun/tests/ezlog_warn/lookittmp.logpro ================================================================== --- tests/fullrun/tests/ezlog_warn/lookittmp.logpro +++ /dev/null @@ -1,12 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - - -(expect:warning in "LogFileBody" = 0 "Any warning" #/.*/) -;; Can't have a required since it will mask the warns! Could make the warn non-overlapping with the -;; required I suppose... -;; (expect:required in "LogFileBody" > 0 "Must be some files in the dir" #/.*/) - -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/fullrun/tests/ezlog_warn/testconfig Index: tests/fullrun/tests/ezlog_warn/testconfig ================================================================== --- tests/fullrun/tests/ezlog_warn/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] - -[ezsteps] -lookittmp ls /tmp -lookithome ls $HOME - -[test_meta] -author matt -owner bob -description This test runs two ezsteps the first of which is expected to fail using a simple logpro file. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/lineitem_fail/main.sh Index: tests/fullrun/tests/lineitem_fail/main.sh ================================================================== --- tests/fullrun/tests/lineitem_fail/main.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -$MT_MEGATEST -load-test-data << EOF -foo,bar, 1.2, 1.9, > -foo,rab, 1.0e9, 10e9, 1e9 -foo,bla, 1.2, 1.9, < -foo,bal, 1.2, 1.2, < , ,Check for overload -foo,alb, 1.2, 1.2, <= , Amps,This is the high power circuit test -foo,abl, 1.2, 1.3, 0.1 -foo,bra, 1.2, pass, silly stuff -faz,bar, 10, 8mA, , ,"this is a comment" -EOF - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -# Needed to force rolling up the results and set the test to COMPLETED -$MT_MEGATEST -test-status :state COMPLETED :status AUTO - DELETED tests/fullrun/tests/lineitem_fail/testconfig Index: tests/fullrun/tests/lineitem_fail/testconfig ================================================================== --- tests/fullrun/tests/lineitem_fail/testconfig +++ /dev/null @@ -1,10 +0,0 @@ -[setup] -runscript main.sh - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/lineitem_pass/main.sh Index: tests/fullrun/tests/lineitem_pass/main.sh ================================================================== --- tests/fullrun/tests/lineitem_pass/main.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# category variable value expected tol/comp units comment -$MT_MEGATEST -load-test-data << EOF -foo, bar, 1.9, 1.8, > -foo, rab, 1.0e9, 2e9, 1e9 -foo, bla, 1.2, 1.9, < -foo, bal, -1.1, 0, < , , Check for overload -foo, alb, 1.2, 1.2, <= , Amps, This is the high power circuit test -foo, abl, 1.2, 1.3, 0.1 -foo, bra, 1.2, pass, silly stuff -faz, bar, 10, 8mA, , ,"this is a comment" -EOF - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done -# Needed to force rolling up the results and set the test to COMPLETED -$MT_MEGATEST -test-status :state COMPLETED :status AUTO DELETED tests/fullrun/tests/lineitem_pass/testconfig Index: tests/fullrun/tests/lineitem_pass/testconfig ================================================================== --- tests/fullrun/tests/lineitem_pass/testconfig +++ /dev/null @@ -1,10 +0,0 @@ -[setup] -runscript main.sh - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/logpro_required_fail/testconfig Index: tests/fullrun/tests/logpro_required_fail/testconfig ================================================================== --- tests/fullrun/tests/logpro_required_fail/testconfig +++ /dev/null @@ -1,23 +0,0 @@ -[setup] - -[ezsteps] -lookittmp ls /tmp - -[test_meta] -author matt -owner bob -description This test runs two ezstep, the first of which is expected to fail using a simple logpro file. - -[logpro] -lookittmp ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com - ;; - ;; License GPL. - ;; - (expect:required in "LogFileBody" > 0 "A file name that should never exist!" #/This is a awfully stupid file name that should never be found in the temp dir/) - ;; - ;; (expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) - ;; (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/.*/)) ;; force an error - - -tags logpro -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/manual_example/results/results.csv Index: tests/fullrun/tests/manual_example/results/results.csv ================================================================== --- tests/fullrun/tests/manual_example/results/results.csv +++ /dev/null @@ -1,1 +0,0 @@ -category, variable, expected, value, tol, units, comment DELETED tests/fullrun/tests/manual_example/runsetupxterm.sh Index: tests/fullrun/tests/manual_example/runsetupxterm.sh ================================================================== --- tests/fullrun/tests/manual_example/runsetupxterm.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -if [[ $TARGETDISPLAY = "" || $TARGETHOST = "" || $TARGETDIR = "" || $TARGETUSER = "" ]]; then - msg="You must set the TARGETDISPLAY, TARGETHOST, TARGETDIR and TARGETUSER variables for manual tests" - echo $msg - megatest -test-status :state COMPLETED :status FAIL -m $msg - exit 1 -else - megatest -step setup :state start :status n/a - xterm -display $TARGETDISPLAY -e ./setupremote.sh - megatest -step setup :state end :status $? -fi - DELETED tests/fullrun/tests/manual_example/setupremote.sh Index: tests/fullrun/tests/manual_example/setupremote.sh ================================================================== --- tests/fullrun/tests/manual_example/setupremote.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -megatest -step rsyncto :state start :status n/a -echo "First, lets populate your area with necessary files, you may be prompted for your Unix password several times" -rsync -avz $MT_TEST_RUN_DIR/ $TARGETUSER@$TARGETHOST:$TARGETDIR -megatest -step rsyncto :state end :status n/a - -megatest -step runtest :state start :status n/a -remotecmd="cd $TARGETDIR;xterm -display $TARGETDISPLAY" -echo Launching $remotecmd on $TARGETHOST as $TARGETUSER -ssh $TARGETUSER@$TARGETHOST $remotecmd -megatest -step runtest :state end :status $? - -megatest -step gatherdata :state start :status n/a -rsync -avz $TARGETUSER@$TARGETHOST:$TARGETDIR/results/ $MT_TEST_RUN_DIR/results/ -if [[ -e $MT_TEST_RUN_DIR/results/results.csv ]]; then - megatest -load-test-data < $MT_TEST_RUN_DIR/results/results.csv -fi - -if [[ -e $MT_TEST_RUN_DIR/results/final_results.log && $MT_TEST_RUN_DIR/final_results.logpro ]]; then - logpro $MT_TEST_RUN_DIR/final_results.logpro $MT_TEST_RUN_DIR/final_results.html < $MT_TEST_RUN_DIR/results/final_results.log - if [[ $? = 0 ]]; then - finalstatus=PASS - else - finalstatus=FAIL - fi - megatest -test-status :state COMPLETED :status $finalstatus -setlog final_results.html -fi DELETED tests/fullrun/tests/manual_example/testconfig Index: tests/fullrun/tests/manual_example/testconfig ================================================================== --- tests/fullrun/tests/manual_example/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] - -[ezsteps] -setup ./runsetupxterm.sh -# launch launchxterm - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass\ - using a simple logpro file. -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/neverrun/testconfig Index: tests/fullrun/tests/neverrun/testconfig ================================================================== --- tests/fullrun/tests/neverrun/testconfig +++ /dev/null @@ -1,4 +0,0 @@ -[setup] -runscript idontexist - - DELETED tests/fullrun/tests/no_items/testconfig Index: tests/fullrun/tests/no_items/testconfig ================================================================== --- tests/fullrun/tests/no_items/testconfig +++ /dev/null @@ -1,15 +0,0 @@ -[ezsteps] -listfiles ls - -[items] -FOO - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass \ -but there is an items definition with no items. This should evoke an \ -error. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/priority_1/main.sh Index: tests/fullrun/tests/priority_1/main.sh ================================================================== --- tests/fullrun/tests/priority_1/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/fullrun/tests/priority_1/testconfig Index: tests/fullrun/tests/priority_1/testconfig ================================================================== --- tests/fullrun/tests/priority_1/testconfig +++ /dev/null @@ -1,17 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 1 - -[test_meta] -jobgroup sqlite3 -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt - -[triggers] -COMPLETED/ echo $MT_TEST_NAME > $MT_RUN_AREA_HOME/foo DELETED tests/fullrun/tests/priority_10/main.sh Index: tests/fullrun/tests/priority_10/main.sh ================================================================== --- tests/fullrun/tests/priority_10/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/fullrun/tests/priority_10/testconfig Index: tests/fullrun/tests/priority_10/testconfig ================================================================== --- tests/fullrun/tests/priority_10/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 10 - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/priority_10_waiton_1/main.sh Index: tests/fullrun/tests/priority_10_waiton_1/main.sh ================================================================== --- tests/fullrun/tests/priority_10_waiton_1/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/fullrun/tests/priority_10_waiton_1/testconfig Index: tests/fullrun/tests/priority_10_waiton_1/testconfig ================================================================== --- tests/fullrun/tests/priority_10_waiton_1/testconfig +++ /dev/null @@ -1,14 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 10 -waiton priority_1 - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/priority_2/main.sh Index: tests/fullrun/tests/priority_2/main.sh ================================================================== --- tests/fullrun/tests/priority_2/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 5 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/fullrun/tests/priority_2/testconfig Index: tests/fullrun/tests/priority_2/testconfig ================================================================== --- tests/fullrun/tests/priority_2/testconfig +++ /dev/null @@ -1,16 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 2 -# runtimelim 1d 1h 1m 10s -runtimelim 20s - -[test_meta] -jobgroup sqlite3 -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/priority_3/README Index: tests/fullrun/tests/priority_3/README ================================================================== --- tests/fullrun/tests/priority_3/README +++ /dev/null @@ -1,3 +0,0 @@ -This test used to look for envfile.txt but that file should NOT have been there. - -By changing to lookithome.log it is possible that an error is masked. DELETED tests/fullrun/tests/priority_3/main.sh Index: tests/fullrun/tests/priority_3/main.sh ================================================================== --- tests/fullrun/tests/priority_3/main.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - echo "
Results$i
Nothing but faux results here!" > results$i.html - $MT_MEGATEST -step step$i :state end :status 0 -done - -# get a previous test -export EZFAILPATH=`$MT_MEGATEST -test-files lookithome.log -target $MT_TARGET :runname $MT_RUNNAME -testpatt ez_fail` -if [[ -e $EZFAILPATH ]];then - echo All good! -else - echo NOT good! - exit 1 -fi - -exit 0 DELETED tests/fullrun/tests/priority_3/testconfig Index: tests/fullrun/tests/priority_3/testconfig ================================================================== --- tests/fullrun/tests/priority_3/testconfig +++ /dev/null @@ -1,15 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 3 - - -[test_meta] -jobgroup sqlite3 -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/priority_4/main.sh Index: tests/fullrun/tests/priority_4/main.sh ================================================================== --- tests/fullrun/tests/priority_4/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/fullrun/tests/priority_4/testconfig Index: tests/fullrun/tests/priority_4/testconfig ================================================================== --- tests/fullrun/tests/priority_4/testconfig +++ /dev/null @@ -1,14 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 4 - -[test_meta] -jobgroup sqlite3 -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/priority_5/main.sh Index: tests/fullrun/tests/priority_5/main.sh ================================================================== --- tests/fullrun/tests/priority_5/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/fullrun/tests/priority_5/testconfig Index: tests/fullrun/tests/priority_5/testconfig ================================================================== --- tests/fullrun/tests/priority_5/testconfig +++ /dev/null @@ -1,16 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 5 - -[skip] -prevrunning #t - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/priority_6/main.sh Index: tests/fullrun/tests/priority_6/main.sh ================================================================== --- tests/fullrun/tests/priority_6/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/fullrun/tests/priority_6/testconfig Index: tests/fullrun/tests/priority_6/testconfig ================================================================== --- tests/fullrun/tests/priority_6/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 6 - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/priority_7/main.sh Index: tests/fullrun/tests/priority_7/main.sh ================================================================== --- tests/fullrun/tests/priority_7/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/fullrun/tests/priority_7/testconfig Index: tests/fullrun/tests/priority_7/testconfig ================================================================== --- tests/fullrun/tests/priority_7/testconfig +++ /dev/null @@ -1,17 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 7 - -[skip] -# Run only if this much time since last run of this test -rundelay 10m 5s - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/priority_8/main.sh Index: tests/fullrun/tests/priority_8/main.sh ================================================================== --- tests/fullrun/tests/priority_8/main.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - echo "start step before $i: `date`" - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - echo "start step after $i: `date`" - sleep 2 - echo "end step before $i: `date`" - $MT_MEGATEST -step step$i :state end :status 0 - echo "end step after $i: `date`" -done - -exit 0 DELETED tests/fullrun/tests/priority_8/testconfig Index: tests/fullrun/tests/priority_8/testconfig ================================================================== --- tests/fullrun/tests/priority_8/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 8 - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/priority_9/main.sh Index: tests/fullrun/tests/priority_9/main.sh ================================================================== --- tests/fullrun/tests/priority_9/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/fullrun/tests/priority_9/testconfig Index: tests/fullrun/tests/priority_9/testconfig ================================================================== --- tests/fullrun/tests/priority_9/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 9 - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/runfirst/main.sh Index: tests/fullrun/tests/runfirst/main.sh ================================================================== --- tests/fullrun/tests/runfirst/main.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# (export DISPLAY=:0;xterm) - -# megatest -step wasting_time :state start :status n/a -m "This is a test step comment" -# sleep 20 -# megatest -step wasting_time :state end :status $? - -touch ../I_was_here -mkdir -p $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME -echo 1 2 3 4 5 > $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME/the_ans - -$MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 8;echo all done eh?" -m "This is a test step comment" - -$MT_MEGATEST -load-test-data << EOF -foo,bar,1.2,1.9,> -foo,rab,1.0e9,10e9,1e9 -foo,bla,1.2,1.9,< -foo,bal,1.2,1.2,<,,Check for overload -foo,alb,1.2,1.2,<=,Amps,This is the high power circuit test -foo,abl,1.2,1.3,0.1 -foo,bra,1.2,pass,silly stuff -faz,bar,10,8mA,,,"this is a comment" -EOF - -$MT_MEGATEST -load-test-data << EOF -cat, var, val, exp, comp, units, comment, status, type -ameas,iout,1.2,1.9,>,Amps,Comment,,meas -EOF -loadstatus=$? - -if [[ `basename $PWD` == "mustfail" ]];then - $MT_MEGATEST -test-status :state COMPLETED :status FAIL -else - $MT_MEGATEST -test-status :state COMPLETED :status $loadstatus -m "This is a test level comment" :value 10e6 :expected_value 1.1e6 :tol 100e3 :category nada :variable sillyvar :units mFarks :comment "This is the value/expected comment" -fi - -env > envfile.txt - -# $MT_MEGATEST -test-status :state COMPLETED :status FAIL DELETED tests/fullrun/tests/runfirst/testconfig Index: tests/fullrun/tests/runfirst/testconfig ================================================================== --- tests/fullrun/tests/runfirst/testconfig +++ /dev/null @@ -1,24 +0,0 @@ -[setup] -runscript main.sh - -[pre-launch-env-vars] -# These are set before the test is launched on the originating -# host. This can be used to control remote launch tools, e.g. to -# to choose the target host, select the launch tool etc. -SPECIAL_ENV_VAR override with everything after the first space. - -[items] -SEASON summer winter fall spring - -[itemstable] -BLOCK a b -TOCK 1 2 - -[test_meta] -author matt -owner bob -description This test must\ - be run before the other tests - -tags first,single -reviewed 1/1/1965 DELETED tests/fullrun/tests/runfirst/wasting_time.logpro Index: tests/fullrun/tests/runfirst/wasting_time.logpro ================================================================== --- tests/fullrun/tests/runfirst/wasting_time.logpro +++ /dev/null @@ -1,15 +0,0 @@ -;; put stuff here - -;; NOTE: This is not legit logpro code!!! - -;; Test for 0=PASS, 1=WARN, >2 = FAIL - -;; (define season (get-environment-variable "SEASON")) -;; -;; (exit -;; (case (string->symbol season) -;; ((summer) 0) -;; ((winter) 1) -;; ((fall) 2) -;; (else 0))) - DELETED tests/fullrun/tests/singletest/main.sh Index: tests/fullrun/tests/singletest/main.sh ================================================================== --- tests/fullrun/tests/singletest/main.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# megatest -step wasting_time :state start :status n/a -m "This is a test step comment" -# sleep 20 -# megatest -step wasting_time :state end :status $? - -$MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 5;echo alldone" -m "This is a test step comment" - -$MT_MEGATEST -test-status :state COMPLETED :status $? -m "This is a test level comment" -set-toplog the_top_log.html :first_err "This is the first error" DELETED tests/fullrun/tests/singletest/testconfig Index: tests/fullrun/tests/singletest/testconfig ================================================================== --- tests/fullrun/tests/singletest/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -diskspace 1M -memory 1G - -[pre-launch-env-vars] -# These are set before the test is launched on the originating -# host. This can be used to control remote launch tools, e.g. to -# to choose the target host, select the launch tool etc. -SPECIAL_ENV_VAR override with everything after the first space. - DELETED tests/fullrun/tests/singletest/wasting_time.logpro Index: tests/fullrun/tests/singletest/wasting_time.logpro ================================================================== --- tests/fullrun/tests/singletest/wasting_time.logpro +++ /dev/null @@ -1,15 +0,0 @@ -;; put stuff here - -;; NOTE: This is not legit logpro code!!! - -;; Test for 0=PASS, 1=WARN, >2 = FAIL - -;; (define season (get-environment-variable "SEASON")) -;; -;; (exit -;; (case (string->symbol season) -;; ((summer) 0) -;; ((winter) 1) -;; ((fall) 2) -;; (else 0))) - DELETED tests/fullrun/tests/singletest2/main.sh Index: tests/fullrun/tests/singletest2/main.sh ================================================================== --- tests/fullrun/tests/singletest2/main.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# megatest -step wasting_time :state start :status n/a -m "This is a test step comment" -# sleep 20 -# megatest -step wasting_time :state end :status $? - -$MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 5;echo all done eh?" -m "This is a test step comment" - -$MT_MEGATEST -test-status :state COMPLETED :status $? -m "This is a test level comment" -set-toplog the_top_log.html :first_warn "This is the first warning" DELETED tests/fullrun/tests/singletest2/testconfig Index: tests/fullrun/tests/singletest2/testconfig ================================================================== --- tests/fullrun/tests/singletest2/testconfig +++ /dev/null @@ -1,14 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -diskspace 1M -memory 1G -waiton singletest - -[pre-launch-env-vars] -# These are set before the test is launched on the originating -# host. This can be used to control remote launch tools, e.g. to -# to choose the target host, select the launch tool etc. -SPECIAL_ENV_VAR override with everything after the first space. - DELETED tests/fullrun/tests/singletest2/wasting_time.logpro Index: tests/fullrun/tests/singletest2/wasting_time.logpro ================================================================== --- tests/fullrun/tests/singletest2/wasting_time.logpro +++ /dev/null @@ -1,15 +0,0 @@ -;; put stuff here - -;; NOTE: This is not legit logpro code!!! - -;; Test for 0=PASS, 1=WARN, >2 = FAIL - -;; (define season (get-environment-variable "SEASON")) -;; -;; (exit -;; (case (string->symbol season) -;; ((summer) 0) -;; ((winter) 1) -;; ((fall) 2) -;; (else 0))) - DELETED tests/fullrun/tests/special/testconfig Index: tests/fullrun/tests/special/testconfig ================================================================== --- tests/fullrun/tests/special/testconfig +++ /dev/null @@ -1,8 +0,0 @@ -[ezsteps] -# calcresults megatest -list-runs $MT_RUNNAME -target $MT_TARGET - -[requirements] -waiton #{rget TESTSTORUN} - -# This is a "toplevel" test, it does not require waitons to be non-FAIL to run -mode toplevel DELETED tests/fullrun/tests/sqlitespeed/runscript.rb Index: tests/fullrun/tests/sqlitespeed/runscript.rb ================================================================== --- tests/fullrun/tests/sqlitespeed/runscript.rb +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/env ruby - -require "#{ENV['MT_RUN_AREA_HOME']}/../resources/ruby/librunscript.rb" - -# run_record(stepname, cmd) - will record in db if exit code of script was zero or not -run_and_record('create db',"sqlite3 testing.db << EOF\ncreate table if not exists blah(id INTEGER PRIMARY KEY,name TEXT);\n.q\nEOF","") - -if (! File.exists?("../../runfirst/I_was_here")) - puts "ERROR: This test was started before the prerequisites ran!" - system "megatest -test-status :state INCOMPLETE :status FAIL" - exit 1 -end - -# file_size_checker(stepname, filename, minsize, maxsize) - negative means ignore -# file_size_checker('create db','testing.db',100,-1) - -num_records=rand(5) # 0000 -record_step("add #{num_records}","start","n/a") -status=false -(0..num_records).each do |i| - randstring="abc"; - # "a;lskdfja;sdfj;alsdfj;aslfdj;alsfja;lsfdj;alsfja;lsjfd;lasfjl;asdfja;slfj;alsjf;asljf;alsjf;lasdjf;lasjf;lasjf;alsjf;lashflkashflkerhflkdsvnlasldhlfaldf" - # status=system "sqlite3 testing.db \"insert into blah (name) values ('#{randstring}');\"" - system "megatest -step testing :state wrote_junk :status #{num_records}" - sleep(5) - puts "i=#{i}" -end -if status==0 - status='pass' -else - status='fail' -end - -record_step("add #{num_records}","end",status) - - - - DELETED tests/fullrun/tests/sqlitespeed/testconfig Index: tests/fullrun/tests/sqlitespeed/testconfig ================================================================== --- tests/fullrun/tests/sqlitespeed/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript runscript.rb -tags non important,dumb junk - -[requirements] -waiton runfirst - -[items] -MANYITEMS [system (env > envfile.txt;echo aa ab ac ad ae af ag ah ai)] -# BORKED - -[test_meta] -jobgroup sqlite3 DELETED tests/fullrun/tests/test_mt_vars/altvarnotset.logpro Index: tests/fullrun/tests/test_mt_vars/altvarnotset.logpro ================================================================== --- tests/fullrun/tests/test_mt_vars/altvarnotset.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(expect:error in "LogFileBody" = 0 "a file that should never exist" #/what a dumb filename this is/) DELETED tests/fullrun/tests/test_mt_vars/altvarnotset.sh Index: tests/fullrun/tests/test_mt_vars/altvarnotset.sh ================================================================== --- tests/fullrun/tests/test_mt_vars/altvarnotset.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -! grep ALT_VAR megatest.sh DELETED tests/fullrun/tests/test_mt_vars/bogousnotset.logpro Index: tests/fullrun/tests/test_mt_vars/bogousnotset.logpro ================================================================== --- tests/fullrun/tests/test_mt_vars/bogousnotset.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(expect:error in "LogFileBody" = 0 "a file that should never exist" #/what a dumb filename this is/) DELETED tests/fullrun/tests/test_mt_vars/bogousnotset.sh Index: tests/fullrun/tests/test_mt_vars/bogousnotset.sh ================================================================== --- tests/fullrun/tests/test_mt_vars/bogousnotset.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -! grep BOGOUS megatest.sh DELETED tests/fullrun/tests/test_mt_vars/currentisblah.logpro Index: tests/fullrun/tests/test_mt_vars/currentisblah.logpro ================================================================== --- tests/fullrun/tests/test_mt_vars/currentisblah.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(expect:error in "LogFileBody" = 0 "a file that should never exist" #/what a dumb filename this is/) DELETED tests/fullrun/tests/test_mt_vars/currentisblah.sh Index: tests/fullrun/tests/test_mt_vars/currentisblah.sh ================================================================== --- tests/fullrun/tests/test_mt_vars/currentisblah.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -grep -e '^export CURRENT' megatest.sh | grep /tmp/nada DELETED tests/fullrun/tests/test_mt_vars/empty_var.logpro Index: tests/fullrun/tests/test_mt_vars/empty_var.logpro ================================================================== --- tests/fullrun/tests/test_mt_vars/empty_var.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(expect:error in "LogFileBody" = 0 "a file that should never exist" #/what a dumb filename this is/) DELETED tests/fullrun/tests/test_mt_vars/empty_var.sh Index: tests/fullrun/tests/test_mt_vars/empty_var.sh ================================================================== --- tests/fullrun/tests/test_mt_vars/empty_var.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -if [ x$EMPTY_VAR != "x" ];then - echo BAD EMPTY VAR! - exit 1 -fi DELETED tests/fullrun/tests/test_mt_vars/eval_vars.sh Index: tests/fullrun/tests/test_mt_vars/eval_vars.sh ================================================================== --- tests/fullrun/tests/test_mt_vars/eval_vars.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if env | grep VARWITHDOLLARSIGNS | grep USER;then - exit 1 # fails! -else - exit 0 # good! -fi DELETED tests/fullrun/tests/test_mt_vars/lookithome.logpro Index: tests/fullrun/tests/test_mt_vars/lookithome.logpro ================================================================== --- tests/fullrun/tests/test_mt_vars/lookithome.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(expect:error in "LogFileBody" = 0 "a file that should never exist" #/what a dumb filename this is/) DELETED tests/fullrun/tests/test_mt_vars/lookittmp.logpro Index: tests/fullrun/tests/test_mt_vars/lookittmp.logpro ================================================================== --- tests/fullrun/tests/test_mt_vars/lookittmp.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(expect:error in "LogFileBody" = 0 "a file that should never exist" #/what a dumb filename this is/) DELETED tests/fullrun/tests/test_mt_vars/test-path-file.sh Index: tests/fullrun/tests/test_mt_vars/test-path-file.sh ================================================================== --- tests/fullrun/tests/test_mt_vars/test-path-file.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - - -# get a previous test -export EZFAILPATH=`$MT_MEGATEST -test-files envfile.txt -target $MT_TARGET :runname $MT_RUNNAME -testpatt runfirst/a%` - -echo "Found |$EZFAILPATH|" - -if [ -e $EZFAILPATH ];then - echo All good! -else - echo NOT good! - exit 1 -fi - -export EZFAILPATH2=`$MT_MEGATEST -test-paths -target $MT_TARGET :runname $MT_RUNNAME -testpatt runfirst/a%` - -echo "Found |$EZFAILPATH2|" - -if [ -e $EZFAILPATH2 ];then - echo All good! -else - echo NOT good! - exit 1 -fi - - -exit 0 DELETED tests/fullrun/tests/test_mt_vars/test-path.logpro Index: tests/fullrun/tests/test_mt_vars/test-path.logpro ================================================================== --- tests/fullrun/tests/test_mt_vars/test-path.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(expect:error in "LogFileBody" = 0 "a file that should never exist" #/what a dumb filename this is/) DELETED tests/fullrun/tests/test_mt_vars/testconfig Index: tests/fullrun/tests/test_mt_vars/testconfig ================================================================== --- tests/fullrun/tests/test_mt_vars/testconfig +++ /dev/null @@ -1,40 +0,0 @@ -[setup] - -[ezsteps] -lookittmp ls /tmp -lookithome ls /home -# $CURRENT should be /tmp/nada -currentisblah currentisblah.sh - -# $BOGOUS should NOT be set -bogousnotset bogousnotset.sh - -# ALT_VAR should NOT be set -altvarnotset altvarnotset.sh - -# EMPTY_VAR should be an empty string -empty_var empty_var.sh - -# VACKYVAR should be set to a path -vackyvar vackyvar.sh - -# test-path and test-file -test-path test-path-file.sh - -# verify that vars with $ signs get expanded -varwithdollar eval_vars.sh - -[requirements] -waiton runfirst -priority 0 - -[items] -NUMNUM [system cat $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME/$PREDICTABLE] - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass, no logpro file. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/test_mt_vars/vackyvar.logpro Index: tests/fullrun/tests/test_mt_vars/vackyvar.logpro ================================================================== --- tests/fullrun/tests/test_mt_vars/vackyvar.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(expect:error in "LogFileBody" = 0 "a file that should never exist" #/what a dumb filename this is/) DELETED tests/fullrun/tests/test_mt_vars/vackyvar.sh Index: tests/fullrun/tests/test_mt_vars/vackyvar.sh ================================================================== --- tests/fullrun/tests/test_mt_vars/vackyvar.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -grep VACKYVAR megatest.sh | grep fullrun DELETED tests/fullrun/tests/test_mt_vars/varwithdollar.logpro Index: tests/fullrun/tests/test_mt_vars/varwithdollar.logpro ================================================================== --- tests/fullrun/tests/test_mt_vars/varwithdollar.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(expect:error in "LogFileBody" = 0 "a file that should never exist" #/what a dumb filename this is/) DELETED tests/fullrun/tests/testxz/testconfig Index: tests/fullrun/tests/testxz/testconfig ================================================================== --- tests/fullrun/tests/testxz/testconfig +++ /dev/null @@ -1,15 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -listfiles ls - -# Test requirements are specified here -[requirements] -waiton blocktestxz - -# test_meta is a section for storing additional data on your test -[test_meta] -author mrwellan -owner mrwellan -description This test should never get run due to blocktestxz failing -tags tagone,tagtwo -reviewed never DELETED tests/fullrun/tests/wait_no_items1/testconfig Index: tests/fullrun/tests/wait_no_items1/testconfig ================================================================== --- tests/fullrun/tests/wait_no_items1/testconfig +++ /dev/null @@ -1,17 +0,0 @@ -[ezsteps] -listfiles ls - -[requirements] -waiton no_items - -[items] - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass \ -but there is an items definition with no items. This should evoke an \ -error. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/wait_no_items2/testconfig Index: tests/fullrun/tests/wait_no_items2/testconfig ================================================================== --- tests/fullrun/tests/wait_no_items2/testconfig +++ /dev/null @@ -1,17 +0,0 @@ -[ezsteps] -listfiles ls - -[requirements] -waiton wait_no_items1 - -[items] - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass \ -but there is an items definition with no items. This should evoke an \ -error. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/wait_no_items3/testconfig Index: tests/fullrun/tests/wait_no_items3/testconfig ================================================================== --- tests/fullrun/tests/wait_no_items3/testconfig +++ /dev/null @@ -1,17 +0,0 @@ -[ezsteps] -listfiles ls - -[requirements] -waiton wait_no_items2 - -[items] - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass \ -but there is an items definition with no items. This should evoke an \ -error. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/fullrun/tests/wait_no_items4/testconfig Index: tests/fullrun/tests/wait_no_items4/testconfig ================================================================== --- tests/fullrun/tests/wait_no_items4/testconfig +++ /dev/null @@ -1,17 +0,0 @@ -[ezsteps] -listfiles ls - -[requirements] -waiton wait_no_items3 - -[items] - -[test_meta] -author matt -owner bob -description This test runs a single ezstep which is expected to pass \ -but there is an items definition with no items. This should evoke an \ -error. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/installall/config/megatest.config.dat Index: tests/installall/config/megatest.config.dat ================================================================== --- tests/installall/config/megatest.config.dat +++ /dev/null @@ -1,1 +0,0 @@ -../megatest.config DELETED tests/installall/config/runconfigs.config.dat Index: tests/installall/config/runconfigs.config.dat ================================================================== --- tests/installall/config/runconfigs.config.dat +++ /dev/null @@ -1,1 +0,0 @@ -../runconfigs.config DELETED tests/installall/config/sheet-names.cfg Index: tests/installall/config/sheet-names.cfg ================================================================== --- tests/installall/config/sheet-names.cfg +++ /dev/null @@ -1,2 +0,0 @@ -megatest.config -runconfigs.config DELETED tests/installall/config/sxml/_sheets.sxml Index: tests/installall/config/sxml/_sheets.sxml ================================================================== --- tests/installall/config/sxml/_sheets.sxml +++ /dev/null @@ -1,51 +0,0 @@ -((@ (http://www.w3.org/2001/XMLSchema-instance:schemaLocation - "http://www.gnumeric.org/v9.xsd")) - (http://www.gnumeric.org/v10.dtd:Version - (@ (Minor "17") (Major "10") (Full "1.10.17") (Epoch "1"))) - (http://www.gnumeric.org/v10.dtd:Attributes - (http://www.gnumeric.org/v10.dtd:Attribute - (http://www.gnumeric.org/v10.dtd:type "4") - (http://www.gnumeric.org/v10.dtd:name - "WorkbookView::show_horizontal_scrollbar") - (http://www.gnumeric.org/v10.dtd:value "TRUE")) - (http://www.gnumeric.org/v10.dtd:Attribute - (http://www.gnumeric.org/v10.dtd:type "4") - (http://www.gnumeric.org/v10.dtd:name - "WorkbookView::show_vertical_scrollbar") - (http://www.gnumeric.org/v10.dtd:value "TRUE")) - (http://www.gnumeric.org/v10.dtd:Attribute - (http://www.gnumeric.org/v10.dtd:type "4") - (http://www.gnumeric.org/v10.dtd:name "WorkbookView::show_notebook_tabs") - (http://www.gnumeric.org/v10.dtd:value "TRUE")) - (http://www.gnumeric.org/v10.dtd:Attribute - (http://www.gnumeric.org/v10.dtd:type "4") - (http://www.gnumeric.org/v10.dtd:name "WorkbookView::do_auto_completion") - (http://www.gnumeric.org/v10.dtd:value "TRUE")) - (http://www.gnumeric.org/v10.dtd:Attribute - (http://www.gnumeric.org/v10.dtd:type "4") - (http://www.gnumeric.org/v10.dtd:name "WorkbookView::is_protected") - (http://www.gnumeric.org/v10.dtd:value "FALSE"))) - (urn:oasis:names:tc:opendocument:xmlns:office:1.0:document-meta - (@ (urn:oasis:names:tc:opendocument:xmlns:office:1.0:version "1.2")) - (urn:oasis:names:tc:opendocument:xmlns:office:1.0:meta - (http://purl.org/dc/elements/1.1/:date "2013-07-21T23:45:07Z") - (urn:oasis:names:tc:opendocument:xmlns:meta:1.0:creation-date - "2013-07-21T23:42:35Z"))) - (http://www.gnumeric.org/v10.dtd:Calculation - (@ (MaxIterations "100") - (ManualRecalc "0") - (IterationTolerance "0.001") - (FloatRadix "2") - (FloatDigits "53") - (EnableIteration "1"))) - (http://www.gnumeric.org/v10.dtd:SheetNameIndex - (http://www.gnumeric.org/v10.dtd:SheetName - (@ (http://www.gnumeric.org/v10.dtd:Rows "65536") - (http://www.gnumeric.org/v10.dtd:Cols "256")) - "megatest.config") - (http://www.gnumeric.org/v10.dtd:SheetName - (@ (http://www.gnumeric.org/v10.dtd:Rows "65536") - (http://www.gnumeric.org/v10.dtd:Cols "256")) - "runconfigs.config")) - (http://www.gnumeric.org/v10.dtd:Geometry (@ (Width "1440") (Height "647"))) - (http://www.gnumeric.org/v10.dtd:UIData (@ (SelectedTab "0")))) DELETED tests/installall/config/sxml/_workbook.sxml Index: tests/installall/config/sxml/_workbook.sxml ================================================================== --- tests/installall/config/sxml/_workbook.sxml +++ /dev/null @@ -1,1 +0,0 @@ -(*TOP* (*PI* xml "version=\"1.0\" encoding=\"UTF-8\"")) DELETED tests/installall/config/sxml/megatest.config.sxml Index: tests/installall/config/sxml/megatest.config.sxml ================================================================== --- tests/installall/config/sxml/megatest.config.sxml +++ /dev/null @@ -1,108 +0,0 @@ -(http://www.gnumeric.org/v10.dtd:Sheet - (@ (Visibility "GNM_SHEET_VISIBILITY_VISIBLE") - (OutlineSymbolsRight "1") - (OutlineSymbolsBelow "1") - (HideZero "0") - (HideRowHeader "0") - (HideGrid "0") - (HideColHeader "0") - (GridColor "0:0:0") - (DisplayOutlines "1") - (DisplayFormulas "0")) - (http://www.gnumeric.org/v10.dtd:MaxCol "5") - (http://www.gnumeric.org/v10.dtd:MaxRow "7") - (http://www.gnumeric.org/v10.dtd:Zoom "1") - (http://www.gnumeric.org/v10.dtd:Names - (http://www.gnumeric.org/v10.dtd:Name - (http://www.gnumeric.org/v10.dtd:name "Print_Area") - (http://www.gnumeric.org/v10.dtd:value "#REF!") - (http://www.gnumeric.org/v10.dtd:position "A1")) - (http://www.gnumeric.org/v10.dtd:Name - (http://www.gnumeric.org/v10.dtd:name "Sheet_Title") - (http://www.gnumeric.org/v10.dtd:value "\"megatest.config\"") - (http://www.gnumeric.org/v10.dtd:position "A1"))) - (http://www.gnumeric.org/v10.dtd:PrintInformation - (http://www.gnumeric.org/v10.dtd:Margins - (http://www.gnumeric.org/v10.dtd:top (@ (PrefUnit "mm") (Points "120"))) - (http://www.gnumeric.org/v10.dtd:bottom - (@ (PrefUnit "mm") (Points "120"))) - (http://www.gnumeric.org/v10.dtd:left (@ (PrefUnit "mm") (Points "72"))) - (http://www.gnumeric.org/v10.dtd:right (@ (PrefUnit "mm") (Points "72"))) - (http://www.gnumeric.org/v10.dtd:header - (@ (PrefUnit "mm") (Points "72"))) - (http://www.gnumeric.org/v10.dtd:footer - (@ (PrefUnit "mm") (Points "72")))) - (http://www.gnumeric.org/v10.dtd:Scale - (@ (type "percentage") (percentage "100"))) - (http://www.gnumeric.org/v10.dtd:vcenter (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:hcenter (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:grid (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:even_if_only_styles (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:monochrome (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:draft (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:titles (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:do_not_print (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:print_range (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:order "d_then_r") - (http://www.gnumeric.org/v10.dtd:orientation "portrait") - (http://www.gnumeric.org/v10.dtd:Header - (@ (Right "") (Middle "&[TAB]") (Left ""))) - (http://www.gnumeric.org/v10.dtd:Footer - (@ (Right "") (Middle "Page &[PAGE]") (Left ""))) - (http://www.gnumeric.org/v10.dtd:paper "na_letter") - (http://www.gnumeric.org/v10.dtd:comments "in_place") - (http://www.gnumeric.org/v10.dtd:errors "as_displayed")) - (http://www.gnumeric.org/v10.dtd:Styles - (http://www.gnumeric.org/v10.dtd:StyleRegion - (@ (startRow "0") (startCol "0") (endRow "65535") (endCol "255")) - (http://www.gnumeric.org/v10.dtd:Style - (@ (WrapText "0") - (VAlign "2") - (ShrinkToFit "0") - (Shade "0") - (Rotation "0") - (PatternColor "0:0:0") - (Locked "1") - (Indent "0") - (Hidden "0") - (HAlign "1") - (Format "General") - (Fore "0:0:0") - (Back "FFFF:FFFF:FFFF")) - (http://www.gnumeric.org/v10.dtd:Font - (@ (Unit "10") - (Underline "0") - (StrikeThrough "0") - (Script "0") - (Italic "0") - (Bold "0")) - "Sans")))) - (http://www.gnumeric.org/v10.dtd:Cols - (@ (DefaultSizePts "48")) - (http://www.gnumeric.org/v10.dtd:ColInfo - (@ (Unit "112.5") (No "0") (HardSize "1"))) - (http://www.gnumeric.org/v10.dtd:ColInfo (@ (Unit "48") (No "1"))) - (http://www.gnumeric.org/v10.dtd:ColInfo - (@ (Unit "63.75") (No "2") (HardSize "1"))) - (http://www.gnumeric.org/v10.dtd:ColInfo (@ (Unit "48") (No "3"))) - (http://www.gnumeric.org/v10.dtd:ColInfo - (@ (Unit "86.25") (No "4") (HardSize "1"))) - (http://www.gnumeric.org/v10.dtd:ColInfo (@ (Unit "48") (No "5")))) - (http://www.gnumeric.org/v10.dtd:Rows - (@ (DefaultSizePts "12.75")) - (http://www.gnumeric.org/v10.dtd:RowInfo - (@ (Unit "12.75") (No "0") (Count "8")))) - (http://www.gnumeric.org/v10.dtd:Selections - (@ (CursorRow "0") (CursorCol "0")) - (http://www.gnumeric.org/v10.dtd:Selection - (@ (startRow "0") (startCol "0") (endRow "0") (endCol "0")))) - (http://www.gnumeric.org/v10.dtd:SheetLayout (@ (TopLeft "A1"))) - (http://www.gnumeric.org/v10.dtd:Solver - (@ (ProgramR "0") - (ProblemType "0") - (NonNeg "1") - (ModelType "0") - (MaxTime "60") - (MaxIter "1000") - (Discr "0") - (AutoScale "0")))) DELETED tests/installall/config/sxml/runconfigs.config.sxml Index: tests/installall/config/sxml/runconfigs.config.sxml ================================================================== --- tests/installall/config/sxml/runconfigs.config.sxml +++ /dev/null @@ -1,111 +0,0 @@ -(http://www.gnumeric.org/v10.dtd:Sheet - (@ (Visibility "GNM_SHEET_VISIBILITY_VISIBLE") - (OutlineSymbolsRight "1") - (OutlineSymbolsBelow "1") - (HideZero "0") - (HideRowHeader "0") - (HideGrid "0") - (HideColHeader "0") - (GridColor "0:0:0") - (DisplayOutlines "1") - (DisplayFormulas "0")) - (http://www.gnumeric.org/v10.dtd:MaxCol "3") - (http://www.gnumeric.org/v10.dtd:MaxRow "7") - (http://www.gnumeric.org/v10.dtd:Zoom "1") - (http://www.gnumeric.org/v10.dtd:Names - (http://www.gnumeric.org/v10.dtd:Name - (http://www.gnumeric.org/v10.dtd:name "Print_Area") - (http://www.gnumeric.org/v10.dtd:value "#REF!") - (http://www.gnumeric.org/v10.dtd:position "A1")) - (http://www.gnumeric.org/v10.dtd:Name - (http://www.gnumeric.org/v10.dtd:name "Sheet_Title") - (http://www.gnumeric.org/v10.dtd:value "\"runconfigs.config\"") - (http://www.gnumeric.org/v10.dtd:position "A1"))) - (http://www.gnumeric.org/v10.dtd:PrintInformation - (http://www.gnumeric.org/v10.dtd:Margins - (http://www.gnumeric.org/v10.dtd:top (@ (PrefUnit "mm") (Points "120"))) - (http://www.gnumeric.org/v10.dtd:bottom - (@ (PrefUnit "mm") (Points "120"))) - (http://www.gnumeric.org/v10.dtd:left (@ (PrefUnit "mm") (Points "72"))) - (http://www.gnumeric.org/v10.dtd:right (@ (PrefUnit "mm") (Points "72"))) - (http://www.gnumeric.org/v10.dtd:header - (@ (PrefUnit "mm") (Points "72"))) - (http://www.gnumeric.org/v10.dtd:footer - (@ (PrefUnit "mm") (Points "72")))) - (http://www.gnumeric.org/v10.dtd:Scale - (@ (type "percentage") (percentage "100"))) - (http://www.gnumeric.org/v10.dtd:vcenter (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:hcenter (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:grid (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:even_if_only_styles (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:monochrome (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:draft (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:titles (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:do_not_print (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:print_range (@ (value "0"))) - (http://www.gnumeric.org/v10.dtd:order "d_then_r") - (http://www.gnumeric.org/v10.dtd:orientation "portrait") - (http://www.gnumeric.org/v10.dtd:Header - (@ (Right "") (Middle "&[TAB]") (Left ""))) - (http://www.gnumeric.org/v10.dtd:Footer - (@ (Right "") (Middle "Page &[PAGE]") (Left ""))) - (http://www.gnumeric.org/v10.dtd:paper "na_letter") - (http://www.gnumeric.org/v10.dtd:comments "in_place") - (http://www.gnumeric.org/v10.dtd:errors "as_displayed")) - (http://www.gnumeric.org/v10.dtd:Styles - (http://www.gnumeric.org/v10.dtd:StyleRegion - (@ (startRow "0") (startCol "0") (endRow "65535") (endCol "255")) - (http://www.gnumeric.org/v10.dtd:Style - (@ (WrapText "0") - (VAlign "2") - (ShrinkToFit "0") - (Shade "0") - (Rotation "0") - (PatternColor "0:0:0") - (Locked "1") - (Indent "0") - (Hidden "0") - (HAlign "1") - (Format "General") - (Fore "0:0:0") - (Back "FFFF:FFFF:FFFF")) - (http://www.gnumeric.org/v10.dtd:Font - (@ (Unit "10") - (Underline "0") - (StrikeThrough "0") - (Script "0") - (Italic "0") - (Bold "0")) - "Sans")))) - (http://www.gnumeric.org/v10.dtd:Cols - (@ (DefaultSizePts "48")) - (http://www.gnumeric.org/v10.dtd:ColInfo - (@ (Unit "108.8") (No "0") (HardSize "1"))) - (http://www.gnumeric.org/v10.dtd:ColInfo - (@ (Unit "97.5") (No "1") (HardSize "1"))) - (http://www.gnumeric.org/v10.dtd:ColInfo - (@ (Unit "100.5") (No "2") (HardSize "1") (Count "2")))) - (http://www.gnumeric.org/v10.dtd:Rows - (@ (DefaultSizePts "12.75")) - (http://www.gnumeric.org/v10.dtd:RowInfo - (@ (Unit "13.5") (No "0") (Count "2"))) - (http://www.gnumeric.org/v10.dtd:RowInfo (@ (Unit "12.75") (No "2"))) - (http://www.gnumeric.org/v10.dtd:RowInfo - (@ (Unit "13.5") (No "3") (Count "2"))) - (http://www.gnumeric.org/v10.dtd:RowInfo (@ (Unit "12.75") (No "5"))) - (http://www.gnumeric.org/v10.dtd:RowInfo (@ (Unit "13.5") (No "6"))) - (http://www.gnumeric.org/v10.dtd:RowInfo (@ (Unit "12.75") (No "7")))) - (http://www.gnumeric.org/v10.dtd:Selections - (@ (CursorRow "7") (CursorCol "3")) - (http://www.gnumeric.org/v10.dtd:Selection - (@ (startRow "7") (startCol "3") (endRow "7") (endCol "3")))) - (http://www.gnumeric.org/v10.dtd:SheetLayout (@ (TopLeft "A1"))) - (http://www.gnumeric.org/v10.dtd:Solver - (@ (ProgramR "0") - (ProblemType "0") - (NonNeg "1") - (ModelType "0") - (MaxTime "60") - (MaxIter "1000") - (Discr "0") - (AutoScale "0")))) DELETED tests/installall/configs/chicken-4.8.0.4.config Index: tests/installall/configs/chicken-4.8.0.4.config ================================================================== --- tests/installall/configs/chicken-4.8.0.4.config +++ /dev/null @@ -1,1 +0,0 @@ -CHICKEN_URL http://code.call-cc.org/releases/4.8.0/chicken-4.8.0.4.tar.gz DELETED tests/installall/configs/chicken-4.8.1.config Index: tests/installall/configs/chicken-4.8.1.config ================================================================== --- tests/installall/configs/chicken-4.8.1.config +++ /dev/null @@ -1,1 +0,0 @@ -CHICKEN_URL http://code.call-cc.org/dev-snapshots/2013/01/04/chicken-4.8.1.tar.gz DELETED tests/installall/megatest.config Index: tests/installall/megatest.config ================================================================== --- tests/installall/megatest.config +++ /dev/null @@ -1,24 +0,0 @@ -[fields] -CHICKEN_VERSION TEXT -MEGATEST_VERSION TEXT -IUPMODE TEXT -BUILD_TAG TEXT - -[setup] -max_concurrent_jobs 6 -linktree #{getenv MT_RUN_AREA_HOME}/links -testcopycmd cp --remove-destination -rsv TEST_SRC_PATH/. TEST_TARG_PATH/. >> TEST_TARG_PATH/mt_launch.log 2>> TEST_TARG_PATH/mt_launch.log - -[jobtools] -useshell yes -launcher nbfind - -[env-override] -EXAMPLE_VAR example value - -[server] -port 9080 - -[disks] -disk0 #{getenv MT_RUN_AREA_HOME}/runs - DELETED tests/installall/runconfigs.config Index: tests/installall/runconfigs.config ================================================================== --- tests/installall/runconfigs.config +++ /dev/null @@ -1,38 +0,0 @@ -[.............] -# -# [CHICKEN_VERSION/MEGATEST_VERSION/IUPMODE/PLATFORM/BUILD_TAG] -# - -[default] -ALLTESTS see this variable -PREFIX #{getenv MT_RUN_AREA_HOME}/#{getenv BUILD_TAG}/#{getenv MT_RUNNAME} -DOWNLOADS #{getenv MT_RUN_AREA_HOME}/downloads -IUPLIB 26g4 -PLATFORM linux -LOGPRO_VERSION v1.05 -BUILDSQLITE yes -SQLITE3_VERSION 3071401 -ZEROMQ_VERSION 2.2.0 -logpro_VERSION v1.08 -stml_VERSION v0.901 -megatest_VERSION v1.5511 - -[include configs/hicken-#{getenv CHICKEN_VERSION}.config] - -# Currently must have at least one variable in a section -[4.8.0/trunk/bin/std] -IUP_VERSION na - -[4.8.0.4/trunk/src/std] -CHICKEN_URL http://code.call-cc.org/releases/4.8.0/chicken-4.8.0.4.tar.gz -IUP_VERSION na - -[4.8.1/trunk/src/std] -IUP_VERSION na - -[4.8.0/v1.5508/opt] -IUP_VERSION na -PREFIX /opt/chicken/4.8.0 - -[4.8.0/trunk/centos5.7vm] -BUILDSQLITE no DELETED tests/installall/tests/canvas-draw/install.logpro Index: tests/installall/tests/canvas-draw/install.logpro ================================================================== --- tests/installall/tests/canvas-draw/install.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/canvas-draw/install.sh Index: tests/installall/tests/canvas-draw/install.sh ================================================================== --- tests/installall/tests/canvas-draw/install.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh DELETED tests/installall/tests/canvas-draw/testconfig Index: tests/installall/tests/canvas-draw/testconfig ================================================================== --- tests/installall/tests/canvas-draw/testconfig +++ /dev/null @@ -1,18 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -install install.sh - -# Test requirements are specified here -[requirements] -waiton iuplib setup - -# Iteration for your tests are controlled by the items section -[items] - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Install the canvas-draw egg -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/chicken/compile.logpro Index: tests/installall/tests/chicken/compile.logpro ================================================================== --- tests/installall/tests/chicken/compile.logpro +++ /dev/null @@ -1,10 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Leaving directory ..." #/Leaving directory/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:ignore in "LogFileBody" >= 0 "Ignore HAVE_STRERROR" #/HAVE_STRERROR/) - -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/chicken/compile.sh Index: tests/installall/tests/chicken/compile.sh ================================================================== --- tests/installall/tests/chicken/compile.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh - -cd chicken-${CHICKEN_VERSION} -make PLATFORM=${PLATFORM} PREFIX=${PREFIX} DELETED tests/installall/tests/chicken/download.logpro Index: tests/installall/tests/chicken/download.logpro ================================================================== --- tests/installall/tests/chicken/download.logpro +++ /dev/null @@ -1,11 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "README file must be seen" #/README$/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! - -(expect:ignore in "LogFileBody" >= 0 "Ignore error flagged by finalizer-error-test" #/\w+-error/) - -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/chicken/download.sh Index: tests/installall/tests/chicken/download.sh ================================================================== --- tests/installall/tests/chicken/download.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh - -if [ ! -e ${DOWNLOADS}/chicken-${CHICKEN_VERSION}.tar.gz ]; then - if [ "${CHICKEN_URL}" == "" ]; then - CHICKEN_URL=http://code.call-cc.org/releases/${CHICKEN_VERSION}/chicken-${CHICKEN_VERSION}.tar.gz - fi - echo "Downloading $CHICKEN_URL" - (cd ${DOWNLOADS};wget ${CHICKEN_URL}) -fi - -ls -l ${DOWNLOADS}/chicken-${CHICKEN_VERSION}.tar.gz - -tar xfvz ${DOWNLOADS}/chicken-${CHICKEN_VERSION}.tar.gz - -ls -l chicken-${CHICKEN_VERSION} DELETED tests/installall/tests/chicken/install.logpro Index: tests/installall/tests/chicken/install.logpro ================================================================== --- tests/installall/tests/chicken/install.logpro +++ /dev/null @@ -1,11 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Leaving directory" #/Leaving directory/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! - -(expect:ignore in "LogFileBody" >= 0 "Ignore error in some filenames" #/\w+-errors/) - -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/chicken/install.sh Index: tests/installall/tests/chicken/install.sh ================================================================== --- tests/installall/tests/chicken/install.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh -# source $PREFIX - -cd chicken-${CHICKEN_VERSION} -make PLATFORM=${PLATFORM} PREFIX=${PREFIX} install - -ls -l ${PREFIX}/bin DELETED tests/installall/tests/chicken/testconfig Index: tests/installall/tests/chicken/testconfig ================================================================== --- tests/installall/tests/chicken/testconfig +++ /dev/null @@ -1,22 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -download download.sh -compile compile.sh -install install.sh - -# Test requirements are specified here -[requirements] -waiton setup -# priority 10 - -# Iteration for your tests are controlled by the items section -[items] -# CHICKEN_VERSION 4.8.0 - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Download and install chicken scheme -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/eggs/install.logpro Index: tests/installall/tests/eggs/install.logpro ================================================================== --- tests/installall/tests/eggs/install.logpro +++ /dev/null @@ -1,9 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Last thing done is chmod ..." #/chmod /) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" >= 0 "Ignore someword-errors" #/\w+-error/) -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/eggs/install.sh Index: tests/installall/tests/eggs/install.sh ================================================================== --- tests/installall/tests/eggs/install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh - -$PREFIX/bin/chicken-install $PROX $EGG_NAME - DELETED tests/installall/tests/eggs/testconfig Index: tests/installall/tests/eggs/testconfig ================================================================== --- tests/installall/tests/eggs/testconfig +++ /dev/null @@ -1,20 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -install install.sh - -# Test requirements are specified here -[requirements] -waiton chicken setup -priority 9 - -# Iteration for your tests are controlled by the items section -[items] -EGG_NAME matchable readline apropos base64 regex-literals format regex-case test coops trace csv dot-locking posix-utils posix-extras directory-utils hostinfo tcp-server rpc csv-xml fmt json md5 ssax sxml-serializer sxml-modifications salmonella sql-de-lite postgresql - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Download and install eggs with no significant prerequisites -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/ffcall/compile.logpro Index: tests/installall/tests/ffcall/compile.logpro ================================================================== --- tests/installall/tests/ffcall/compile.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Leaving directory" #/Leaving directory/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/ffcall/compile.sh Index: tests/installall/tests/ffcall/compile.sh ================================================================== --- tests/installall/tests/ffcall/compile.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh - -cd ffcall -./configure --prefix=${PREFIX} --enable-shared -make DELETED tests/installall/tests/ffcall/download.logpro Index: tests/installall/tests/ffcall/download.logpro ================================================================== --- tests/installall/tests/ffcall/download.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "VERSION" #/ VERSION/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/ffcall/download.sh Index: tests/installall/tests/ffcall/download.sh ================================================================== --- tests/installall/tests/ffcall/download.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh - -if ! [[ -e ${DOWNLOADS}/ffcall.tar.gz ]] ; then - (cd ${DOWNLOADS};wget http://www.kiatoa.com/matt/iup/ffcall.tar.gz ) -fi - -tar xfvz ${DOWNLOADS}/ffcall.tar.gz - -ls -l ffcall DELETED tests/installall/tests/ffcall/install.logpro Index: tests/installall/tests/ffcall/install.logpro ================================================================== --- tests/installall/tests/ffcall/install.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Leaving directory" #/Leaving directory/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/ffcall/install.sh Index: tests/installall/tests/ffcall/install.sh ================================================================== --- tests/installall/tests/ffcall/install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh - -cd ffcall -make install DELETED tests/installall/tests/ffcall/testconfig Index: tests/installall/tests/ffcall/testconfig ================================================================== --- tests/installall/tests/ffcall/testconfig +++ /dev/null @@ -1,20 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -download download.sh -compile compile.sh -install install.sh - -# Test requirements are specified here -[requirements] -waiton setup - -# Iteration for your tests are controlled by the items section -[items] - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Install the ffcall library -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/iup/install.logpro Index: tests/installall/tests/iup/install.logpro ================================================================== --- tests/installall/tests/iup/install.logpro +++ /dev/null @@ -1,9 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "chmod is roughly last thing that happens" #/chmod /) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" >= 0 "Ignore setup-error-handling" #/\w+-error/) -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/iup/install.sh Index: tests/installall/tests/iup/install.sh ================================================================== --- tests/installall/tests/iup/install.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh -# source $PREFIX/setup-chicken4x.sh - -export CSCLIBS=`echo $LD_LIBRARY_PATH | sed 's/:/ -L/g'` -CSC_OPTIONS="-I$PREFIX/include -L$CSCLIBS" $PREFIX/bin/chicken-install $PROX -D no-library-checks -feature disable-iup-web iup -# CSC_OPTIONS="-I$PREFIX/include -L$CSCLIBS" $CHICKEN_INSTALL $PROX -D no-library-checks -feature disable-iup-web -deploy -prefix $DEPLOYTARG iup -# iup:1.0.2 -CSC_OPTIONS="-I$PREFIX/include -L$CSCLIBS" $PREFIX/bin/chicken-install $PROX -D no-library-checks canvas-draw -# CSC_OPTIONS="-I$PREFIX/include -L$CSCLIBS" $CHICKEN_INSTALL $PROX -D no-library-checks -deploy -prefix $DEPLOYTARG canvas-draw DELETED tests/installall/tests/iup/testconfig Index: tests/installall/tests/iup/testconfig ================================================================== --- tests/installall/tests/iup/testconfig +++ /dev/null @@ -1,18 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -install install.sh - -# Test requirements are specified here -[requirements] -waiton iup#{getenv IUPMODE}lib tougheggs - -# Iteration for your tests are controlled by the items section -[items] - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Install iup egg -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/iupbinlib/compile.logpro Index: tests/installall/tests/iupbinlib/compile.logpro ================================================================== --- tests/installall/tests/iupbinlib/compile.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/iupbinlib/compile.sh Index: tests/installall/tests/iupbinlib/compile.sh ================================================================== --- tests/installall/tests/iupbinlib/compile.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh DELETED tests/installall/tests/iupbinlib/download.logpro Index: tests/installall/tests/iupbinlib/download.logpro ================================================================== --- tests/installall/tests/iupbinlib/download.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "README file should show up" #/README/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/iupbinlib/download.sh Index: tests/installall/tests/iupbinlib/download.sh ================================================================== --- tests/installall/tests/iupbinlib/download.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh -# source $PREFIX/setup-chicken4x.sh - -if [[ `uname -a | grep x86_64` == "" ]]; then - export ARCHSIZE='' -else - export ARCHSIZE=64_ -fi - # export files="cd-5.4.1_Linux${IUPLIB}_lib.tar.gz im-3.6.3_Linux${IUPLIB}_lib.tar.gz iup-3.5_Linux${IUPLIB}_lib.tar.gz" -if [[ x$USEOLDIUP == "x" ]];then - export files="cd-5.5.1_Linux${IUPLIB}_${ARCHSIZE}lib.tar.gz im-3.8_Linux${IUPLIB}_${ARCHSIZE}lib.tar.gz iup-3.6_Linux${IUPLIB}_${ARCHSIZE}lib.tar.gz" -else - echo WARNING: Using old IUP libraries - export files="cd-5.4.1_Linux${IUPLIB}_${ARCHSIZE}lib.tar.gz im-3.6.3_Linux${IUPLIB}_${ARCHSIZE}lib.tar.gz iup-3.5_Linux${IUPLIB}_${ARCHSIZE}lib.tar.gz" -fi - -mkdir -p $PREFIX/iuplib -for a in `echo $files` ; do - if ! [[ -e ${DOWNLOADS}/$a ]] ; then - (cd ${DOWNLOADS};wget http://www.kiatoa.com/matt/iup/$a) - fi - echo Untarring $a into $PREFIX/lib - (cd $PREFIX/lib;tar xfvz ${DOWNLOADS}/$a;mv include/* ../include) -done - DELETED tests/installall/tests/iupbinlib/install.logpro Index: tests/installall/tests/iupbinlib/install.logpro ================================================================== --- tests/installall/tests/iupbinlib/install.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/iupbinlib/install.sh Index: tests/installall/tests/iupbinlib/install.sh ================================================================== --- tests/installall/tests/iupbinlib/install.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh DELETED tests/installall/tests/iupbinlib/testconfig Index: tests/installall/tests/iupbinlib/testconfig ================================================================== --- tests/installall/tests/iupbinlib/testconfig +++ /dev/null @@ -1,18 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -download download.sh - -# Test requirements are specified here -[requirements] -waiton ffcall setup - -# Iteration for your tests are controlled by the items section -[items] - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Install the iup library if it is not already installed -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/iupbinlib/untar.logpro Index: tests/installall/tests/iupbinlib/untar.logpro ================================================================== --- tests/installall/tests/iupbinlib/untar.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/iupbinlib/untar.sh Index: tests/installall/tests/iupbinlib/untar.sh ================================================================== --- tests/installall/tests/iupbinlib/untar.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh DELETED tests/installall/tests/iupsrclib/cd.logpro Index: tests/installall/tests/iupsrclib/cd.logpro ================================================================== --- tests/installall/tests/iupsrclib/cd.logpro +++ /dev/null @@ -1,3 +0,0 @@ -(expect:ignore in "LogFileBody" >= 0 "Ignore these binary operator errors for now" #/error: missing binary operator/) - -(load "compile.logpro") DELETED tests/installall/tests/iupsrclib/compile.logpro Index: tests/installall/tests/iupsrclib/compile.logpro ================================================================== --- tests/installall/tests/iupsrclib/compile.logpro +++ /dev/null @@ -1,12 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Completed signature" #/(Dynamic Library.*Done|Leaving directory|Nothing to be done)/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" >= 0 "Ignore files with error in name" #/error.[ch]/) -(expect:ignore in "LogFileBody" >= 0 "Ignore files with errors in name" #/errors.[ch]/) -(expect:ignore in "LogFileBody" >= 0 "Ignore files with warn in name" #/warning.[ch]/) - -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/iupsrclib/compile.sh Index: tests/installall/tests/iupsrclib/compile.sh ================================================================== --- tests/installall/tests/iupsrclib/compile.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -pkg=$1 - -source $PREFIX/buildsetup.sh - -export LUA_SUFFIX= -export LUA_INC=$MT_TEST_RUN_DIR/lua52/include - -if [[ $pkg == "lua52" ]]; then - (cd $pkg/src;make $PLATFORM) -else - (cd $pkg/src;make) -fi - DELETED tests/installall/tests/iupsrclib/download.logpro Index: tests/installall/tests/iupsrclib/download.logpro ================================================================== --- tests/installall/tests/iupsrclib/download.logpro +++ /dev/null @@ -1,13 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "README file should show up" #/README/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! - -(expect:ignore in "LogFileBody" >= 0 "Ignore files with error in name" #/error.[ch]/) -(expect:ignore in "LogFileBody" >= 0 "Ignore files with errors in name" #/errors.[ch]/) -(expect:ignore in "LogFileBody" >= 0 "Ignore files with warn in name" #/warning.[ch]/) - -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/iupsrclib/download.sh Index: tests/installall/tests/iupsrclib/download.sh ================================================================== --- tests/installall/tests/iupsrclib/download.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh - -mkdir -p $PREFIX/iuplib -for a in cd-5.6.1_Sources.tar.gz im-3.8.1_Sources.tar.gz iup-3.8_Sources.tar.gz lua-5.2.1_Sources.tar.gz; do - if ! [[ -e ${DOWNLOADS}/$a ]] ; then - (cd ${DOWNLOADS};wget http://www.kiatoa.com/matt/iup/$a) - fi - tar xfvz ${DOWNLOADS}/$a -done - -find . -type d -exec chmod ug+x {} \; DELETED tests/installall/tests/iupsrclib/im.logpro Index: tests/installall/tests/iupsrclib/im.logpro ================================================================== --- tests/installall/tests/iupsrclib/im.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(load "compile.logpro") DELETED tests/installall/tests/iupsrclib/install.logpro Index: tests/installall/tests/iupsrclib/install.logpro ================================================================== --- tests/installall/tests/iupsrclib/install.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/iupsrclib/install.sh Index: tests/installall/tests/iupsrclib/install.sh ================================================================== --- tests/installall/tests/iupsrclib/install.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh - -# The so files -cp -f im/lib/Linux26g4/*.so $PREFIX/lib -cp -f cd/lib/Linux26g4/*.so $PREFIX/lib -cp -f iup/lib/Linux26g4/*.so $PREFIX/lib - -# The development files -mkdir -p $PREFIX/include/im -cp -fR im/include/*.h $PREFIX/include/im -cp -f im/lib/Linux26g4/*.a $PREFIX/lib - -mkdir -p $PREFIX/include/cd -cp -f cd/include/*.h $PREFIX/include/cd -cp -f cd/lib/Linux26g4/*.a $PREFIX/lib - -mkdir -p /usr/include/iup -cp -f iup/include/*.h $PREFIX/include/iup -cp -f iup/lib/Linux26g4/*.a $PREFIX/lib DELETED tests/installall/tests/iupsrclib/iup.logpro Index: tests/installall/tests/iupsrclib/iup.logpro ================================================================== --- tests/installall/tests/iupsrclib/iup.logpro +++ /dev/null @@ -1,3 +0,0 @@ -(expect:ignore in "LogFileBody" >= 0 "Ignore these binary operator errors for now" #/error: missing binary operator/ expires: "10/10/2013") - -(load "compile.logpro") DELETED tests/installall/tests/iupsrclib/lua.logpro Index: tests/installall/tests/iupsrclib/lua.logpro ================================================================== --- tests/installall/tests/iupsrclib/lua.logpro +++ /dev/null @@ -1,1 +0,0 @@ -(load "compile.logpro") DELETED tests/installall/tests/iupsrclib/testconfig Index: tests/installall/tests/iupsrclib/testconfig ================================================================== --- tests/installall/tests/iupsrclib/testconfig +++ /dev/null @@ -1,22 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -download download.sh -lua compile.sh lua52 -im compile.sh im -cd compile.sh cd -iup compile.sh iup - -# Test requirements are specified here -[requirements] -waiton ffcall setup - -# Iteration for your tests are controlled by the items section -[items] - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Install the iup library if it is not already installed -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/iupsrclib/untar.logpro Index: tests/installall/tests/iupsrclib/untar.logpro ================================================================== --- tests/installall/tests/iupsrclib/untar.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/iupsrclib/untar.sh Index: tests/installall/tests/iupsrclib/untar.sh ================================================================== --- tests/installall/tests/iupsrclib/untar.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh DELETED tests/installall/tests/mmisc/clone.logpro Index: tests/installall/tests/mmisc/clone.logpro ================================================================== --- tests/installall/tests/mmisc/clone.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Output from fossil" #/^repository:\s+/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/i) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/mmisc/clone.sh Index: tests/installall/tests/mmisc/clone.sh ================================================================== --- tests/installall/tests/mmisc/clone.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh - -fossil clone http://www.kiatoa.com/fossils/$FSLPKG $FSLPKG.fossil - -mkdir src -cd src -fossil open ../$FSLPKG.fossil --nested -fossil co ${$FSLPKG}_VERSION} DELETED tests/installall/tests/mmisc/install.logpro Index: tests/installall/tests/mmisc/install.logpro ================================================================== --- tests/installall/tests/mmisc/install.logpro +++ /dev/null @@ -1,9 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Always get a chmod at the end of install" #/chmod.*logpro.setup-info/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in setup-error-handling" #/setup-error-handling/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/i) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/mmisc/install.sh Index: tests/installall/tests/mmisc/install.sh ================================================================== --- tests/installall/tests/mmisc/install.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh -cd src -if [ $FSLPKG == "logpro" ];then - chicken-install -elif [ $FSLPKG == "stml" ];then - cp install.cfg.template install.cfg - cp requirements.scm.template requirements.scm - make - make install -else - make - make install PREFIX=$PREFIX -fi DELETED tests/installall/tests/mmisc/testconfig Index: tests/installall/tests/mmisc/testconfig ================================================================== --- tests/installall/tests/mmisc/testconfig +++ /dev/null @@ -1,21 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -clone clone.sh -install install.sh - -# Test requirements are specified here -[requirements] -waiton eggs setup - -# Iteration for your tests are controlled by the items section -[items] -FSLPKG logpro stml megatest - - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Install the logpro tool -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/opensrc/clone.logpro Index: tests/installall/tests/opensrc/clone.logpro ================================================================== --- tests/installall/tests/opensrc/clone.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Output from fossil" (list #/^repository:\s+/ #/comment:/)) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/i) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/opensrc/clone.sh Index: tests/installall/tests/opensrc/clone.sh ================================================================== --- tests/installall/tests/opensrc/clone.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh - -parentdir=$MT_LINKTREE/$MT_TARGET/$MT_RUNNAME - -lockfile $parentdir/clone.lock -if [ ! -e $parentdir/opensrc.fossil ];then - fossil clone http://www.kiatoa.com/fossils/opensrc $parentdir/opensrc.fossil -fi - -if [ ! -e $parentdir/src/dbi ];then - mkdir -p $parentdir/src - (cd $parentdir/src;fossil open $parentdir/opensrc.fossil --nested) -else - (cd $parentdir/src;fossil sync;fossil co trunk;fossil status) -fi -rm -f $parentdir/clone.lock - -ln -sf $parentdir/src $MT_TEST_RUN_DIR/src - DELETED tests/installall/tests/opensrc/install.logpro Index: tests/installall/tests/opensrc/install.logpro ================================================================== --- tests/installall/tests/opensrc/install.logpro +++ /dev/null @@ -1,9 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Always get a chmod at the end of install" #/chmod.*.setup-info/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in setup-error-handling" #/setup-error-handling/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/i) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/opensrc/install.sh Index: tests/installall/tests/opensrc/install.sh ================================================================== --- tests/installall/tests/opensrc/install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh -cd src/$MODULE_NAME -chicken-install DELETED tests/installall/tests/opensrc/testconfig Index: tests/installall/tests/opensrc/testconfig ================================================================== --- tests/installall/tests/opensrc/testconfig +++ /dev/null @@ -1,20 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -clone clone.sh -install install.sh - -# Test requirements are specified here -[requirements] -waiton eggs setup sqlite3 - -# Iteration for your tests are controlled by the items section -[items] -MODULE_NAME dbi margs qtree vcd xfig mutils - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Install the eggs from the opensrc fossil -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/setup/setup.logpro Index: tests/installall/tests/setup/setup.logpro ================================================================== --- tests/installall/tests/setup/setup.logpro +++ /dev/null @@ -1,10 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "ALL DONE" #/ALL DONE$/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! - - -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/setup/setup.sh Index: tests/installall/tests/setup/setup.sh ================================================================== --- tests/installall/tests/setup/setup.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -cksetupsh=$PREFIX/setup-chicken4x.sh -cksetupcsh=$PREFIX/setup-chicken4x.csh -setupsh=$PREFIX/buildsetup.sh - -# make a cache dir -mkdir -p $DOWNLOADS -mkdir -p $PREFIX - -# File for users to source to run chicken -echo "# Source me to setup to to run chicken" > $cksetupsh -echo "export PATH=$PREFIX/bin:\$PATH" > $cksetupsh -echo "export LD_LIBRARY_PATH=$PREFIX/lib" >> $cksetupsh - -# tcsh version -echo "setenv PATH $PREFIX/bin:\$PATH" > $cksetupcsh -echo "setenv LD_LIBRARY_PATH $PREFIX/lib" >> $cksetupcsh - -# File to source for build process -echo "export PATH=$PREFIX/bin:\$PATH" > $setupsh -echo "export LD_LIBRARY_PATH=$PREFIX/lib" >> $setupsh - -if [[ $proxy == "" ]]; then - echo 'Please set the environment variable "proxy" to host.com:port (e.g. foo.com:1234) to use a proxy' -else - echo "export http_proxy=http://$proxy" >> $setupsh - echo "export PROX=\"-proxy $proxy\"" >> $setupsh -fi - -echo "export PREFIX=$PREFIX" >> $setupsh - -echo ALL DONE DELETED tests/installall/tests/setup/testconfig Index: tests/installall/tests/setup/testconfig ================================================================== --- tests/installall/tests/setup/testconfig +++ /dev/null @@ -1,18 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -setup setup.sh - -# Test requirements are specified here -[requirements] -# priority 10 - -# Iteration for your tests are controlled by the items section -[items] - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Download and install chicken scheme -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/sqlite3/compile.logpro Index: tests/installall/tests/sqlite3/compile.logpro ================================================================== --- tests/installall/tests/sqlite3/compile.logpro +++ /dev/null @@ -1,9 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Leaving directory" #/(Leaving directory|Nothing to be done for|creating sqlite3)/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" >= 0 "Ignore strerror_r" #/strerror_r/i) -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/sqlite3/compile.sh Index: tests/installall/tests/sqlite3/compile.sh ================================================================== --- tests/installall/tests/sqlite3/compile.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh - -cd sqlite-autoconf-$SQLITE3_VERSION -./configure --prefix=$PREFIX - -make DELETED tests/installall/tests/sqlite3/download.logpro Index: tests/installall/tests/sqlite3/download.logpro ================================================================== --- tests/installall/tests/sqlite3/download.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "sqlite-autoconf" #/sqlite-autoconf/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/sqlite3/download.sh Index: tests/installall/tests/sqlite3/download.sh ================================================================== --- tests/installall/tests/sqlite3/download.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh - -echo Install sqlite3 -if ! [[ -e ${DOWNLOADS}/sqlite-autoconf-${SQLITE3_VERSION}.tar.gz ]]; then - (cd ${DOWNLOADS};wget http://www.sqlite.org/sqlite-autoconf-${SQLITE3_VERSION}.tar.gz) -fi - -tar xfz ${DOWNLOADS}/sqlite-autoconf-${SQLITE3_VERSION}.tar.gz - -ls -l sqlite-autoconf-${SQLITE3_VERSION}.tar.gz DELETED tests/installall/tests/sqlite3/install.logpro Index: tests/installall/tests/sqlite3/install.logpro ================================================================== --- tests/installall/tests/sqlite3/install.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Leaving directory" #/Leaving directory/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/sqlite3/install.sh Index: tests/installall/tests/sqlite3/install.sh ================================================================== --- tests/installall/tests/sqlite3/install.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh - -cd sqlite-autoconf-$SQLITE3_VERSION -make install - DELETED tests/installall/tests/sqlite3/installegg.logpro Index: tests/installall/tests/sqlite3/installegg.logpro ================================================================== --- tests/installall/tests/sqlite3/installegg.logpro +++ /dev/null @@ -1,9 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "chmod sqlite3" #/chmod.*sqlite3/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" >= 0 "Ignore setup-error-handling" #/setup-error-handling/) -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/sqlite3/installegg.sh Index: tests/installall/tests/sqlite3/installegg.sh ================================================================== --- tests/installall/tests/sqlite3/installegg.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh - -CSC_OPTIONS="-I$PREFIX/include -L$PREFIX/lib" $PREFIX/bin/chicken-install $PROX sqlite3 DELETED tests/installall/tests/sqlite3/testconfig Index: tests/installall/tests/sqlite3/testconfig ================================================================== --- tests/installall/tests/sqlite3/testconfig +++ /dev/null @@ -1,24 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -download download.sh -compile compile.sh -install install.sh -installegg installegg.sh - -# Test requirements are specified here -[requirements] -# We waiton chicken because this one installs the egg. It would behove us to split this -# into two tests ... -waiton tougheggs -priority 2 - -# Iteration for your tests are controlled by the items section -[items] - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Install sqlite3 library for systems where it is not installed -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/tougheggs/install.logpro Index: tests/installall/tests/tougheggs/install.logpro ================================================================== --- tests/installall/tests/tougheggs/install.logpro +++ /dev/null @@ -1,9 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Last thing done is chmod ..." #/chmod /) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" >= 0 "Ignore someword-errors" #/\w+-error/) -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/tougheggs/install.sh Index: tests/installall/tests/tougheggs/install.sh ================================================================== --- tests/installall/tests/tougheggs/install.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh - -lockfile $PREFIX/eggs.lock -$PREFIX/bin/chicken-install $PROX $EGG_NAME -rm -f $PREFIX/eggs.lock DELETED tests/installall/tests/tougheggs/testconfig Index: tests/installall/tests/tougheggs/testconfig ================================================================== --- tests/installall/tests/tougheggs/testconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -install install.sh - -# Test requirements are specified here -[requirements] -waiton eggs - -# Iteration for your tests are controlled by the items section -[items] -EGG_NAME intarweb http-client awful uri-common spiffy-request-vars spiffy apropos spiffy-directory-listing - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Download and install eggs with no significant prerequisites -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/zmq/install.logpro Index: tests/installall/tests/zmq/install.logpro ================================================================== --- tests/installall/tests/zmq/install.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/zmq/install.sh Index: tests/installall/tests/zmq/install.sh ================================================================== --- tests/installall/tests/zmq/install.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh DELETED tests/installall/tests/zmq/testconfig Index: tests/installall/tests/zmq/testconfig ================================================================== --- tests/installall/tests/zmq/testconfig +++ /dev/null @@ -1,18 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -install install.sh - -# Test requirements are specified here -[requirements] -waiton zmqlib chicken setup - -# Iteration for your tests are controlled by the items section -[items] - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Install the zmq egg -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/zmqlib/compile.logpro Index: tests/installall/tests/zmqlib/compile.logpro ================================================================== --- tests/installall/tests/zmqlib/compile.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/zmqlib/compile.sh Index: tests/installall/tests/zmqlib/compile.sh ================================================================== --- tests/installall/tests/zmqlib/compile.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh DELETED tests/installall/tests/zmqlib/download.logpro Index: tests/installall/tests/zmqlib/download.logpro ================================================================== --- tests/installall/tests/zmqlib/download.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/zmqlib/download.sh Index: tests/installall/tests/zmqlib/download.sh ================================================================== --- tests/installall/tests/zmqlib/download.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh DELETED tests/installall/tests/zmqlib/install.logpro Index: tests/installall/tests/zmqlib/install.logpro ================================================================== --- tests/installall/tests/zmqlib/install.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/zmqlib/install.sh Index: tests/installall/tests/zmqlib/install.sh ================================================================== --- tests/installall/tests/zmqlib/install.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here - -source $PREFIX/buildsetup.sh DELETED tests/installall/tests/zmqlib/testconfig Index: tests/installall/tests/zmqlib/testconfig ================================================================== --- tests/installall/tests/zmqlib/testconfig +++ /dev/null @@ -1,21 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -download download.sh -untar untar.sh -compile compile.sh -install install.sh - -# Test requirements are specified here -[requirements] -waiton setup - -# Iteration for your tests are controlled by the items section -[items] - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Install the zmq library if it doesn't already exist -tags tagone,tagtwo -reviewed never DELETED tests/installall/tests/zmqlib/untar.logpro Index: tests/installall/tests/zmqlib/untar.logpro ================================================================== --- tests/installall/tests/zmqlib/untar.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/zmqlib/untar.sh Index: tests/installall/tests/zmqlib/untar.sh ================================================================== --- tests/installall/tests/zmqlib/untar.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh DELETED tests/manual.sh Index: tests/manual.sh ================================================================== --- tests/manual.sh +++ /dev/null @@ -1,1 +0,0 @@ -(cd ..;make install) && `realpath ../bin/megatest` -runtests manual_example :sysname ubuntu :fsname afs :datapath none :runname testing -setvars TARGETDISPLAY=:0,TARGETHOST=localhost,TARGETDIR=/tmp/blah,TARGETUSER=matt DELETED tests/mintest/megatest.config Index: tests/mintest/megatest.config ================================================================== --- tests/mintest/megatest.config +++ /dev/null @@ -1,17 +0,0 @@ -[fields] -X TEXT - -[setup] -max_concurrent_jobs 50 -linktree #{getenv MT_RUN_AREA_HOME}/linktree -transport http - -[server] -port 8090 - -[jobtools] -useshell yes -launcher nbfind - -[disks] -disk0 #{getenv PWD}/runs DELETED tests/mintest/runconfigs.config Index: tests/mintest/runconfigs.config ================================================================== --- tests/mintest/runconfigs.config +++ /dev/null @@ -1,6 +0,0 @@ -[default] -ALLTESTS see this variable - -# Your variables here are grouped by targets [SYSTEM/RELEASE] -[a] -ANOTHERVAR only defined if target is "a" DELETED tests/mintest/tests/a/testconfig Index: tests/mintest/tests/a/testconfig ================================================================== --- tests/mintest/tests/a/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton b DELETED tests/mintest/tests/a1/testconfig Index: tests/mintest/tests/a1/testconfig ================================================================== --- tests/mintest/tests/a1/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton b1 DELETED tests/mintest/tests/b/testconfig Index: tests/mintest/tests/b/testconfig ================================================================== --- tests/mintest/tests/b/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton c DELETED tests/mintest/tests/b1/testconfig Index: tests/mintest/tests/b1/testconfig ================================================================== --- tests/mintest/tests/b1/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton c1 DELETED tests/mintest/tests/c/testconfig Index: tests/mintest/tests/c/testconfig ================================================================== --- tests/mintest/tests/c/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton d DELETED tests/mintest/tests/c1/testconfig Index: tests/mintest/tests/c1/testconfig ================================================================== --- tests/mintest/tests/c1/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton d1fail DELETED tests/mintest/tests/d/testconfig Index: tests/mintest/tests/d/testconfig ================================================================== --- tests/mintest/tests/d/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton e DELETED tests/mintest/tests/d1fail/testconfig Index: tests/mintest/tests/d1fail/testconfig ================================================================== --- tests/mintest/tests/d1fail/testconfig +++ /dev/null @@ -1,7 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS -step2 exit 123 - -[requirements] -waiton e1 DELETED tests/mintest/tests/e/testconfig Index: tests/mintest/tests/e/testconfig ================================================================== --- tests/mintest/tests/e/testconfig +++ /dev/null @@ -1,4 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - DELETED tests/mintest/tests/e1/testconfig Index: tests/mintest/tests/e1/testconfig ================================================================== --- tests/mintest/tests/e1/testconfig +++ /dev/null @@ -1,4 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - DELETED tests/mintest/tests/f/testconfig Index: tests/mintest/tests/f/testconfig ================================================================== --- tests/mintest/tests/f/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton DELETED tests/mintest/tests/g/testconfig Index: tests/mintest/tests/g/testconfig ================================================================== --- tests/mintest/tests/g/testconfig +++ /dev/null @@ -1,9 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton b - -[items] -NADA DELETED tests/mintest/tests/h/testconfig Index: tests/mintest/tests/h/testconfig ================================================================== --- tests/mintest/tests/h/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton b DELETED tests/mintest/tests/i/testconfig Index: tests/mintest/tests/i/testconfig ================================================================== --- tests/mintest/tests/i/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton b DELETED tests/mintest/tests/j/testconfig Index: tests/mintest/tests/j/testconfig ================================================================== --- tests/mintest/tests/j/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton b DELETED tests/mintest/tests/k/testconfig Index: tests/mintest/tests/k/testconfig ================================================================== --- tests/mintest/tests/k/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton b DELETED tests/mintest/tests/l/testconfig Index: tests/mintest/tests/l/testconfig ================================================================== --- tests/mintest/tests/l/testconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Add steps here. Format is "stepname script" -[ezsteps] -step1 echo SUCCESS - -[requirements] -waiton b DELETED tests/ods-test.scm Index: tests/ods-test.scm ================================================================== --- tests/ods-test.scm +++ /dev/null @@ -1,13 +0,0 @@ -(load "ods.scm") - -(ods:list->ods - "testing" - "testing.ods" - '((Sheet1 ("Row 1,A" "Row 1,B") - ("Row 2,A" "Row 2,B")) - (Sheet2 (1 2) - (3 4) - () - ("This is sheet 2")) - (Sheet_3 ("Test" "Item Path" "Category" "Value" "Comment") - ("LVS_esd" "eb8zxffd" "Cells" "n")))) DELETED tests/release/Makefile Index: tests/release/Makefile ================================================================== --- tests/release/Makefile +++ /dev/null @@ -1,10 +0,0 @@ - - -dashboard : compile - dashboard -rows 24 & - -compile : runs - cd ../..;make -j install - -runs : - mkdir -p runs DELETED tests/release/megatest.config Index: tests/release/megatest.config ================================================================== --- tests/release/megatest.config +++ /dev/null @@ -1,22 +0,0 @@ -[fields] -release TEXT -iteration TEXT - -[setup] -linktree #{getenv MT_RUN_AREA_HOME}/links -max_concurrent_jobs 100 -logviewer (%MTCMD%) 2> /dev/null > /dev/null -# htmlviewercmd firefox -new-window -htmlviewercmd arora - -[jobtools] -# launcher #{shell if which bsub > /dev/null;then echo bsub;else echo nbfake;fi} -launcher nbfake -maxload 2.5 - -[server] -required yes - -[disks] -disk0 #{getenv MT_RUN_AREA_HOME}/runs - DELETED tests/release/runconfigs.config Index: tests/release/runconfigs.config ================================================================== --- tests/release/runconfigs.config +++ /dev/null @@ -1,9 +0,0 @@ -[default] -MTRUNNER #{shell readlink -f #{getenv MT_RUN_AREA_HOME}/../../utils/mtrunner} -MTTESTDIR #{shell readlink -f #{getenv MT_RUN_AREA_HOME}/..} -MTPATH #{shell readlink -f #{getenv MT_RUN_AREA_HOME}/../../bin} - -[v1.60/15] - -[include atwork.config] - DELETED tests/release/tests/dependencies/simpleresults.logpro Index: tests/release/tests/dependencies/simpleresults.logpro ================================================================== --- tests/release/tests/dependencies/simpleresults.logpro +++ /dev/null @@ -1,110 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ("setup" 1 20) - ("test1/layout/ptran" 1 20) - ("test1/schematic/ptran" 1 20) - ("test2/layout/ptran" 1 20) - ("test2/schematic/ptran" 1 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - )) - -(define warn-specs '()) - -(define nost-specs '( - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -(expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -(expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -(expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -(expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -(expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -(expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) -(expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -(expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -(expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/release/tests/dependencies/testconfig Index: tests/release/tests/dependencies/testconfig ================================================================== --- tests/release/tests/dependencies/testconfig +++ /dev/null @@ -1,12 +0,0 @@ -# test2 from the tests/Makefile - -[var] -tname itemwait - -[ezsteps] - -# Set things up -cleansimple $MTRUNNER $MTTESTDIR/dep-tests $MTPATH megatest -remove-runs -testpatt % -target simple/0 -runname #{get var tname} -simple $MTRUNNER $MTTESTDIR/dep-tests $MTPATH megatest -run -testpatt test2/%/ptran -target simple/0 -runname #{get var tname} -simpleresults $MTRUNNER $MTTESTDIR/dep-tests $MTPATH megatest -list-runs #{get var name} -target simple/0 - DELETED tests/release/tests/fullrun/results.logpro Index: tests/release/tests/fullrun/results.logpro ================================================================== --- tests/release/tests/fullrun/results.logpro +++ /dev/null @@ -1,140 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ("exit_0" 1 20) - ("ezlog_fail_then_pass" 1 20) - ("ezlog_pass" 1 20) - ("ez_pass" 1 20) - ("lineitem_pass" 1 20) - ("priority_1" 1 20) - ("priority_10" 1 20) - ("priority_10_waiton_1" 1 20) - ("priority_3" 1 20) - ("priority_4" 1 20) - ;; ("priority_5" 1 20) - ("priority_6" 1 20) -;; ("priority_7" 1 20) - ("priority_8" 1 20) - ("priority_9" 1 20) - ("runfirst" 7 20) - ("singletest" 1 20) - ("singletest2" 1 20) - ("special" 1 20) - ("sqlitespeed" 10 20) - ("test1" 1 20) - ("test2" 6 20) - ("test_mt_vars" 6 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - ("exit_1" 1 20) - ("ez_exit2_fail" 1 20) - ("ez_fail" 1 20) - ("ez_fail_quick" 1 20) - ("ezlog_fail" 1 20) - ("lineitem_fail" 1 20) - ("logpro_required_fail" 1 20) - ("manual_example" 1 20) - ("neverrun" 1 20))) - -(define warn-specs '(("ezlog_warn" 1 20))) - -(define nost-specs '(("wait_no_items1" 1 20) - ("wait_no_items2" 1 20) - ("wait_no_items3" 1 20) - ("wait_no_items4" 1 20) - ;; ("no_items" 1 20) - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -(expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -(expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -(expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -(expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -(expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -(expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) -(expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -(expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -(expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/release/tests/fullrun/testconfig Index: tests/release/tests/fullrun/testconfig ================================================================== --- tests/release/tests/fullrun/testconfig +++ /dev/null @@ -1,11 +0,0 @@ -[ezsteps] -cleantop $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -remove-runs -target ubuntu/nfs/none -runname release_toplevel -testpatt % -runall $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt % -target ubuntu/nfs/none -runname release_toplevel -runwait -runtop $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt all_toplevel -target ubuntu/nfs/none -runname release_toplevel -rerun FAIL -preclean -runwait -results $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs release_toplevel -target ubuntu/nfs/none -runname release_toplevel - -[requirements] -# waiton #{getenv ALL_TOPLEVEL_TESTS} - -# This is a "toplevel" test, it does not require waitons to be non-FAIL to run -# mode toplevel DELETED tests/release/tests/itemwait/testconfig Index: tests/release/tests/itemwait/testconfig ================================================================== --- tests/release/tests/itemwait/testconfig +++ /dev/null @@ -1,24 +0,0 @@ -# test2 from the tests/Makefile - -[var] -tname itemwait - -[pre-launch-env-vars] -NUMTESTS 20 - -[ezsteps] - -# Set things up -clean $MTRUNNER $MTTESTDIR/fdktestqa/testqa $MTPATH megatest -remove-runs -testpatt % -target %/% -runname #{get var tname}% -runbigrun3 $MTRUNNER $MTTESTDIR/fdktestqa/testqa $MTPATH nbfake megatest -run -testpatt bigrun3 -target a/bigrun3 -runname #{get var tname} -# watchrun watches until it sees at least one RUNNING in bigrun and one PASS in bigrun2 -watchrun sleep 15;watchrun.sh #{get var tname} - -[requirements] -# waiton #{getenv ALL_TOPLEVEL_TESTS} - -# This is a "toplevel" test, it does not require waitons to be non-FAIL to run -# mode toplevel - - -# test2 : fullprep DELETED tests/release/tests/itemwait/watchrun.sh Index: tests/release/tests/itemwait/watchrun.sh ================================================================== --- tests/release/tests/itemwait/watchrun.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -runname=$1 - -pass=no -alldone=no -while [[ $alldone == no ]];do - sleep 5 - $MTRUNNER $MTTESTDIR/fdktestqa/testqa $MTPATH megatest -list-runs $runname > list-runs.log - bigrun_running=$(cat list-runs.log | egrep 'bigrun\(.*RUNNING'|wc -l) - bigrun2_pass=$(cat list-runs.log | egrep 'bigrun2.*COMPLETED.*PASS'|wc -l) - echo "bigrun_running=$bigrun_running, bigrun2_pass=$bigrun2_pass" - if [[ $bigrun_running -gt 0 ]] && [[ $bigrun2_pass -gt 0 ]];then - pass=yes - alldone=yes - fi - if [[ $bigrun_running -eq 0 ]];then - echo "bigrun all done and no bigrun2 found with PASS." - alldone=yes - fi -done - -if [[ $pass == yes ]];then - echo PASS - exit 0 -else - echo FAIL - exit 1 -fi DELETED tests/release/tests/rollup/firstres.logpro Index: tests/release/tests/rollup/firstres.logpro ================================================================== --- tests/release/tests/rollup/firstres.logpro +++ /dev/null @@ -1,144 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ;; ("exit_0" 1 20) - ;; ("ezlog_fail_then_pass" 1 20) - ;; ("ezlog_pass" 1 20) - ;; ("ez_pass" 1 20) - ;; ("lineitem_pass" 1 20) - ;; ("priority_1" 1 20) - ;; ("priority_10" 1 20) - ;; ("priority_10_waiton_1" 1 20) - ;; ("priority_3" 1 20) - ;; ("priority_4" 1 20) - ;; ;; ("priority_5" 1 20) - ;; ("priority_6" 1 20) -;; ;; ("priority_7" 1 20) - ;; ("priority_8" 1 20) - ;; ("priority_9" 1 20) - ("runfirst" 7 20) - ;; ("singletest" 1 20) - ;; ("singletest2" 1 20) - ;; ("special" 1 20) - ;; ("sqlitespeed" 10 20) - ;; ("test1" 1 20) - ;; ("test2" 6 20) - ;; ("test_mt_vars" 6 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - ;; ("exit_1" 1 20) - ;; ("ez_exit2_fail" 1 20) - ;; ("ez_fail" 1 20) - ;; ("ez_fail_quick" 1 20) - ;; ("ezlog_fail" 1 20) - ;; ("lineitem_fail" 1 20) - ;; ("logpro_required_fail" 1 20) - ;; ("manual_example" 1 20) - ;; ("neverrun" 1 20) - )) - -(define warn-specs '( - ;; ("ezlog_warn" 1 20) - )) - -(define nost-specs '( - ;; ("wait_no_items1" 1 20) - ;; ("wait_no_items2" 1 20) - ;; ("wait_no_items3" 1 20) - ;; ("wait_no_items4" 1 20) - ;; ("no_items" 1 20) - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) -;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/release/tests/rollup/results.logpro Index: tests/release/tests/rollup/results.logpro ================================================================== --- tests/release/tests/rollup/results.logpro +++ /dev/null @@ -1,145 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ;; ("exit_0" 1 20) - ;; ("ezlog_fail_then_pass" 1 20) - ;; ("ezlog_pass" 1 20) - ;; ("ez_pass" 1 20) - ;; ("lineitem_pass" 1 20) - ;; ("priority_1" 1 20) - ;; ("priority_10" 1 20) - ;; ("priority_10_waiton_1" 1 20) - ;; ("priority_3" 1 20) - ;; ("priority_4" 1 20) - ;; ;; ("priority_5" 1 20) - ;; ("priority_6" 1 20) -;; ;; ("priority_7" 1 20) - ;; ("priority_8" 1 20) - ;; ("priority_9" 1 20) - ("runfirst" 5 20) - ;; ("singletest" 1 20) - ;; ("singletest2" 1 20) - ;; ("special" 1 20) - ;; ("sqlitespeed" 10 20) - ;; ("test1" 1 20) - ;; ("test2" 6 20) - ;; ("test_mt_vars" 6 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - ;; ("exit_1" 1 20) - ;; ("ez_exit2_fail" 1 20) - ;; ("ez_fail" 1 20) - ;; ("ez_fail_quick" 1 20) - ;; ("ezlog_fail" 1 20) - ;; ("lineitem_fail" 1 20) - ;; ("logpro_required_fail" 1 20) - ;; ("manual_example" 1 20) - ;; ("neverrun" 1 20) - )) - -(define warn-specs '( - ;; ("ezlog_warn" 1 20) - )) - -(define nost-specs '( - ;; ("wait_no_items1" 1 20) - ;; ("wait_no_items2" 1 20) - ;; ("wait_no_items3" 1 20) - ;; ("wait_no_items4" 1 20) - ;; ("no_items" 1 20) - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -(expect:required in logbody = 1 "Toplevel will be NOT_STARTED" #/Test: runfirst\s+State: (INCOMPLETE|NOT_STARTED)/) -(expect:required in logbody = 1 "runfirst/b/2 will be NOT_STARTED/INCOMPLETE" #/Test: runfirst.b.2.\s+State: NOT_STARTED\s+Status: INCOMPLETE/) -;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/release/tests/rollup/testconfig Index: tests/release/tests/rollup/testconfig ================================================================== --- tests/release/tests/rollup/testconfig +++ /dev/null @@ -1,28 +0,0 @@ -# test2 from the tests/Makefile - -[var] -tname rollup - -[ezsteps] - -# Set things up -clean $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -remove-runs -testpatt % -target ubuntu/nfs/none -runname #{get var tname}% -runfirst $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -runtests runfirst/% -reqtarg ubuntu/nfs/none -runname #{get var tname} -preclean -firstres $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs #{get var tname} -target ubuntu/nfs/none - -# Set one test item to INCOMPLETE -setstate $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -set-state-status INCOMPLETE,FAIL :state COMPLETED :status PASS -testpatt runfirst/b/2 -target ubuntu/nfs/none -runname #{get var tname} - -# Rerun a different test item -rerun $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt runfirst/spring -reqtarg ubuntu/nfs/none -runname #{get var tname} -preclean -rerun PASS - -results $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs #{get var tname} -target ubuntu/nfs/none - -[requirements] -# waiton #{getenv ALL_TOPLEVEL_TESTS} - -# This is a "toplevel" test, it does not require waitons to be non-FAIL to run -# mode toplevel - - -# test2 : fullprep DELETED tests/release/tests/test2/results.logpro Index: tests/release/tests/test2/results.logpro ================================================================== --- tests/release/tests/test2/results.logpro +++ /dev/null @@ -1,144 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ;; ("exit_0" 1 20) - ;; ("ezlog_fail_then_pass" 1 20) - ;; ("ezlog_pass" 1 20) - ;; ("ez_pass" 1 20) - ;; ("lineitem_pass" 1 20) - ;; ("priority_1" 1 20) - ;; ("priority_10" 1 20) - ;; ("priority_10_waiton_1" 1 20) - ;; ("priority_3" 1 20) - ;; ("priority_4" 1 20) - ;; ;; ("priority_5" 1 20) - ;; ("priority_6" 1 20) -;; ;; ("priority_7" 1 20) - ;; ("priority_8" 1 20) - ;; ("priority_9" 1 20) - ("runfirst" 2 20) - ;; ("singletest" 1 20) - ;; ("singletest2" 1 20) - ;; ("special" 1 20) - ;; ("sqlitespeed" 10 20) - ;; ("test1" 1 20) - ;; ("test2" 6 20) - ;; ("test_mt_vars" 6 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - ;; ("exit_1" 1 20) - ;; ("ez_exit2_fail" 1 20) - ;; ("ez_fail" 1 20) - ;; ("ez_fail_quick" 1 20) - ;; ("ezlog_fail" 1 20) - ;; ("lineitem_fail" 1 20) - ;; ("logpro_required_fail" 1 20) - ;; ("manual_example" 1 20) - ;; ("neverrun" 1 20) - )) - -(define warn-specs '( - ;; ("ezlog_warn" 1 20) - )) - -(define nost-specs '( - ;; ("wait_no_items1" 1 20) - ;; ("wait_no_items2" 1 20) - ;; ("wait_no_items3" 1 20) - ;; ("wait_no_items4" 1 20) - ;; ("no_items" 1 20) - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) -;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/release/tests/test2/results_a.logpro Index: tests/release/tests/test2/results_a.logpro ================================================================== --- tests/release/tests/test2/results_a.logpro +++ /dev/null @@ -1,144 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ;; ("exit_0" 1 20) - ;; ("ezlog_fail_then_pass" 1 20) - ;; ("ezlog_pass" 1 20) - ;; ("ez_pass" 1 20) - ;; ("lineitem_pass" 1 20) - ;; ("priority_1" 1 20) - ;; ("priority_10" 1 20) - ;; ("priority_10_waiton_1" 1 20) - ;; ("priority_3" 1 20) - ;; ("priority_4" 1 20) - ;; ;; ("priority_5" 1 20) - ;; ("priority_6" 1 20) -;; ;; ("priority_7" 1 20) - ;; ("priority_8" 1 20) - ;; ("priority_9" 1 20) - ("runfirst" 2 20) - ;; ("singletest" 1 20) - ;; ("singletest2" 1 20) - ;; ("special" 1 20) - ;; ("sqlitespeed" 10 20) - ;; ("test1" 1 20) - ;; ("test2" 6 20) - ;; ("test_mt_vars" 6 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - ;; ("exit_1" 1 20) - ;; ("ez_exit2_fail" 1 20) - ;; ("ez_fail" 1 20) - ;; ("ez_fail_quick" 1 20) - ;; ("ezlog_fail" 1 20) - ;; ("lineitem_fail" 1 20) - ;; ("logpro_required_fail" 1 20) - ;; ("manual_example" 1 20) - ;; ("neverrun" 1 20) - )) - -(define warn-specs '( - ;; ("ezlog_warn" 1 20) - )) - -(define nost-specs '( - ;; ("wait_no_items1" 1 20) - ;; ("wait_no_items2" 1 20) - ;; ("wait_no_items3" 1 20) - ;; ("wait_no_items4" 1 20) - ;; ("no_items" 1 20) - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) -;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/release/tests/test2/results_b.logpro Index: tests/release/tests/test2/results_b.logpro ================================================================== --- tests/release/tests/test2/results_b.logpro +++ /dev/null @@ -1,144 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ;; ("exit_0" 1 20) - ;; ("ezlog_fail_then_pass" 1 20) - ;; ("ezlog_pass" 1 20) - ;; ("ez_pass" 1 20) - ;; ("lineitem_pass" 1 20) - ;; ("priority_1" 1 20) - ;; ("priority_10" 1 20) - ;; ("priority_10_waiton_1" 1 20) - ;; ("priority_3" 1 20) - ;; ("priority_4" 1 20) - ;; ;; ("priority_5" 1 20) - ;; ("priority_6" 1 20) -;; ;; ("priority_7" 1 20) - ;; ("priority_8" 1 20) - ;; ("priority_9" 1 20) - ("runfirst" 2 20) - ;; ("singletest" 1 20) - ;; ("singletest2" 1 20) - ;; ("special" 1 20) - ;; ("sqlitespeed" 10 20) - ;; ("test1" 1 20) - ;; ("test2" 6 20) - ;; ("test_mt_vars" 6 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - ;; ("exit_1" 1 20) - ;; ("ez_exit2_fail" 1 20) - ;; ("ez_fail" 1 20) - ;; ("ez_fail_quick" 1 20) - ;; ("ezlog_fail" 1 20) - ;; ("lineitem_fail" 1 20) - ;; ("logpro_required_fail" 1 20) - ;; ("manual_example" 1 20) - ;; ("neverrun" 1 20) - )) - -(define warn-specs '( - ;; ("ezlog_warn" 1 20) - )) - -(define nost-specs '( - ;; ("wait_no_items1" 1 20) - ;; ("wait_no_items2" 1 20) - ;; ("wait_no_items3" 1 20) - ;; ("wait_no_items4" 1 20) - ;; ("no_items" 1 20) - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) -;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/release/tests/test2/testconfig Index: tests/release/tests/test2/testconfig ================================================================== --- tests/release/tests/test2/testconfig +++ /dev/null @@ -1,27 +0,0 @@ -# test2 from the tests/Makefile - -[var] -tname test2 -mtpath #{shell readlink -f ../../bin} - -[ezsteps] -clean $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -remove-runs -testpatt % -target ubuntu/nfs/none -runname #{get var tname}% -part1 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt ez_pass,runfirst/a/% -reqtarg ubuntu/nfs/none -runname #{get var tname} -preclean -part2 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt %/,%/ai -reqtarg ubuntu/nfs/none -runname #{get var tname}_a -preclean -part3 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -runtests %/,%/ai -reqtarg ubuntu/nfs/none -runname #{get var tname}_b -preclean -part4 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt runfirst/%,%/ai -reqtarg ubuntu/nfs/none -runname #{get var tname}_a -preclean -part5 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt %/,%/winter -reqtarg ubuntu/nfs/none -runname #{get var tname}_a -preclean -part6 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -set-state-status COMPLETED,FORCED :state COMPLETED :status PASS -testpatt ez_p%s,runfirst/ -target ubuntu/nfs/none -runname #{get var tname} - -results $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs #{get var tname} -target ubuntu/nfs/none -results_a $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs #{get var tname}_a -target ubuntu/nfs/none -results_b $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs #{get var tname}_b -target ubuntu/nfs/none - -[requirements] -# waiton #{getenv ALL_TOPLEVEL_TESTS} - -# This is a "toplevel" test, it does not require waitons to be non-FAIL to run -# mode toplevel - - -# test2 : fullprep DELETED tests/release/tests/testpatt/cleanres.logpro Index: tests/release/tests/testpatt/cleanres.logpro ================================================================== --- tests/release/tests/testpatt/cleanres.logpro +++ /dev/null @@ -1,144 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ;; ("exit_0" 1 20) - ;; ("ezlog_fail_then_pass" 1 20) - ;; ("ezlog_pass" 1 20) - ;; ("ez_pass" 1 20) - ;; ("lineitem_pass" 1 20) - ;; ("priority_1" 1 20) - ;; ("priority_10" 1 20) - ;; ("priority_10_waiton_1" 1 20) - ;; ("priority_3" 1 20) - ;; ("priority_4" 1 20) - ;; ;; ("priority_5" 1 20) - ;; ("priority_6" 1 20) -;; ;; ("priority_7" 1 20) - ;; ("priority_8" 1 20) - ;; ("priority_9" 1 20) - ;; ("runfirst" 2 20) - ;; ("singletest" 1 20) - ;; ("singletest2" 1 20) - ;; ("special" 1 20) - ;; ("sqlitespeed" 10 20) - ;; ("test1" 1 20) - ;; ("test2" 6 20) - ;; ("test_mt_vars" 6 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - ;; ("exit_1" 1 20) - ;; ("ez_exit2_fail" 1 20) - ;; ("ez_fail" 1 20) - ;; ("ez_fail_quick" 1 20) - ;; ("ezlog_fail" 1 20) - ;; ("lineitem_fail" 1 20) - ;; ("logpro_required_fail" 1 20) - ;; ("manual_example" 1 20) - ;; ("neverrun" 1 20) - )) - -(define warn-specs '( - ;; ("ezlog_warn" 1 20) - )) - -(define nost-specs '( - ;; ("wait_no_items1" 1 20) - ;; ("wait_no_items2" 1 20) - ;; ("wait_no_items3" 1 20) - ;; ("wait_no_items4" 1 20) - ;; ("no_items" 1 20) - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) -;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/release/tests/testpatt/results.logpro Index: tests/release/tests/testpatt/results.logpro ================================================================== --- tests/release/tests/testpatt/results.logpro +++ /dev/null @@ -1,144 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ;; ("exit_0" 1 20) - ;; ("ezlog_fail_then_pass" 1 20) - ;; ("ezlog_pass" 1 20) - ;; ("ez_pass" 1 20) - ;; ("lineitem_pass" 1 20) - ;; ("priority_1" 1 20) - ;; ("priority_10" 1 20) - ;; ("priority_10_waiton_1" 1 20) - ;; ("priority_3" 1 20) - ;; ("priority_4" 1 20) - ;; ;; ("priority_5" 1 20) - ;; ("priority_6" 1 20) -;; ;; ("priority_7" 1 20) - ;; ("priority_8" 1 20) - ;; ("priority_9" 1 20) - ("runfirst" 2 20) - ;; ("singletest" 1 20) - ;; ("singletest2" 1 20) - ;; ("special" 1 20) - ;; ("sqlitespeed" 10 20) - ;; ("test1" 1 20) - ;; ("test2" 6 20) - ;; ("test_mt_vars" 6 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - ;; ("exit_1" 1 20) - ;; ("ez_exit2_fail" 1 20) - ;; ("ez_fail" 1 20) - ;; ("ez_fail_quick" 1 20) - ;; ("ezlog_fail" 1 20) - ;; ("lineitem_fail" 1 20) - ;; ("logpro_required_fail" 1 20) - ;; ("manual_example" 1 20) - ;; ("neverrun" 1 20) - )) - -(define warn-specs '( - ;; ("ezlog_warn" 1 20) - )) - -(define nost-specs '( - ;; ("wait_no_items1" 1 20) - ;; ("wait_no_items2" 1 20) - ;; ("wait_no_items3" 1 20) - ;; ("wait_no_items4" 1 20) - ;; ("no_items" 1 20) - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) -;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/release/tests/testpatt/testconfig Index: tests/release/tests/testpatt/testconfig ================================================================== --- tests/release/tests/testpatt/testconfig +++ /dev/null @@ -1,12 +0,0 @@ -[ezsteps] -clean $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -remove-runs -testpatt % -target ubuntu/nfs/none -runname release_testpatt -cleanres $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs release_testpatt -target ubuntu/nfs/none - -runitems $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt runfirst/%2 -target ubuntu/nfs/none -runname release_testpatt -results $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs release_testpatt -target ubuntu/nfs/none - -[requirements] -# waiton #{getenv ALL_TOPLEVEL_TESTS} - -# This is a "toplevel" test, it does not require waitons to be non-FAIL to run -# mode toplevel DELETED tests/release/tests/testpatt_envvar/results.logpro Index: tests/release/tests/testpatt_envvar/results.logpro ================================================================== --- tests/release/tests/testpatt_envvar/results.logpro +++ /dev/null @@ -1,141 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ("exit_0" 1 20) - ("ezlog_fail_then_pass" 1 20) - ("ezlog_pass" 1 20) - ("ez_pass" 1 20) - ("lineitem_pass" 1 20) - ("priority_1" 1 20) - ("priority_10" 1 20) - ("priority_10_waiton_1" 1 20) - ("priority_3" 1 20) - ("priority_4" 1 20) - ;; ("priority_5" 1 20) - ("priority_6" 1 20) -;; ("priority_7" 1 20) - ("priority_8" 1 20) - ("priority_9" 1 20) - ("runfirst" 7 20) - ("singletest" 1 20) - ("singletest2" 1 20) - ("special" 1 20) - ("sqlitespeed" 10 20) - ("test1" 1 20) - ("test2" 6 20) - ("test_mt_vars" 6 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - ("exit_1" 1 20) - ("ez_exit2_fail" 1 20) - ("ez_fail" 1 20) - ("ez_fail_quick" 1 20) - ("ezlog_fail" 1 20) - ("lineitem_fail" 1 20) - ("logpro_required_fail" 1 20) - ("manual_example" 1 20) - ("neverrun" 1 20))) - -(define warn-specs '(("ezlog_warn" 1 20))) - -(define nost-specs '(("wait_no_items1" 1 20) - ("wait_no_items2" 1 20) - ("wait_no_items3" 1 20) - ("wait_no_items4" 1 20) - ;; ("no_items" 1 20) - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -(expect:error in logbody > 0 "blocktestxz not to run" #/Test: blocktestxz/) -(expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -(expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -(expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -(expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -(expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -(expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) -(expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -(expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -(expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/release/tests/testpatt_envvar/testconfig Index: tests/release/tests/testpatt_envvar/testconfig ================================================================== --- tests/release/tests/testpatt_envvar/testconfig +++ /dev/null @@ -1,14 +0,0 @@ -[var] -targ -target ubuntu/nfs/all_toplevel -tp -testpatt % - -[ezsteps] -cleantop $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -remove-runs #{get var tp} #{get var targ} -runname release_toplevel -runall $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run #{get var tp} #{get var targ} -runname release_toplevel -runwait -results $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs release_toplevel #{get var targ} -runname release_toplevel - -[requirements] -# waiton #{getenv ALL_TOPLEVEL_TESTS} - -# This is a "toplevel" test, it does not require waitons to be non-FAIL to run -# mode toplevel DELETED tests/release/tests/toprun/results.logpro Index: tests/release/tests/toprun/results.logpro ================================================================== --- tests/release/tests/toprun/results.logpro +++ /dev/null @@ -1,140 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(define logbody "LogFileBody") - -(define pass-specs '( ;; testname num-expected max-runtime - ("exit_0" 1 20) - ("ezlog_fail_then_pass" 1 20) - ("ezlog_pass" 1 20) - ("ez_pass" 1 20) - ("lineitem_pass" 1 20) - ("priority_1" 1 20) - ("priority_10" 1 20) - ("priority_10_waiton_1" 1 20) - ("priority_3" 1 20) - ("priority_4" 1 20) - ;; ("priority_5" 1 20) - ("priority_6" 1 20) -;; ("priority_7" 1 20) - ("priority_8" 1 20) - ("priority_9" 1 20) - ("runfirst" 7 20) - ("singletest" 1 20) - ("singletest2" 1 20) - ("special" 1 20) - ("sqlitespeed" 10 20) - ("test1" 1 20) - ("test2" 6 20) - ("test_mt_vars" 6 20) - )) - -(define fail-specs '( ;; testname num-expected max-runtime - ("exit_1" 1 20) - ("ez_exit2_fail" 1 20) - ("ez_fail" 1 20) - ("ez_fail_quick" 1 20) - ("ezlog_fail" 1 20) - ("lineitem_fail" 1 20) - ("logpro_required_fail" 1 20) - ("manual_example" 1 20) - ("neverrun" 1 20))) - -(define warn-specs '(("ezlog_warn" 1 20))) - -(define nost-specs '(("wait_no_items1" 1 20) - ("wait_no_items2" 1 20) - ("wait_no_items3" 1 20) - ("wait_no_items4" 1 20) - ;; ("no_items" 1 20) - )) - -(define (check-one-test estate estatus testname count runtime) - (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) - (msg1 (conc testname " expecting count of " count)) - (msg2 (conc testname " expecting runtime less than " runtime))) - (expect:required in logbody = count msg1 rxe) - ;;(expect:value in logbody count < msg2 rxe) - )) - -;; Special cases -;; -(expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) -(expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) -(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) -(expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) -(expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -(expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) -(expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) -(expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) -(expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) -(expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) - -;; General cases -;; -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "PASS" testdat)) - pass-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "FAIL" testdat)) - fail-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "COMPLETED" "WARN" testdat)) - warn-specs) - -(for-each - (lambda (testdat) - (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) - nost-specs) - -;; Catch all. -;; -(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) - - -;; ;; define your hooks -;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") -;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") -;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") -;; -;; ;; first ensure your run at least started -;; ;; -;; (trigger "Init" #/This is a header/) -;; (trigger "InitEnd" #/^\s*$/) -;; (section "Init" "Init" "InitEnd") -;; -;; (trigger "Body" #/^.*$/) ;; anything starts the body -;; ;; (trigger "EndBody" #/This had better never match/) -;; -;; (section "Body" "Body" "EndBody") -;; -;; (trigger "Blah2" #/^begin Blah2/) -;; (trigger "Blah2End" #/^end Blah2/) -;; (section "Blah2" "Blah2" "Blah2End") -;; -;; (expect:required in "Init" = 1 "Header" #/This is a header/) -;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) -;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) -;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) -;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) -;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) -;; -;; ;; Using match number -;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; ;; Comparison instead of tolerance -;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) -;; -;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) -;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) -;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors -;; -;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) DELETED tests/release/tests/toprun/testconfig Index: tests/release/tests/toprun/testconfig ================================================================== --- tests/release/tests/toprun/testconfig +++ /dev/null @@ -1,15 +0,0 @@ -[misc] -rname release_toprun -rdir $MTTESTDIR/fullrun - -[ezsteps] -cleantop $MTRUNNER #{get misc rdir} $MTPATH megatest -remove-runs -testpatt % -target ubuntu/nfs/none -runname #{get misc rname} -testpatt % -runall $MTRUNNER #{get misc rdir} $MTPATH megatest -run -testpatt % -target ubuntu/nfs/none -runname #{get misc rname} -runwait -runtop $MTRUNNER #{get misc rdir} $MTPATH megatest -runtests all_toplevel -target ubuntu/nfs/none -runname #{get misc rname} -runwait -results $MTRUNNER #{get misc rdir} $MTPATH megatest -list-runs #{get misc rname} -target ubuntu/nfs/none - -[requirements] -# waiton #{getenv ALL_TOPLEVEL_TESTS} - -# This is a "toplevel" test, it does not require waitons to be non-FAIL to run -# mode toplevel DELETED tests/resources/ruby/librunscript.rb Index: tests/resources/ruby/librunscript.rb ================================================================== --- tests/resources/ruby/librunscript.rb +++ /dev/null @@ -1,37 +0,0 @@ -# This is the library of stuff for megatest - -def run_and_record(stepname, cmd, checks) - system "megatest -step #{stepname} :state start :status n/a" - system cmd - exitcode=$? - if exitcode==0 - exitcode='pass' - else - exitcode='fail' - end - system "megatest -step #{stepname} :state end :status #{exitcode}" -end - -def record_step(stepname,state,status) - system "megatest -step #{stepname} :state #{state} :status #{status}" -end - -def test_status(state,status) - system "megatest -test-status :state #{state} :status #{status}" -end - - -# WARNING: This example is deprecated. Don't use the -test-status command -# unless you know for sure what you are doing. -def file_size_checker(stepname,filename,minsize,maxsize) - fsize=File.size(filename) - if fsize > maxsize or fsize < minsize - system "megatest -test-status :state COMPLETED :status fail" - else - system "megatest -test-status :state COMPLETED :status pass" - end -end - - -def wait_for_step(testname,stepname) -end DELETED tests/rununittest.sh Index: tests/rununittest.sh ================================================================== --- tests/rununittest.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Usage: rununittest.sh testname debuglevel -# - -# put megatest on path from correct location -mtbindir=$(readlink -f ../bin) - -export PATH="${mtbindir}:$PATH" - -# Clean setup -# -dbdir=$(cd simplerun;megatest -show-config -section setup -var linktree)/.db -rm -f simplerun/megatest.db simplerun/monitor.db simplerun/db/monitor.db $dbdir/*.db -rm -rf simplelinks/ simpleruns/ simplerun/db/ $dbdir -mkdir -p simplelinks simpleruns -(cd simplerun;cp ../../*_records.scm .;perl -pi.bak -e 's/define-inline/define/' *_records.scm) - -# Run the test $1 is the unit test to run -cd simplerun;echo '(load "../tests.scm")' | ../../bin/megatest -repl -debug $2 $1 DELETED tests/simplerun/megatest.config Index: tests/simplerun/megatest.config ================================================================== --- tests/simplerun/megatest.config +++ /dev/null @@ -1,32 +0,0 @@ -[fields] -SYSTEM TEXT -RELEASE TEXT - -[setup] -# Adjust max_concurrent_jobs to limit how much you load your machines -max_concurrent_jobs 50 - -# Uncomment this to make the in-mem db into a disk based db (slower but good for debug) -# be aware that some unit tests will fail with this due to persistent data -# -# tmpdb /tmp - -# This is your link path, you can move it but it is generally better to keep it stable -linktree #{getenv MT_RUN_AREA_HOME}/../simplelinks - -# Valid values for state and status for steps, NB// It is not recommended you use this -[validvalues] -state start end completed - -# Job tools are more advanced ways to control how your jobs are launched -[jobtools] -useshell yes -launcher nbfind - -# You can override environment variables for all your tests here -[env-override] -EXAMPLE_VAR example value - -# As you run more tests you may need to add additional disks, the names are arbitrary but must be unique -[disks] -disk0 #{getenv MT_RUN_AREA_HOME}/../simpleruns DELETED tests/simplerun/runconfigs.config Index: tests/simplerun/runconfigs.config ================================================================== --- tests/simplerun/runconfigs.config +++ /dev/null @@ -1,6 +0,0 @@ -[default] -ALLTESTS see this variable - -# Your variables here are grouped by targets [SYSTEM/RELEASE] -[SYSTEM_val/RELEASE_val] -ANOTHERVAR only defined if target is SYSTEM_val/RELEASE_val DELETED tests/simplerun/test.config Index: tests/simplerun/test.config ================================================================== --- tests/simplerun/test.config +++ /dev/null @@ -1,31 +0,0 @@ -[section1] -1 ./blah - -[section2] - -# A comment - -[disks] -1 ./ - -[validvalues] -state start end aborted -status pass fail n/a - -[include a file that doesn't exist] - - -blah nada - -# now inlcude a file tha tdoes exist -[include megatest.config] - -[metadata] -description This is a multiline - description. The leading whitespace is discarded - irrespective of amount of indenting. - This line is indented more. - - -author matt -lastreview never DELETED tests/simplerun/tests/test1/step1.logpro Index: tests/simplerun/tests/test1/step1.logpro ================================================================== --- tests/simplerun/tests/test1/step1.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -;; (expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/simplerun/tests/test1/step1.sh Index: tests/simplerun/tests/test1/step1.sh ================================================================== --- tests/simplerun/tests/test1/step1.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -echo Got here! - DELETED tests/simplerun/tests/test1/step2.logpro Index: tests/simplerun/tests/test1/step2.logpro ================================================================== --- tests/simplerun/tests/test1/step2.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -;; (expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/simplerun/tests/test1/step2.sh Index: tests/simplerun/tests/test1/step2.sh ================================================================== --- tests/simplerun/tests/test1/step2.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -echo Got here eh! - - DELETED tests/simplerun/tests/test1/testconfig Index: tests/simplerun/tests/test1/testconfig ================================================================== --- tests/simplerun/tests/test1/testconfig +++ /dev/null @@ -1,21 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -step1 step1.sh -step2 step2.sh - -# Test requirements are specified here -[requirements] -# waiton setup -priority 0 - -# Iteration for your tests are controlled by the items section -[items] -# PARTOFDAY morning noon afternoon evening night - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description An example test -tags tagone,tagtwo -reviewed never DELETED tests/simplerun/tests/test2/step1.logpro Index: tests/simplerun/tests/test2/step1.logpro ================================================================== --- tests/simplerun/tests/test2/step1.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -;; (expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/simplerun/tests/test2/step1.sh Index: tests/simplerun/tests/test2/step1.sh ================================================================== --- tests/simplerun/tests/test2/step1.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here DELETED tests/simplerun/tests/test2/step2.logpro Index: tests/simplerun/tests/test2/step2.logpro ================================================================== --- tests/simplerun/tests/test2/step2.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -;; (expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/simplerun/tests/test2/step2.sh Index: tests/simplerun/tests/test2/step2.sh ================================================================== --- tests/simplerun/tests/test2/step2.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here DELETED tests/simplerun/tests/test2/testconfig Index: tests/simplerun/tests/test2/testconfig ================================================================== --- tests/simplerun/tests/test2/testconfig +++ /dev/null @@ -1,21 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -step1 step1.sh -step2 step2.sh - -# Test requirements are specified here -[requirements] -waiton test1 -priority 0 - -# Iteration for your tests are controlled by the items section -[items] -LANDTYPE desert plains forest jungle beach - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Yet another example test -tags tagone,tagtwo -reviewed never DELETED tests/speedtest/megatest.config Index: tests/speedtest/megatest.config ================================================================== --- tests/speedtest/megatest.config +++ /dev/null @@ -1,48 +0,0 @@ -[fields] -sysname TEXT -fsname TEXT -datapath TEXT - -[setup] -transport #{scheme (if (getenv "USEHTTP") "http" "fs")} - -max_concurrent_jobs 50 - -# It is possible (but not recommended) to override the rsync command used -# to populate the test directories. For test development the following -# example can be useful -# -testcopycmd cp --remove-destination -rsv TEST_SRC_PATH/. TEST_TARG_PATH/. >> TEST_TARG_PATH/mt_launch.log 2>> TEST_TARG_PATH/mt_launch.log - -# FULL or 2, NORMAL or 1, OFF or 0 -synchronous OFF - -# override the logview command -# -logviewer (%MTCMD%) 2> /dev/null > /dev/null - -# override the html viewer launch command -# -# htmlviewercmd firefox -new-window -htmlviewercmd konqueror - -[jobtools] -launcher nbfake - -[server] - -# If the server can't be started on this port it will try the next port until -# it succeeds -port 8080 - -# This server will keep running this number of hours after last access. -# Three minutes is 0.05 hours -timeout 0.025 - -## disks are: -## name host:/path/to/area -## -or- -## name /path/to/area -[disks] -disk0 #{getenv MT_RUN_AREA_HOME}/tmp_run - DELETED tests/speedtest/runconfigs.config Index: tests/speedtest/runconfigs.config ================================================================== --- tests/speedtest/runconfigs.config +++ /dev/null @@ -1,3 +0,0 @@ -[default] -SOMEVAR This should show up in SOMEVAR3 - DELETED tests/speedtest/tests/speedtest/main.sh Index: tests/speedtest/tests/speedtest/main.sh ================================================================== --- tests/speedtest/tests/speedtest/main.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# a bunch of steps in 2 second increments -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do - $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html - sleep $TEST_DELAY - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/speedtest/tests/speedtest/testconfig Index: tests/speedtest/tests/speedtest/testconfig ================================================================== --- tests/speedtest/tests/speedtest/testconfig +++ /dev/null @@ -1,18 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 1 - -[items] -SETLOG 0 1 -TEST_DELAY 0 1 2 3 4 5 6 7 8 9 10 -ITERATIONS 0 1 2 3 4 5 6 7 8 9 10 - -[test_meta] -author matt -owner bob -description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/stats.txt Index: tests/stats.txt ================================================================== --- tests/stats.txt +++ /dev/null @@ -1,77 +0,0 @@ -DB Stats: a1236d6bf92ec5cb8955f490761b21b0d3eea9d3 -======== -Cmd Count TotTime Avg -get-count-tests-running-for-run-id 1035 237.0 0.23 -get-count-tests-running-in-jobgroup 884 119.0 0.13 -get-count-tests-running 884 169.0 0.19 -get-prereqs-not-met 884 732.0 0.83 -get-test-info-by-id 673 122.0 0.18 -get-keys 476 1.0 0.00 -get-test-id 356 42.0 0.12 -testmeta-get-record 203 24.0 0.12 -roll-up-pass-fail-counts 159 39.0 0.25 -register-test 140 30.0 0.21 -test-set-rundir-shortdir 128 98.0 0.77 -test-set-status-state 94 45.0 0.48 -find-and-mark-incomplete 32 0.0 0.00 -state-status-msg 25 4.0 0.16 -delete-tests-in-state 12 4.0 0.33 -get-tests-for-run-mindata 8 0.0 0.00 -get-all-run-ids 5 2.0 0.40 -get-run-info 4 0.0 0.00 -register-run 4 5.0 1.25 -set-tests-state-status 4 15.0 3.75 -get-tests-for-run 4 15.0 3.75 - -# After converting first three functions above to sqlite3:first-result -DB Stats -======== -Cmd Count TotTime Avg -get-count-tests-running-for-run-id 1138 179.0 0.16 -get-count-tests-running-in-jobgroup 987 91.0 0.09 -get-count-tests-running 987 171.0 0.17 -get-prereqs-not-met 987 892.0 0.90 -get-test-info-by-id 672 95.0 0.14 -get-keys 476 0.0 0.00 -get-test-id 355 41.0 0.12 -testmeta-get-record 203 15.0 0.07 -roll-up-pass-fail-counts 159 30.0 0.19 -register-test 140 22.0 0.16 -test-set-rundir-shortdir 128 855.0 6.68 -test-set-status-state 94 20.0 0.21 -find-and-mark-incomplete 36 1.0 0.03 -state-status-msg 24 5.0 0.21 -delete-tests-in-state 12 2.0 0.17 -get-tests-for-run-mindata 9 0.0 0.00 -get-all-run-ids 5 1.0 0.20 -register-run 4 1.0 0.25 -get-tests-for-run 4 11.0 2.75 -get-run-info 4 0.0 0.00 -set-tests-state-status 4 17.0 4.25 - -DB Stats another run, converted one or two non-relevant functions to sqlite3:first-result -======== -Cmd Count TotTime Avg -get-count-tests-running-for-run-id 987 157.0 0.16 -get-count-tests-running-in-jobgroup 836 79.0 0.09 -get-count-tests-running 836 121.0 0.14 -get-prereqs-not-met 836 513.0 0.61 -get-test-info-by-id 673 85.0 0.13 -get-keys 476 0.0 0.00 -get-test-id 356 32.0 0.09 -testmeta-get-record 203 19.0 0.09 -roll-up-pass-fail-counts 159 27.0 0.17 -register-test 140 23.0 0.16 -test-set-rundir-shortdir 128 35.0 0.27 -test-set-status-state 94 20.0 0.21 -find-and-mark-incomplete 40 0.0 0.00 -state-status-msg 25 5.0 0.20 -delete-tests-in-state 12 1.0 0.08 -get-tests-for-run-mindata 10 0.0 0.00 -get-all-run-ids 5 0.0 0.00 -set-tests-state-status 4 15.0 3.75 -register-run 4 2.0 0.50 -get-run-info 4 1.0 0.25 -get-tests-for-run 4 12.0 3.00 - - DELETED tests/supportfiles/ruby/librunscript.rb Index: tests/supportfiles/ruby/librunscript.rb ================================================================== --- tests/supportfiles/ruby/librunscript.rb +++ /dev/null @@ -1,37 +0,0 @@ -# This is the library of stuff for megatest - -def run_and_record(stepname, cmd, checks) - system "megatest -step #{stepname} :state start :status n/a" - system cmd - exitcode=$? - if exitcode==0 - exitcode='pass' - else - exitcode='fail' - end - system "megatest -step #{stepname} :state end :status #{exitcode}" -end - -def record_step(stepname,state,status) - system "megatest -step #{stepname} :state #{state} :status #{status}" -end - -def test_status(state,status) - system "megatest -test-status :state #{state} :status #{status}" -end - - -# WARNING: This example is deprecated. Don't use the -test-status command -# unless you know for sure what you are doing. -def file_size_checker(stepname,filename,minsize,maxsize) - fsize=File.size(filename) - if fsize > maxsize or fsize < minsize - system "megatest -test-status :state COMPLETED :status fail" - else - system "megatest -test-status :state COMPLETED :status pass" - end -end - - -def wait_for_step(testname,stepname) -end DELETED tests/test7.logpro Index: tests/test7.logpro ================================================================== --- tests/test7.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "All tests launched" #/INFO:.*All tests launched/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors DELETED tests/tests.scm Index: tests/tests.scm ================================================================== --- tests/tests.scm +++ /dev/null @@ -1,40 +0,0 @@ -;; Copyright 2006-2012, Matthew Welland. -;; -;; This program is made available under the GNU GPL version 2.0 or -;; greater. See the accompanying file COPYING for details. -;; -;; This program is distributed WITHOUT ANY WARRANTY; without even the -;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -;; PURPOSE. - -;; strftime('%m/%d/%Y %H:%M:%S','now','localtime') - -(require-extension test) -(require-extension regex) -(require-extension srfi-18) -(import srfi-18) -;; (require-extension zmq) -;; (import zmq) - -(define test-work-dir (current-directory)) - -;; read in all the _record files -(let ((files (glob "*_records.scm"))) - (for-each - (lambda (file) - (print "Loading " file) - (load file)) - files)) - -(let* ((unit-test-name (list-ref (argv) 4)) - (fname (conc "../unittests/" unit-test-name ".scm"))) - (if (file-exists? fname) - (load fname) - (print "ERROR: Unit test " unit-test-name " not found in unittests directory"))) - - - (list "abc" "abc/%" "ab%/c%" "~abc/c%" "abc/~c%" "a,b/c,%/d" "%/,%/a" "%/,%/a" "%/,%/a" "%" "%" "%/" "%/" "%abc%") - (list "abc" "abc" "abcd" "abc" "abc" "a" "abc" "def" "ghi" "a" "a" "a" "a" "abc") - (list "" "" "cde" "cde" "cde" "" "" "a" "b" "" "b" "" "b" "abc") - (list #t #t #t #f #f #t #t #t #f #t #t #t #f #t)) - DELETED tests/unit.logpro Index: tests/unit.logpro ================================================================== --- tests/unit.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "At least one PASS" #/\[.{0,4}PASS.{0,4}\]/) - -;; You may need ignores to suppress false error or warning hits from the later expects -;; NOTE: Order is important here! -(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) -(expect:error in "LogFileBody" = 0 "Any error" (list #/error/i #/\[.{0,4}FAIL.{0,4}\]/)) ;; but disallow any other errors DELETED tests/unittests/basicserver.scm Index: tests/unittests/basicserver.scm ================================================================== --- tests/unittests/basicserver.scm +++ /dev/null @@ -1,269 +0,0 @@ -;;====================================================================== -;; S E R V E R -;;====================================================================== - -;; Run like this: -;; -;; ./rununittest.sh server 1;(cd simplerun;megatest -stop-server 0) - -(delete-file* "logs/1.log") -(define run-id 1) - -(test "setup for run" #t (begin (launch:setup-for-run) - (string? (getenv "MT_RUN_AREA_HOME")))) - -;; NON Server tests go here - -(test #f #f (db:dbdat-get-path *db*)) -(test #f #f (db:get-run-name-from-id *db* run-id)) -;; (test #f '("SYSTEM" "RELEASE") (rmt:get-keys)) - -;; (exit) - -;; Server tests go here -(for-each - (lambda (run-id) - (test #f #f (tasks:server-running-or-starting? (db:delay-if-busy (tasks:open-db)) run-id)) - (server:kind-run run-id) - (test "did server start within 20 seconds?" - #t - (let loop ((remtries 20) - (running (tasks:server-running-or-starting? (db:delay-if-busy - (tasks:open-db)) - run-id))) - (if running - (> running 0) - (if (> remtries 0) - (begin - (thread-sleep! 1) - (loop (- remtries 1) - (tasks:server-running-or-starting? (db:delay-if-busy - (tasks:open-db)) - run-id))))))) - - (test "did server become available" #t - (let loop ((remtries 10) - (res (tasks:get-server (db:delay-if-busy (tasks:open-db)) run-id))) - (if res - (vector? res) - (begin - (if (> remtries 0) - (begin - (thread-sleep! 1.1) - (loop (- remtries 1)(tasks:get-server (db:delay-if-busy (tasks:open-db)) run-id))) - res))))) - ) - (list 0 1)) - -(define user (current-user-name)) -(define runname "mytestrun") -(define keys (rmt:get-keys)) -(define runinfo #f) -(define keyvals '(("SYSTEM" "abc")("RELEASE" "def"))) -(define header (list "SYSTEM" "RELEASE" "id" "runname" "state" "status" "owner" "event_time")) - -;; Setup -;; -(test #f #f (not (client:setup run-id))) -(test #f #f (not (hash-table-ref/default *runremote* run-id #f))) - -;; Login -;; -(test #f'(#t "successful login") - (rmt:login-no-auto-client-setup (hash-table-ref/default *runremote* run-id #f) run-id)) -(test #f '(#t "successful login") - (rmt:login run-id)) - -;; Keys -;; -(test #f '("SYSTEM" "RELEASE") (rmt:get-keys)) - -;; No data in db -;; -(test #f '() (rmt:get-all-run-ids)) -(test #f #f (rmt:get-run-name-from-id run-id)) -(test #f - (vector - header - (vector #f #f #f #f)) - (rmt:get-run-info run-id)) - -;; Insert data into db -;; -(test #f 1 (rmt:register-run keyvals runname "new" "n/a" user)) -;; (test #f #f (rmt:get-runs-by-patt keys runname)) -(test #f #t (rmt:general-call 'register-test run-id run-id "test-one" "")) -(define test-one-id #f) -(test #f 30001 (let ((test-id (rmt:get-test-id run-id "test-one" ""))) - (set! test-one-id test-id) - test-id)) -(define test-one-rec #f) -(test #f "test-one" (let ((test-rec (rmt:get-test-info-by-id run-id test-one-id))) - (set! test-one-rec test-rec) - (vector-ref test-rec 2))) - -;; With data in db -;; -(print "Using runame=" runname) -(test #f '(1) (rmt:get-all-run-ids)) -(test #f runname (rmt:get-run-name-from-id run-id)) -(test #f - runname - (let ((run-info (rmt:get-run-info run-id))) - (db:get-value-by-header (db:get-rows run-info) - (db:get-header run-info) - "runname"))) - -(for-each (lambda (run-id) -;; test killing server -;; -(tasks:kill-server-run-id run-id) - -(test #f #f (tasks:server-running-or-starting? (db:delay-if-busy (tasks:open-db)) run-id)) -) -(list 0 1)) - -;; Tests to assess reading/writing while servers are starting/stopping -(define start-time (current-seconds)) -(let loop ((test-state 'start)) - (let* ((server-dats (tasks:get-server-records (db:delay-if-busy (tasks:open-db)) run-id)) - (first-dat (if (not (null? server-dats)) - (car server-dats) - #f))) - (map (lambda (dat) - (apply print (intersperse (vector->list dat) ", "))) - server-dats) - (test #f test-one-rec (rmt:get-test-info-by-id run-id test-one-id)) - (thread-sleep! 1) - (case test-state - ((start) - (print "Trying to start server") - (server:kind-run run-id) - (loop 'server-started)) - ((server-started) - (case (if first-dat (vector-ref first-dat 0) 'blah) - ((running) - (print "Server appears to be running. Now ask it to shutdown") - (rmt:kill-server run-id) - (loop 'server-shutdown)) - ((shutting-down) - (loop test-state)) - (else (print "Don't know what to do if get here")))) - ((server-shutdown) - (loop test-state))))) - -;;====================================================================== -;; END OF TESTS -;;====================================================================== - - -;; (test #f #f (client:setup run-id)) - -;; (set! *transport-type* 'http) -;; -;; (test "setup for run" #t (begin (launch:setup-for-run) -;; (string? (getenv "MT_RUN_AREA_HOME")))) -;; -;; (test "server-register, get-best-server" #t (let ((res #f)) -;; (open-run-close tasks:server-register tasks:open-db 1 "bob" 1234 100 'live 'http) -;; (set! res (open-run-close tasks:get-best-server tasks:open-db)) -;; (number? (vector-ref res 3)))) -;; -;; (test "de-register server" #f (let ((res #f)) -;; (open-run-close tasks:server-deregister tasks:open-db "bob" port: 1234) -;; (vector? (open-run-close tasks:get-best-server tasks:open-db)))) -;; -;; (define server-pid #f) -;; -;; ;; Not sure how the following should work, replacing it with system of megatest -server -;; ;; (test "launch server" #t (let ((pid (process-fork (lambda () -;; ;; ;; (daemon:ize) -;; ;; (server:launch 'http))))) -;; ;; (set! server-pid pid) -;; ;; (number? pid))) -;; (system "../../bin/megatest -server - -debug 22 > server.log 2> server.log &") -;; -;; (let loop ((n 10)) -;; (thread-sleep! 1) ;; need to wait for server to start. -;; (let ((res (open-run-close tasks:get-best-server tasks:open-db))) -;; (print "tasks:get-best-server returned " res) -;; (if (and (not res) -;; (> n 0)) -;; (loop (- n 1))))) -;; -;; (test "get-best-server" #t (begin -;; (client:launch) -;; (let ((dat (open-run-close tasks:get-best-server tasks:open-db))) -;; (vector? dat)))) -;; -;; (define *keys* (keys:config-get-fields *configdat*)) -;; (define *keyvals* (keys:target->keyval *keys* "a/b/c")) -;; -;; (test #f #t (string? (car *runremote*))) -;; (test #f '(#t "successful login") (rmt:login)) ;; *runremote* *toppath* *my-client-signature*))) -;; -;; (test #f #f (rmt:get-test-info-by-id 99)) ;; get non-existant test -;; -;; ;; RUNS -;; (test #f 1 (rmt:register-run *keyvals* "firstrun" "new" "n/a" (current-user-name))) -;; (test "get run info" "firstrun" (let ((rinfo (rmt:get-run-info 1))) -;; (vector-ref (vector-ref rinfo 1) 3))) -;; (test "get runname from id" "firstrun" (rmt:get-run-name-from-id 1)) -;; -;; ;; TESTS -;; (test "get tests (no data)" '() (rmt:get-tests-for-run 1 "%" '() '() #f #f #f #f #f #f)) -;; (test "register test" #t (rmt:general-call 'register-test 1 "test1" "")) -;; (test "get tests (some data)" 1 (length (rmt:get-tests-for-run 1 "%" '() '() #f #f #f #f #f #f))) -;; (test "get test id" 1 (rmt:get-test-id 1 "test1" "")) -;; (test "sync back" #t (> (rmt:sync-inmem->db) 0)) -;; (test "get test id from main" 1 (db:get-test-id *db* 1 "test1" "")) -;; (test "get keys" #t (list? (rmt:get-keys))) -;; (test "set comment" #t (begin (rmt:general-call 'set-test-comment "this is a comment" 1) #t)) -;; (test "get comment" "this is a comment" (let ((trec (rmt:get-test-info-by-id 1))) -;; (db:test-get-comment trec))) -;; -;; ;; MORE RUNS -;; (test "get runs" #t (let* ((runs (rmt:get-runs "%" #f #f '())) -;; (header (vector-ref runs 0)) -;; (data (vector-ref runs 1))) -;; (and (list? header) -;; (list? data) -;; (vector? (car data))))) -;; -;; (test "get local testinfo" "test1" (vector-ref (db:get-testinfo-state-status *db* 1) 2)) -;; (test "get testinfo" "test1" (vector-ref (rmt:get-testinfo-state-status 1) 2)) -;; -;; ;;====================================================================== -;; ;; D B -;; ;;====================================================================== -;; -;; (test "pass fail counts" #t (rmt:general-call 'pass-fail-counts 10 9 1)) -;; (test "get pass fail counts" 19 (let ((dat (rmt:get-test-info-by-id 1))) -;; (+ (db:test-get-pass_count dat) -;; (db:test-get-fail_count dat)))) -;; -;; (define testregistry (make-hash-table)) -;; (for-each -;; (lambda (tname) -;; (for-each -;; (lambda (itempath) -;; (let ((tkey (conc tname "/" itempath)) -;; (rpass (random 10)) -;; (rfail (random 10))) -;; (hash-table-set! testregistry tkey (list tname itempath)) -;; (rmt:general-call 'register-test 1 tname itempath) -;; (let* ((tid (rmt:get-test-id 1 tname itempath)) -;; (tdat (rmt:get-test-info-by-id tid))) -;; (rmt:general-call 'pass-fail-counts rpass rfail (db:test-get-id tdat)) -;; (let* ((resdat (rmt:get-test-info-by-id tid))) -;; (test "set/get pass fail counts" (list rpass rfail) -;; (list (db:test-get-pass_count resdat) -;; (db:test-get-fail_count resdat))))))) -;; (list "" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"))) -;; (list "test1" "test2" "test3" "test4" "test5")) -;; -;; -;; (test #f '(#t "exit process started") (rmt:kill-server)) ;; *toppath* *my-client-signature* #f))) -;; - -(exit) DELETED tests/unittests/configfiles.scm Index: tests/unittests/configfiles.scm ================================================================== --- tests/unittests/configfiles.scm +++ /dev/null @@ -1,52 +0,0 @@ -;;====================================================================== -;; C O N F I G F I L E S -;;====================================================================== - -(define conffile #f) -(test "Read a config" #t (hash-table? (read-config "test.config" #f #f))) -(test "Read a config that doesn't exist" #t (hash-table? (read-config "nada.config" #f #f))) - -(set! conffile (read-config "test.config" #f #f)) -(test "Get available diskspace" #t (number? (get-df "./"))) -(test "Get best dir" #t (let ((bestdir (get-best-disk conffile))) - (or (equal? "./" bestdir) - (equal? "/tmp" bestdir)))) -(test "Multiline variable" 4 (length (string-split (config-lookup conffile "metadata" "description") "\n"))) - -;; db -(define row (vector "a" "b" "c" "blah")) -(define header (list "col1" "col2" "col3" "col4")) -(test "Get row by header" "blah" (db:get-value-by-header row header "col4")) - -;; (define *toppath* "tests") -(define *db* #f) -(test "open-db" #t (begin - (set! *db* (open-db)) - (if *db* #t #f))) - -;; quit wasting time, I'm changing *db* to db -(define db *db*) - -(test "get cpu load" #t (number? (get-cpu-load))) -(test "get uname" #t (string? (get-uname))) - -(test "get validvalues as list" (list "start" "end" "completed") - (string-split (config-lookup *configdat* "validvalues" "state"))) - -(for-each (lambda (item) - (test (conc "get valid items (" item ")") - item (items:check-valid-items "state" item))) - (list "start" "end" "completed")) - -(for-each (lambda (item) - (test (conc "get valid items (" item ")") - item (items:check-valid-items "status" item))) - (list "pass" "fail" "n/a")) - -(test #f #f (items:check-valid-items "state" "blahfool")) - -(test "write env files" "nada.csh" (begin - (save-environment-as-files "nada") - (and (file-exists? "nada.sh") - (file-exists? "nada.csh")))) - DELETED tests/unittests/dbrdbstruct.scm Index: tests/unittests/dbrdbstruct.scm ================================================================== --- tests/unittests/dbrdbstruct.scm +++ /dev/null @@ -1,33 +0,0 @@ -;;====================================================================== -;; S E R V E R -;;====================================================================== - -;; Run like this: -;; -;; (cd ..;make && make install) && ./rununittest.sh server 1;(cd simplerun;megatest -stop-server 0) - -(test #f #t (vector? (make-dbr:dbstruct "/tmp"))) - -(define dbstruct (make-dbr:dbstruct "/tmp")) - -(test #f #t (begin (dbr:dbstruct-set-main! dbstruct "blah") #t)) -(test #f "blah" (dbr:dbstruct-get-main dbstruct)) -(for-each - (lambda (run-id) - (test #f #t (vector? (dbr:dbstruct-get-rundb-rec dbstruct run-id)))) - (list 1 2 3 4 5 6 7 8 9 #f)) - -(test #f 0 (dbr:dbstruct-field-name->num 'rundb)) -(test #f 1 (dbr:dbstruct-field-name->num 'inmem)) -(test #f 2 (dbr:dbstruct-field-name->num 'mtime)) - -(test #f #f (dbr:dbstruct-get-runvec-val dbstruct 1 'rundb)) -(test #f #t (begin (dbr:dbstruct-set-runvec-val! dbstruct 1 'rundb "rundb") #t)) -(test #f "rundb" (dbr:dbstruct-get-runvec-val dbstruct 1 'rundb)) - -(for-each - (lambda (k) - (test #f #t (begin (dbr:dbstruct-set-runvec-val! dbstruct 1 k (conc k)) #t)) - (test #f (conc k) (dbr:dbstruct-get-runvec-val dbstruct 1 k))) - '(rundb inmem mtime rtime stime inuse)) - DELETED tests/unittests/inmemdb.scm Index: tests/unittests/inmemdb.scm ================================================================== --- tests/unittests/inmemdb.scm +++ /dev/null @@ -1,44 +0,0 @@ -;;====================================================================== -;; S E R V E R -;;====================================================================== - -;; Run like this: -;; -;; (cd ..;make && make install) && ./rununittest.sh server 1;(cd simplerun;megatest -stop-server 0) - -(set! *transport-type* 'http) - -(system "cp ../fullrun/megatest.db megatest.db") - -(test "open inmem db" 1 (begin (open-in-mem-db) 1)) - -(test "setup for run" #t (begin (setup-for-run) - (string? (getenv "MT_RUN_AREA_HOME")))) - -(system "megatest -server - -debug 0 &") - -(thread-sleep! 3) ;; need to wait for server to start. Yes, a better way is needed. - -(define *keys* (keys:config-get-fields *configdat*)) -(define *keyvals* (keys:target->keyval *keys* "a/b/c")) - -(test #f #t (string? (car *runremote*))) -(test #f '(#t "successful login") (rmt:login)) ;; *runremote* *toppath* *my-client-signature*))) - -(define inmem (db:open-inmem-db)) - -(define (inmem-test t b) - (test "inmem sync to" t (db:sync-to *db* inmem)) - (test "inmem sync back" b (db:sync-to inmem *db*))) - -(inmem-test 0 0) - -(inmem-test 1 1) - -;;====================================================================== -;; D B -;;====================================================================== - -(test #f '(#t "exit process started") (rmt:kill-server)) ;; *toppath* *my-client-signature* #f))) - - DELETED tests/unittests/misc.scm Index: tests/unittests/misc.scm ================================================================== --- tests/unittests/misc.scm +++ /dev/null @@ -1,48 +0,0 @@ -;;====================================================================== -;; P R O C E S S E S -;;====================================================================== - -(test "cmd-run-with-stderr->list" '("No such file or directory") - (let ((reslst (cmd-run-with-stderr->list "ls" "/tmp/ihadbetternotexist"))) - (string-search (regexp "No such file or directory")(car reslst)))) - -;;====================================================================== -;; T E S T M A T C H I N G -;;====================================================================== - -;; tests:glob-like-match -(test #f '("abc") (tests:glob-like-match "abc" "abc")) -(for-each - (lambda (patt str expected) - (test (conc patt " " str "=>" expected) expected (tests:glob-like-match patt str))) - (list "abc" "~abc" "~abc" "a*c" "a%c") - (list "abc" "abcd" "abc" "ABC" "ABC") - (list '("abc") #t #f #f '("ABC")) - ) - -;; tests:match -(test #f #t (tests:match "abc/def" "abc" "def")) -(for-each - (lambda (patterns testname itempath expected) - (test (conc patterns " " testname "/" itempath "=>" expected) - expected - (tests:match patterns testname itempath))) - (list "abc" "abc/%" "ab%/c%" "~abc/c%" "abc/~c%" "a,b/c,%/d" "%/,%/a" "%/,%/a" "%/,%/a" "%" "%" "%/" "%/") - (list "abc" "abc" "abcd" "abc" "abc" "a" "abc" "def" "ghi" "a" "a" "a" "a") - (list "" "" "cde" "cde" "cde" "" "" "a" "b" "" "b" "" "b") - (list #t #t #t #f #f #t #t #t #f #t #t #t #f)) - -;; db:patt->like -(test #f "testname LIKE 't%'" (db:patt->like "testname" "t%" comparator: " AND ")) -(test #f "testname LIKE 't%' AND testname LIKE '%t'" (db:patt->like "testname" "t%,%t" comparator: " AND ")) -(test #f "item_path GLOB ''" (db:patt->like "item_path" "")) - -;; test:match->sqlqry -(test #f "(testname GLOB 'a' AND item_path GLOB 'b') OR (testname LIKE 'a%' AND item_path LIKE '%') OR (testname GLOB '' AND item_path LIKE 'b%')" - (tests:match->sqlqry "a/b,a%,/b%")) -(test #f "(testname GLOB 'a' AND item_path GLOB 'b') OR (testname LIKE 'a%' AND item_path LIKE '%') OR (testname LIKE '%' AND item_path LIKE 'b%')" - (tests:match->sqlqry "a/b,a%,%/b%")) - - -(exit) - DELETED tests/unittests/runs.scm Index: tests/unittests/runs.scm ================================================================== --- tests/unittests/runs.scm +++ /dev/null @@ -1,330 +0,0 @@ -(define keys (rmt:get-keys)) - -(test "get all legal tests" (list "test1" "test2") (sort (hash-table-keys (tests:get-all)) string<=?)) - -(test "register-run" #t (number? - (rmt:register-run - '(("SYSTEM" "key1")("RELEASE" "key2")) - "myrun" - "new" - "n/a" - "bob"))) - -(test #f #t (rmt:register-test 1 "nada" "")) -(test #f 30001 (rmt:get-test-id 1 "nada" "")) -(test #f "NOT_STARTED" (vector-ref (rmt:get-test-info-by-id 1 30001) 3)) ;; "nada" "") 3)) - -(test #f "FOO LIKE 'abc%def'" (db:patt->like "FOO" "abc%def")) -(test #f "key2" (vector-ref (car (vector-ref (mt:get-runs-by-patt '("SYSTEM" "RELEASE") "%" "key1/key2") 1)) 1)) - -(test #f "SYSTEM,RELEASE,id,runname,state,status,owner,event_time" (car (runs:get-std-run-fields keys '("id" "runname" "state" "status" "owner" "event_time")))) -(test #f #t (runs:operate-on 'print "%" "%" "%")) - -;;(test "update-test-info" #t (test-update-meta-info *db* 1 "nada" -(setenv "BLAHFOO" "1234") -(unsetenv "NADAFOO") -(test "env temp overrides" "xyz" (let ((prevvals (alist->env-vars '(("BLAHFOO" 4321)("NADAFOO" xyz)))) - (result (get-environment-variable "NADAFOO"))) - (alist->env-vars prevvals) - result)) - -(test "env restored" "1234" (get-environment-variable "BLAHFOO")) - - -(test "Items assoc" "Elephant" (cadar (cadr (item-assoc->item-list '(("ANIMAL" "Elephant Lion")("SEASON" "Spring Fall")))))) -(set! *verbosity* 6) -(test "Items assoc" '()(item-assoc->item-list '(("a" "a b c d")("b" "c d e")("c" "")("d")))) -(set! *verbosity* -1) -(test "Items assoc empty items" '() (item-assoc->item-list '(("A")))) -(set! *verbosity* 1) -(test "Items table" "SEASON" (caadar (item-table->item-list '(("ANIMAL" "Elephant Lion")("SEASON" "Spring Winter"))))) -(test "Items table empty items I" '() (item-table->item-list '(("A")))) -(test "Items table empty items II" '() (item-table->item-list '(("A" "")))) - -;; Test out the steps code - -(define test-id #f) - -;; force keepgoing -; (hash-table-set! args:arg-hash "-keepgoing" #t) -(hash-table-set! args:arg-hash "-itempatt" "%") -(hash-table-set! args:arg-hash "-testpatt" "%") -(hash-table-set! args:arg-hash "-target" "ubuntu/r1.2") ;; SYSTEM/RELEASE -(hash-table-set! args:arg-hash "-runname" "testrun") -(test "Setup for a run" #t (begin (launch:setup-for-run) #t)) - -(define *tdb* #f) -(define keyvals #f) -(test "target->keyval" #t (let ((kv (keys:target->keyval keys (args:get-arg "-target")))) - (print "keyvals=" kv ", keys=" keys) - (set! keyvals kv)(list? keyvals))) - -(define testdbpath (conc "/tmp/" (getenv "USER") "/megatest_testing")) -(system (conc "rm -f " testdbpath "/testdat.db;mkdir -p " testdbpath)) - -(print "Using " testdbpath " for test db") -(test #f #t (let ((db (open-test-db testdbpath))) - (set! *tdb* db) - (sqlite3#database? db))) -(sqlite3#finalize! *tdb*) - -;; (test "Remove the rollup run" #t (begin (remove-runs) #t)) -(define tconfig #f) -(test "get a testconfig" #t (let ((tconf (tests:get-testconfig "test1" (tests:get-all) 'return-procs ))) - (set! tconfig tconf) - (hash-table? tconf))) - -(test "set-megatest-env-vars" - "ubuntu" - (begin - (runs:set-megatest-env-vars 1 inkeys: keys) - (get-environment-variable "SYSTEM"))) -(test "setup-env-defaults" - "see this variable" - (begin - (setup-env-defaults "runconfigs.config" 1 *already-seen-runconfig-info* keyvals environ-patt: "pre-launch-env-vars") - (get-environment-variable "ALLTESTS"))) - -(test #f "ubuntu" (car (keys:target-set-args keys (args:get-arg "-target") args:arg-hash))) - -(define rinfo #f) -(test "get-run-info" #f (vector? (vector-ref (let ((rinf (rmt:get-run-info 1))) - (set! rinfo rinf) - rinf) 0))) -;; (test "get-key-vals" "key1" (car (db:get-key-vals *dbstruct* 1))) -(test "tests:sort-by" '() (tests:sort-by-priority-and-waiton (make-hash-table))) - -(test "update-test_meta" "test1" (begin - (runs:update-test_meta "test1" tconfig) - (let ((dat (rmt:testmeta-get-record "test1"))) - (vector-ref dat 1)))) - -(define test-path "tests/test1") -(define disk-path #f) -(test "get-best-disk" #t (string? (file-exists? (let ((d (get-best-disk *configdat*))) - (set! disk-path d) - d)))) -(test "create-work-area" #t (symbolic-link? (car (create-work-area 1 rinfo keyvals 1 test-path disk-path "test1" '())))) -(test #f "" (item-list->path '())) - -;;====================================================================== -;; Create a test with multiple items and verify that rollup logic works -;;====================================================================== - -(rmt:register-test 1 "rollup" "") ;; toplevel test -(for-each - (lambda (itempath) - (rmt:register-test 1 "rollup" itempath) - (let ((test-id (rmt:get-test-id 1 "rollup" itempath)) - (comment (conc "This is a comment for itempath " itempath))) - ;; (rmt:test-set-state-status-by-id run-id test-id "COMPLETED" "PASS" comment) - (tests:test-set-status! 1 test-id "COMPLETED" "PASS" comment #f))) ;; #!key (work-area #f)) - '("item/1" "item/2" "item/3" "item/4" "item/5")) - -(test #f #t (number? (rmt:get-test-id 1 "rollup" "item/4"))) - -(define (get-state-status run-id testname itempath) - (let ((tdat (rmt:get-test-info-by-id 1 (rmt:get-test-id run-id testname itempath)))) - (list (db:test-get-state tdat) - (db:test-get-status tdat)))) - -(test "Rollup PASS" '("COMPLETED" "PASS") (get-state-status 1 "rollup" "")) -(let ((test-id (rmt:get-test-id 1 "rollup" "item/4")) - (top-id (rmt:get-test-id 1 "rollup" ""))) - (for-each - (lambda (state status rup-state rup-status) - ;; reset to COMPLETED/PASS - (tests:test-set-status! 1 test-id "COMPLETED" "PASS" #f #f) - (test "Top reset to COMPLETED/PASS" '("COMPLETED" "PASS")(get-state-status 1 "rollup" "")) - (tests:test-set-status! 1 test-id state status #f #f) - (test (conc "Item set to " state "/" status) - (list state status) - (get-state-status 1 "rollup" "item/4")) - (test (conc "Rollup of " state "/" status) - (list rup-state rup-status) - (get-state-status 1 "rollup" ""))) - '("COMPLETED" "COMPLETED" "INCOMPLETE" "INCOMPLETE" "RUNNING" "RUNNING" "COMPLETED" "COMPLETED") - '("ABORT" "FAIL" "PASS" "FAIL" "PASS" "FAIL" "BLAH" "AUTO") - '("COMPLETED" "COMPLETED" "COMPLETED" "COMPLETED" "RUNNING" "RUNNING" "COMPLETED" "COMPLETED") - '("ABORT" "FAIL" "FAIL" "FAIL" "PASS" "FAIL" "ABORT" "AUTO"))) - - -(test "launch-test" #t - (string? - (file-exists? - ;; (launch-test test-id run-id run-info keyvals runname test-conf test-name test-path itemdat params) - (launch-test 30001 1 rinfo keyvals "run1" tconfig "test1" test-path '() (make-hash-table))))) - - - - -(exit 1) - - - - -;; (test "Run a test" #t (general-run-call -;; "-runtests" -;; "run a test" -;; (lambda (target runname keys keyvallst) -;; (let ((test-patts "test%")) -;; ;; (runs:run-tests target runname test-patts user (make-hash-table)) -;; ;; (run:test run-id run-info key-vals runname test-record flags parent-test) -;; ;; (set! *verbosity* 22) ;; (list 0 1 2)) -;; (run:test 1 ;; run-id -;; #f ;; run-info is yet only a dream -;; keyvallst ;; (keys:target->keyval keys target) -;; "run1" ;; runname -;; (vector ;; test_records.scm tests:testqueue -;; "test1" ;; testname -;; tconfig ;; testconfig -;; (make-hash-table) ;; flags -;; #f ;; parent test -;; (tests:get-all) ;; test registry -;; 0 ;; priority -;; #f ;; items -;; #f ;; itemsdat -;; "" ;; itempath -;; ) -;; args:arg-hash ;; flags (e.g. -itemspatt) -;; #f) -;; ;; (set! *verbosity* 0) -;; )))) -;; -;; -;; -;; -;; -;; (test "server stop" #f (let ((hostname (car *runremote*)) -;; (port (cadr *runremote*))) -;; (tasks:kill-server #t hostname port server-pid 'http) -;; (open-run-close tasks:get-best-server tasks:open-db))) - -;; (test "cache is coherent" #t (let ((cached-info (db:get-test-info-cached-by-id db 2)) -;; (non-cached (db:get-test-info-not-cached-by-id db 2))) -;; (print "\nCached: " cached-info) -;; (print "Noncached: " non-cached) -;; (equal? cached-info non-cached))) - -(change-directory test-work-dir) -(test #f #t (> (length (mt:get-tests-for-run 1 "test1" '() '())) 0)) -(test "Add a step" #t - (begin - (rmt:teststep-set-status! 1 30002 "step1" "start" 0 "This is a comment" "mylogfile.html") - (sleep 2) - (rmt:teststep-set-status! 1 30002 "step1" "end" "pass" "This is a different comment" "finallogfile.html") - (set! test-id (db:test-get-id (car (mt:get-tests-for-run 1 "test1" '() '())))) - (number? test-id))) - -(test "Get rundir" #t (let ((rundir (cdb:remote-run db:test-get-rundir-from-test-id #f test-id))) - (print "Rundir " rundir) - (system (conc "mkdir -p " rundir)) - (string? rundir))) -(test #f #t (sqlite3#database? (open-test-db "./"))) -(test "Create a test db" "../simpleruns/key1/key2/myrun/test1/testdat.db" - (let ((tdb (open-run-close db:open-test-db-by-test-id db test-id))) - (if tdb (sqlite3#finalize! tdb)) - (file-exists? "../simpleruns/key1/key2/myrun/test1/testdat.db"))) - -(test "Get steps for test" #t (let ((steps (cdb:remote-run db:get-steps-for-test #f test-id))) - (print steps) - (> (length steps) 0))) -(test "Get nice table for steps" "2.0s" - (begin - (vector-ref (hash-table-ref (open-run-close db:get-steps-table #f test-id) "step1") 4))) - -;; (exit) - -(test #f "myrun" (cdb:remote-run db:get-run-name-from-id #f 1)) - -(test #f #f (cdb:remote-run db:roll-up-pass-fail-counts #f 1 "nada" "" "PASS")) - -;;====================================================================== -;; R E M O T E C A L L S -;;====================================================================== - -(define start-wait (current-seconds)) -(print "Starting intensive cache and rpc test") -(for-each (lambda (params) - (print "Intensive: params=" params) - (cdb:tests-register-test *runremote* 1 (conc "test" (random 20)) "") - (apply cdb:test-set-status-state *runremote* test-id params) - (cdb:pass-fail-counts *runremote* test-id (random 100) (random 100)) - (cdb:test-rollup-test_data-pass-fail *runremote* test-id) - (cdb:roll-up-pass-fail-counts *runremote* 1 "test1" "" (cadr params)) - (thread-sleep! 0.01)) ;; cache ordering granularity is at the second level. Should really be at the ms level - '(("COMPLETED" "PASS" #f) - ("NOT_STARTED" "FAIL" "Just testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("COMPLETED" "PASS" #f) - ("NOT_STARTED" "FAIL" "Just testing") - ("KILLED" "UNKNOWN" "More testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("COMPLETED" "PASS" #f) - ("NOT_STARTED" "FAIL" "Just testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("KILLED" "UNKNOWN" "More testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("COMPLETED" "PASS" #f) - ("NOT_STARTED" "FAIL" "Just testing") - ("KILLED" "UNKNOWN" "More testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("COMPLETED" "PASS" #f) - ("NOT_STARTED" "FAIL" "Just testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("KILLED" "UNKNOWN" "More testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("COMPLETED" "PASS" #f) - ("NOT_STARTED" "FAIL" "Just testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("KILLED" "UNKNOWN" "More testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("COMPLETED" "PASS" #f) - ("NOT_STARTED" "FAIL" "Just testing") - ("KILLED" "UNKNOWN" "More testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("NOT_STARTED" "FAIL" "Just testing") - ("COMPLETED" "PASS" #f) - ("NOT_STARTED" "FAIL" "Just testing") - ("KILLED" "UNKNOWN" "More testing") - ("KILLED" "UNKNOWN" "More testing") - )) - -;; now set all tests to completed -(cdb:flush-queue *runremote*) -(let ((tests (cdb:remote-run db:get-tests-for-run #f 1 "%" '() '()))) - (print "Setting " (length tests) " to COMPLETED/PASS") - (for-each - (lambda (test) - (cdb:test-set-status-state *runremote* (db:test-get-id test) "COMPLETED" "PASS" "Forced pass")) - tests)) - -;; (process-wait server-pid) -;; (test "Server wait time" #t (let ((run-delta (- (current-seconds) start-wait))) -;; (print "Server ran for " run-delta " seconds") -;; (> run-delta 20))) - -(test "Rollup the run(s)" #t (begin - (runs:rollup-run keys (keys->alist keys "na") "rollup" "matt") - #t)) - -(hash-table-set! args:arg-hash ":runname" "%") - -(test "Remove the rollup run" #t (begin (operate-on 'remove-runs))) - -(print "Waiting for server to be done, should be about 20 seconds") -(test "server stop" #f (let ((hostname (car *runremote*)) - (port (cadr *runremote*))) - (tasks:kill-server #t hostname port server-pid 'http) - (open-run-close tasks:get-best-server tasks:open-db))) - -;; (cdb:kill-server *runremote*) - -;; (thread-join! th1 th2 th3) - -;; ADD ME!!!! (db:get-prereqs-not-met *db* 1 '("runfirst") "" mode: 'normal) -;; ADD ME!!!! (rdb:get-tests-for-run *db* 1 "runfirst" #f '() '()) DELETED tests/unittests/server.scm Index: tests/unittests/server.scm ================================================================== --- tests/unittests/server.scm +++ /dev/null @@ -1,193 +0,0 @@ -;;====================================================================== -;; S E R V E R -;;====================================================================== - -;; Run like this: -;; -;; (cd ..;make && make install) && ./rununittest.sh server 1;(cd simplerun;megatest -stop-server 0) - -(delete-file* "logs/1.log") -(define run-id 1) - -(test "setup for run" #t (begin (launch:setup-for-run) - (string? (getenv "MT_RUN_AREA_HOME")))) - -;; Insert data into db -;; -(define user (current-user-name)) -(define runname "mytestrun") -(define keys (rmt:get-keys)) -(define runinfo #f) -(define keyvals '(("SYSTEM" "abc")("RELEASE" "def"))) -(define header (list "SYSTEM" "RELEASE" "id" "runname" "state" "status" "owner" "event_time")) - -(test #f 1 (rmt:register-run keyvals runname "new" "n/a" user)) -;; (test #f #f (rmt:get-runs-by-patt keys runname)) -(test #f #t (rmt:general-call 'register-test run-id run-id "test-one" "")) -(define test-one-id #f) -(test #f 30001 (let ((test-id (rmt:get-test-id run-id "test-one" ""))) - (set! test-one-id test-id) - test-id)) -(define test-one-rec #f) -(test #f "test-one" (let ((test-rec (rmt:get-test-info-by-id run-id test-one-id))) - (set! test-one-rec test-rec) - (vector-ref test-rec 2))) - -(use trace) -(import trace) -;; (trace -;; rmt:send-receive -;; rmt:open-qry-close-locally -;; ) - -;; Tests to assess reading/writing while servers are starting/stopping -(define start-time (current-seconds)) -(let loop ((test-state 'start)) - (let* ((server-dats (tasks:get-server-records (db:delay-if-busy (tasks:open-db)) run-id)) - (first-dat (if (not (null? server-dats)) - (car server-dats) - #f)) - (server-state (or (and first-dat (string->symbol (vector-ref first-dat 8))) 'no-dat))) - (if first-dat - (map (lambda (dat) - (apply print (intersperse (vector->list dat) ", "))) - server-dats) - (print "No server")) - (test #f test-one-rec (rmt:get-test-info-by-id run-id test-one-id)) - (thread-sleep! 1) - (case test-state - ((start) - (print "Trying to start server") - (server:kind-run run-id) - (loop 'server-started)) - ((server-started) - (case server-state - ((running) - (print "Server appears to be running. Now ask it to shutdown") - (rmt:kill-server run-id) - ;; (trace rmt:open-qry-close-locally rmt:send-receive) - (loop 'shutdown-started)) - ((available) - (loop test-state)) - ((shutting-down) - (loop test-state)) - ((no-dat) - (loop test-state)) - (else (print "Don't know what to do if get here")))) - ((shutdown-started) - (case server-state - ((no-dat) - (print "Server appears to have shutdown, ending this test")) - (else - (loop test-state))))))) - -(exit) - -;; (set! *transport-type* 'http) -;; -;; (test "setup for run" #t (begin (setup-for-run) -;; (string? (getenv "MT_RUN_AREA_HOME")))) -;; -;; (test "server-register, get-best-server" #t (let ((res #f)) -;; (open-run-close tasks:server-register tasks:open-db 1 "bob" 1234 100 'live 'http) -;; (set! res (open-run-close tasks:get-best-server tasks:open-db)) -;; (number? (vector-ref res 3)))) -;; -;; (test "de-register server" #f (let ((res #f)) -;; (open-run-close tasks:server-deregister tasks:open-db "bob" port: 1234) -;; (vector? (open-run-close tasks:get-best-server tasks:open-db)))) -;; -;; (define server-pid #f) -;; -;; ;; Not sure how the following should work, replacing it with system of megatest -server -;; ;; (test "launch server" #t (let ((pid (process-fork (lambda () -;; ;; ;; (daemon:ize) -;; ;; (server:launch 'http))))) -;; ;; (set! server-pid pid) -;; ;; (number? pid))) -;; (system "../../bin/megatest -server - -debug 22 > server.log 2> server.log &") -;; -;; (let loop ((n 10)) -;; (thread-sleep! 1) ;; need to wait for server to start. -;; (let ((res (open-run-close tasks:get-best-server tasks:open-db))) -;; (print "tasks:get-best-server returned " res) -;; (if (and (not res) -;; (> n 0)) -;; (loop (- n 1))))) -;; -;; (test "get-best-server" #t (begin -;; (client:launch) -;; (let ((dat (open-run-close tasks:get-best-server tasks:open-db))) -;; (vector? dat)))) -;; -;; (define *keys* (keys:config-get-fields *configdat*)) -;; (define *keyvals* (keys:target->keyval *keys* "a/b/c")) -;; -;; (test #f #t (string? (car *runremote*))) -;; (test #f '(#t "successful login") (rmt:login)) ;; *runremote* *toppath* *my-client-signature*))) -;; -;; (test #f #f (rmt:get-test-info-by-id 1 99)) ;; get non-existant test -;; -;; ;; RUNS -;; (test #f 1 (rmt:register-run *keyvals* "firstrun" "new" "n/a" (current-user-name))) -;; (test "get run info" "firstrun" (let ((rinfo (rmt:get-run-info 1))) -;; (vector-ref (vector-ref rinfo 1) 3))) -;; (test "get runname from id" "firstrun" (rmt:get-run-name-from-id 1)) -;; -;; ;; TESTS -;; (test "get tests (no data)" '() (rmt:get-tests-for-run 1 "%" '() '() #f #f #f #f #f #f)) -;; (test "register test" #t (rmt:general-call 'register-test 1 1 "test1" "")) -;; (test "get tests (some data)" 1 (length (rmt:get-tests-for-run 1 "%" '() '() #f #f #f #f #f #f))) -;; (test "get test id" 1 (rmt:get-test-id 1 "test1" "")) -;; -;; (test "sync back" #t (> (rmt:sync-inmem->db) 0)) -;; (test "get test id from main" 1 (db:get-test-id *db* 1 "test1" "")) -;; -;; (test "get keys" #t (list? (rmt:get-keys))) -;; (test "set comment" #t (begin (rmt:general-call 'set-test-comment 1 "this is a comment" 1) #t)) -;; (test "get comment" "this is a comment" (let ((trec (rmt:get-test-info-by-id 1 1))) -;; (db:test-get-comment trec))) -;; -;; ;; MORE RUNS -;; (test "get runs" #t (let* ((runs (rmt:get-runs "%" #f #f '())) -;; (header (vector-ref runs 0)) -;; (data (vector-ref runs 1))) -;; (and (list? header) -;; (list? data) -;; (vector? (car data))))) -;; -;; (test "get local testinfo" "test1" (vector-ref (db:get-testinfo-state-status *db* 1 1) 2)) -;; (test "get testinfo" "test1" (vector-ref (rmt:get-testinfo-state-status 1 1) 2)) -;; -;; ;;====================================================================== -;; ;; D B -;; ;;====================================================================== -;; -;; (test "pass fail counts" #t (rmt:general-call 'pass-fail-counts 10 9 1)) -;; (test "get pass fail counts" 19 (let ((dat (rmt:get-test-info-by-id 1))) -;; (+ (db:test-get-pass_count dat) -;; (db:test-get-fail_count dat)))) -;; -;; (define testregistry (make-hash-table)) -;; (for-each -;; (lambda (tname) -;; (for-each -;; (lambda (itempath) -;; (let ((tkey (conc tname "/" itempath)) -;; (rpass (random 10)) -;; (rfail (random 10))) -;; (hash-table-set! testregistry tkey (list tname itempath)) -;; (rmt:general-call 'register-test 1 tname itempath) -;; (let* ((tid (rmt:get-test-id 1 tname itempath)) -;; (tdat (rmt:get-test-info-by-id tid))) -;; (rmt:general-call 'pass-fail-counts rpass rfail (db:test-get-id tdat)) -;; (let* ((resdat (rmt:get-test-info-by-id tid))) -;; (test "set/get pass fail counts" (list rpass rfail) -;; (list (db:test-get-pass_count resdat) -;; (db:test-get-fail_count resdat))))))) -;; (list "" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"))) -;; (list "test1" "test2" "test3" "test4" "test5")) -;; -;; -;; (test #f '(#t "exit process started") (rmt:kill-server)) ;; *toppath* *my-client-signature* #f))) -;; DELETED tests/unittests/tests.scm Index: tests/unittests/tests.scm ================================================================== --- tests/unittests/tests.scm +++ /dev/null @@ -1,13 +0,0 @@ -;;====================================================================== -;; itemwait, itemmatch - -(db:compare-itempaths ref-item-path item-path itemmap) - -;; prereqs-not-met - -(rmt:get-prereqs-not-met run-id waitons item-path mode: testmode itemmap: itemmap)) - - (fails (runs:calc-fails prereqs-not-met)) - (prereq-fails (runs:calc-prereq-fail prereqs-not-met)) - (non-completed (runs:calc-not-completed prereqs-not-met)) - (runnables (runs:calc-runnable prereqs-not-met))) DELETED tests/vectors-vs-records.scm Index: tests/vectors-vs-records.scm ================================================================== --- tests/vectors-vs-records.scm +++ /dev/null @@ -1,37 +0,0 @@ -(use srfi-9) - -(define numtodo (string->number (caddr (argv)))) - -;; using vectors -(define testvalvec (vector 0 1 2 3 4 5)) -(define-inline (testing:get-first vec )(vector-ref vec 0)) -(define-inline (testing:get-count vec )(vector-ref vec 5)) -(define-inline (testing:set-first! vec val)(vector-set! vec 0 val)) -(define-inline (testing:set-count! vec val)(vector-set! vec 5 val)) - -(if (equal? (cadr (argv)) "vectors") - (begin - (print "Testing " numtodo " vectors") - (let loop ((i 0)) - (testing:set-count! testvalvec i) - (testing:set-first! testvalvec (testing:get-count testvalvec)) - (if (< i numtodo) - (loop (+ i 1)))))) - -;; using records -(define-record-type testing - (make-testing zeroeth first second third fourth count) - testing? - (count get:count set:count) - (first get:first set:first)) - -(define testvalrec (make-testing 0 1 2 3 4 5)) - -(if (equal? (cadr (argv)) "records") - (begin - (print "Testing " numtodo " records") - (let loop ((i 0)) - (set:count testvalrec i) - (set:first testvalrec (get:count testvalrec)) - (if (< i numtodo) - (loop (+ i 1)))))) DELETED tests/watch-monitor.sh Index: tests/watch-monitor.sh ================================================================== --- tests/watch-monitor.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -if [ -e fullrun/db/monitor.db ];then -sqlite3 fullrun/db/monitor.db << EOF -.header on -.mode column -select * from servers order by start_time desc; -.q -EOF -fi