Check-in [a50e564c64]
Not logged in
Overview
SHA1 Hash:a50e564c642bfad4286c8d11c0386705f012e7d2
Date: 2011-11-07 11:10:57
User: mrwellan
Comment:Bunchofixes for ezsteps
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified launch.scm from [73ecaef219a2c3bc] to [914302d488ef94f0].

57 (itemdat (assoc/default 'itemdat cmdinfo)) 57 (itemdat (assoc/default 'itemdat cmdinfo)) 58 (env-ovrd (assoc/default 'env-ovrd cmdinfo)) 58 (env-ovrd (assoc/default 'env-ovrd cmdinfo)) 59 (set-vars (assoc/default 'set-vars cmdinfo)) ;; pre-overrides f 59 (set-vars (assoc/default 'set-vars cmdinfo)) ;; pre-overrides f 60 (runname (assoc/default 'runname cmdinfo)) 60 (runname (assoc/default 'runname cmdinfo)) 61 (megatest (assoc/default 'megatest cmdinfo)) 61 (megatest (assoc/default 'megatest cmdinfo)) 62 (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo)) 62 (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo)) 63 (fullrunscript (if runscript (conc testpath "/" runscript) #f)) 63 (fullrunscript (if runscript (conc testpath "/" runscript) #f)) 64 (db #f)) | 64 (db #f) > 65 (rollup-status 0)) 65 66 66 (debug:print 2 "Exectuing " test-name " on " (get-host-name)) 67 (debug:print 2 "Exectuing " test-name " on " (get-host-name)) 67 (change-directory testpath) 68 (change-directory testpath) 68 ;; apply pre-overrides before other variables. The pre-override vars m 69 ;; apply pre-overrides before other variables. The pre-override vars m 69 ;; clobbers things from the official sources such as megatest.config a 70 ;; clobbers things from the official sources such as megatest.config a 70 (if (string? set-vars) 71 (if (string? set-vars) 71 (let ((varpairs (string-split set-vars ","))) 72 (let ((varpairs (string-split set-vars ","))) ................................................................................................................................................................................ 130 (let loop ((i 0)) 131 (let loop ((i 0)) 131 (let-values 132 (let-values 132 (((pid-val exit-status exit-code) (pro 133 (((pid-val exit-status exit-code) (pro 133 (mutex-lock! m) 134 (mutex-lock! m) 134 (vector-set! exit-info 0 pid) 135 (vector-set! exit-info 0 pid) 135 (vector-set! exit-info 1 exit-status) 136 (vector-set! exit-info 1 exit-status) 136 (vector-set! exit-info 2 exit-code) 137 (vector-set! exit-info 2 exit-code) > 138 (set! rollup-status exit-code) 137 (mutex-unlock! m) 139 (mutex-unlock! m) 138 (if (eq? pid-val 0) 140 (if (eq? pid-val 0) 139 (begin 141 (begin 140 (thread-sleep! 2) 142 (thread-sleep! 2) 141 (loop (+ i 1))) 143 (loop (+ i 1))) 142 ))))) 144 ))))) 143 ;; then, if runscript ran ok (or did not get ca 145 ;; then, if runscript ran ok (or did not get ca ................................................................................................................................................................................ 156 ;; check exit-info (vector-ref exit 158 ;; check exit-info (vector-ref exit 157 (if (vector-ref exit-info 1) 159 (if (vector-ref exit-info 1) 158 (let* ((stepname (car ezstep)) 160 (let* ((stepname (car ezstep)) 159 (stepinfo (cadr ezstep) 161 (stepinfo (cadr ezstep) 160 (stepparts (string-match 162 (stepparts (string-match 161 (stepparms (list-ref ste 163 (stepparms (list-ref ste 162 (stepcmd (list-ref ste 164 (stepcmd (list-ref ste 163 (script "#!/bin/bash\n | 165 (script "") ; "#!/bin 164 (logpro-used #f)) 166 (logpro-used #f)) 165 ;; NB// can safely assume we 167 ;; NB// can safely assume we 166 (debug:print 4 "ezsteps:\n st 168 (debug:print 4 "ezsteps:\n st 167 " stepparms: " s 169 " stepparms: " s 168 170 169 (if (file-exists? (conc stepn 171 (if (file-exists? (conc stepn 170 172 171 ;; first source the previous 173 ;; first source the previous > 174 (let ((prev-env (conc ".ezste 172 (if (and prevstep (file-exist | 175 (if (and prevstep (file-exi 173 (set! script (conc script | 176 (set! script (conc scri 174 177 175 ;; call the command using mt_ 178 ;; call the command using mt_ 176 (set! script (conc script "mt | 179 (set! script (conc script ";m 177 180 178 (debug:print 4 "script: " scr 181 (debug:print 4 "script: " scr 179 182 180 (teststep-set-status! db run- 183 (teststep-set-status! db run- 181 ;; now launch 184 ;; now launch 182 (let ((pid (process-run scrip 185 (let ((pid (process-run scrip 183 (let processloop ((i 0)) 186 (let processloop ((i 0)) ................................................................................................................................................................................ 191 (begin 194 (begin 192 (thread 195 (thread 193 (proces 196 (proces 194 )) 197 )) 195 (teststep-set-status! db ru 198 (teststep-set-status! db ru 196 (if logpro-used 199 (if logpro-used 197 (test-set-log! db run-i 200 (test-set-log! db run-i 198 (debug:print 4 "Exit value | 201 ;; set the test final statu 199 (cond | 202 (let* ((this-step-status (c 200 ;; WARN from logpro < 201 ((and (eq? (vector-ref exi | 203 ( 202 (test-set-status! db run- < 203 ((eq? (vector-ref exit-inf | 204 ( > 205 ( > 206 (overall-status (c > 207 ( > 208 ( > 209 ( > 210 (next-status (c > 211 ( > 212 ( > 213 > 214 ( > 215 (debug:print 4 "Exit valu > 216 " this-step- > 217 " next-statu > 218 (case next-status > 219 ((warn) > 220 (set! rollup-status 2) 204 (test-set-status! db run- | 221 (test-set-status! db r > 222 (if > 223 #f)) > 224 ((pass) > 225 (test-set-status! db r 205 (else | 226 (else ;; 'fail > 227 (set! rollup-status 1) 206 (test-set-status! db run- | 228 (test-set-status! db r 207 ) < 208 (if (and (steprun-good? logpr 229 (if (and (steprun-good? logpr 209 (not (null? tal))) 230 (not (null? tal))) 210 (loop (car tal) (cdr tal) 231 (loop (car tal) (cdr tal) 211 (debug:print 4 "WARNING: a prior st 232 (debug:print 4 "WARNING: a prior st 212 (monitorjob (lambda () 233 (monitorjob (lambda () 213 (let* ((start-seconds (current-seconds)) 234 (let* ((start-seconds (current-seconds)) 214 (calc-minutes (lambda () 235 (calc-minutes (lambda () ................................................................................................................................................................................ 266 (thread-join! th2) 287 (thread-join! th2) 267 (mutex-lock! m) 288 (mutex-lock! m) 268 (set! db (open-db)) 289 (set! db (open-db)) 269 (let* ((item-path (item-list->path itemdat)) 290 (let* ((item-path (item-list->path itemdat)) 270 (testinfo (db:get-test-info db run-id test-name item-path))) 291 (testinfo (db:get-test-info db run-id test-name item-path))) 271 (if (not (equal? (db:test-get-state testinfo) "COMPLETED")) 292 (if (not (equal? (db:test-get-state testinfo) "COMPLETED")) 272 (begin 293 (begin 273 (debug:print 2 "Test NOT logged as COMPLETED, (state=" (db:t | 294 (debug:print 2 "Test NOT logged as COMPLETED, (state=" (db:t 274 (test-set-status! db run-id test-name 295 (test-set-status! db run-id test-name 275 (if kill-job? "KILLED" "COMPLETED") 296 (if kill-job? "KILLED" "COMPLETED") > 297 ;; Old logic: 276 (if (vector-ref exit-info 1) ;; look at th | 298 ;; (if (vector-ref exit-info 1) ;; look at 277 (if (and (not kill-job?) | 299 ;; (if (and (not kill-job?) 278 (eq? (vector-ref exit-info 2) | 300 ;; (eq? (vector-ref exit-info 2) 0 279 "PASS" | 301 ;; "PASS" > 302 ;; "FAIL") 280 "FAIL") | 303 ;; "FAIL") > 304 ;; New logic based on rollup-status > 305 (cond > 306 ((not (vector-ref exit-info 1)) "FAIL") ; > 307 ((eq? rollup-status 0) "PASS") > 308 ((eq? rollup-status 1) "FAIL") > 309 ((eq? rollup-status 2) "WARN") > 310 (else "FAIL")) 281 "FAIL") itemdat (args:get-arg "-m") #f | 311 itemdat (args:get-arg "-m") #f))) 282 ;; for automated creation of the rollup html file this is a good p 312 ;; for automated creation of the rollup html file this is a good p 283 (if (not (equal? item-path "")) 313 (if (not (equal? item-path "")) 284 (tests:summarize-items db run-id test-name #f)) ;; don't force 314 (tests:summarize-items db run-id test-name #f)) ;; don't force 285 ) 315 ) 286 (mutex-unlock! m) 316 (mutex-unlock! m) 287 ;; (exec-results (cmd-run->list fullrunscript)) ;; (list ">" (conc 317 ;; (exec-results (cmd-run->list fullrunscript)) ;; (list ">" (conc 288 ;; (success exec-results)) ;; (eq? (cadr exec-results) 0))) 318 ;; (success exec-results)) ;; (eq? (cadr exec-results) 0)))

Modified tests/Makefile from [0ebf03c262dc08ab] to [8ae583dc762ed737].

2 2 3 BINPATH=$(shell realpath ../bin) 3 BINPATH=$(shell realpath ../bin) 4 MEGATEST=$(BINPATH)/megatest 4 MEGATEST=$(BINPATH)/megatest 5 PATH := $(BINPATH):$(PATH) 5 PATH := $(BINPATH):$(PATH) 6 6 7 runall : 7 runall : 8 cd ../;make install 8 cd ../;make install > 9 $(BINPATH)/dboard & 9 $(MEGATEST) -keepgoing -runall :sysname ubuntu :fsname nfs :datapath non 10 $(MEGATEST) -keepgoing -runall :sysname ubuntu :fsname nfs :datapath non 10 11 11 test : 12 test : 12 csi -b -I .. ../megatest.scm -- -runall :sysname ubuntu :fsname afs :dat 13 csi -b -I .. ../megatest.scm -- -runall :sysname ubuntu :fsname afs :dat 13 cd ../;make test 14 cd ../;make test 14 make runall 15 make runall 15 16

Modified tests/tests/ez_warn/testconfig from [55e83172e9b4587f] to [fc174ee7f23ff12a].

1 [setup] 1 [setup] 2 2 3 [ezsteps] 3 [ezsteps] 4 lookittmp ls /tmp | 4 exit2 exit 2 5 lookithome ls /home 5 lookithome ls /home 6 6 7 [test_meta] 7 [test_meta] 8 author matt 8 author matt 9 owner bob 9 owner bob 10 description This test runs a single ezstep which is expected to pass, no logpro | 10 description This test runs two steps; the first exits with > 11 code 2 (a fail because not using logpro) and the second > 12 is a pass 11 13 12 tags first,single 14 tags first,single 13 reviewed 09/10/2011, by Matt 15 reviewed 09/10/2011, by Matt

Modified tests/tests/ezlog_fail/lookittmp.logpro from [33f0fc0fd2643bce] to [272f1780da5e82dc].

1 ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com 1 ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com 2 ;; 2 ;; 3 ;; License GPL. 3 ;; License GPL. 4 4 5 5 6 (expect:required in "LogFileBody" > 0 "Must be some files in the dir" #/this hop < 7 < 8 (expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\ 6 (expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\ 9 (expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) 7 (expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) 10 (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/.*/)) ;; fo 8 (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/.*/)) ;; fo

Modified tests/tests/ezlog_warn/lookithome.logpro from [09d60e16104ff257] to [b2a6575abfd9002b].

1 ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com 1 ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com 2 ;; 2 ;; 3 ;; License GPL. 3 ;; License GPL. 4 4 5 5 6 ;; Force a warn for this test 6 ;; Force a warn for this test 7 (expect:warning in "LogFileBody" = 0 "Any warning" #/.*/) < 8 (expect:required in "LogFileBody" > 0 "Must be some files in the dir" #/.*/) 7 (expect:required in "LogFileBody" > 0 "Must be some files in the dir" #/.*/) 9 8 10 (expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\ 9 (expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\ > 10 (expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) 11 (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; 11 (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;;

Modified tests/tests/ezlog_warn/testconfig from [96f73c85f94dd407] to [f14cf9fc78564e45].

1 [setup] 1 [setup] 2 2 3 [ezsteps] 3 [ezsteps] 4 lookittmp ls /tmp 4 lookittmp ls /tmp 5 lookithome ls /home;echo warn | 5 lookithome ls /home 6 6 7 [test_meta] 7 [test_meta] 8 author matt 8 author matt 9 owner bob 9 owner bob 10 description This test runs a single ezstep which is expected to pass using a sim | 10 description This test runs two ezsteps the first of which is expected to fail us 11 11 12 tags first,single 12 tags first,single 13 reviewed 09/10/2011, by Matt 13 reviewed 09/10/2011, by Matt

Modified utils/mt_ezstep from [a0de763cc0971dbd] to [41dcc3da03020865].

13 # 13 # 14 stepname=$1;shift 14 stepname=$1;shift 15 command=$* 15 command=$* 16 16 17 allstatus=99 17 allstatus=99 18 runstatus=99 18 runstatus=99 19 logpropstatus=99 19 logpropstatus=99 > 20 > 21 # source the environment from the previous step if it exists 20 22 21 # if a logpro file exists then use it otherwise just run the command, nb// was u 23 # if a logpro file exists then use it otherwise just run the command, nb// was u 22 if [ -e ${stepname}.logpro ];then 24 if [ -e ${stepname}.logpro ];then 23 $command 2>&1| logpro ${stepname}.logpro ${stepname}.html &> ${stepname}.log 25 $command 2>&1| logpro ${stepname}.logpro ${stepname}.html &> ${stepname}.log 24 allstatus=(${PIPESTATUS[0]} ${PIPESTATUS[1]}) 26 allstatus=(${PIPESTATUS[0]} ${PIPESTATUS[1]}) 25 runstatus=${allstatus[0]} 27 runstatus=${allstatus[0]} 26 logprostatus=${allstatus[1]} 28 logprostatus=${allstatus[1]}