Index: configf.scm ================================================================== --- configf.scm +++ configf.scm @@ -233,10 +233,13 @@ (let ((sectdat (hash-table-ref/default cfgdat section '()))) (if (null? sectdat) '() (map car sectdat)))) +(define (configf:get-section cfdat section) + (hash-table-ref/default cfgdat section '())) + (define (setup) (let* ((configf (find-config)) (config (if configf (read-config configf #f #t) #f))) (if config (setenv "RUN_AREA_HOME" (pathname-directory configf))) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -611,13 +611,12 @@ ;;====================================================================== ;; Misc. test related queries ;;====================================================================== -(define (db:test-get-paths-matching db keynames target) - (let* ((res '()) - (itempatt (if (args:get-arg "-itempatt")(args:get-arg "-itempatt") "%")) +(define (db:test-get-paths-matching db keynames target fnamepatt #!key (res '())) + (let* ((itempatt (if (args:get-arg "-itempatt")(args:get-arg "-itempatt") "%")) (testpatt (if (args:get-arg "-testpatt")(args:get-arg "-testpatt") "%")) (statepatt (if (args:get-arg ":state") (args:get-arg ":state") "%")) (statuspatt (if (args:get-arg ":status") (args:get-arg ":status") "%")) (runname (if (args:get-arg ":runname") (args:get-arg ":runname") "%")) (keystr (string-intersperse @@ -634,11 +633,37 @@ (sqlite3:for-each-row (lambda (p) (set! res (cons p res))) db qrystr) - res)) + (if fnamepatt + (apply append + (map (lambda (p) + (glob (conc p "/" fnamepatt))) + res)) + res))) + +;; look through tests from matching runs for a file +(define (db:test-get-first-path-matching db keynames target fname) + ;; [refpaths] is the section where references to other megatest databases are stored + (let ((mt-paths (configf:get-section "refpaths")) + (res (db:test-get-paths-matching db keynames target fname))) + (let loop ((pathdat (if (null? paths) #f (car mt-paths))) + (tal (if (null? paths) '()(cdr mt-paths)))) + (if (not (null? res)) + (car res) ;; return first found + (if path + (let* ((db (open-db path: (cadr pathdat))) + (newres (db:test-get-paths-matching db keynames target fname))) + (debug:print 4 "INFO: Trying " (car pathdat) " at " (cadr pathdat)) + (sqlite3:finalize! db) + (if (not (null? newres)) + (car newres) + (if (null? tal) + #f + (loop (car tal)(cdr tal)))))))))) + (define (db:test-get-test-records-matching db keynames target) (let* ((res '()) (itempatt (if (args:get-arg "-itempatt")(args:get-arg "-itempatt") "%")) (testpatt (if (args:get-arg "-testpatt")(args:get-arg "-testpatt") "%")) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -73,19 +73,18 @@ :variable : set the variable name (optional) :value : value measured (required) :expected : value expected (required) :tol : |value-expect| <= tol (required, can be <, >, >=, <= or number) :units : name of the units for value, expected_value etc. (optional) - -load-test-data : read test specific data for storage in the test_data table from standard in. Each line is comma delimited with four fields category,variable,value,comment Queries -list-runs patt : list runs matching pattern \"patt\", % is the wildcard -showkeys : show the keys used in this megatest setup - -test-paths targpatt : get the most recent test path(s) matching targpatt e.g. %/%... + -test-path targpatt : get the most recent test path(s) matching targpatt e.g. %/%... returns list sorted by age ascending, see examples below Misc -rebuild-db : bring the database schema up to date -update-meta : update the tests metadata for all tests @@ -101,16 +100,14 @@ -pathmod path : insert path, i.e. path/runame/itempath/logfile.html will clear the field if no rundir/testname/itempath/logfile if it contains forward slashes the path will be converted to windows style -Helpers (these only apply in test run mode) - Examples -# Get test paths -megatest -test-paths -target ubuntu/n%/no% :runname w49% -testpatt test_mt% +# Get test path, the '.' is required, could use '*' or a specific path/file +megatest -test-path . -target ubuntu/n%/no% :runname w49% -testpatt test_mt% Called as " (string-intersperse (argv) " "))) ;; -gui : start a gui interface ;; -config fname : override the runconfig file with fname @@ -172,10 +169,11 @@ "-repl" "-lock" "-unlock" ;; queries "-test-paths" ;; get path(s) to a test, ordered by youngest first + "-test-path" ;; -test-paths is deprecated "-runall" ;; run all tests "-remove-runs" "-usequeue" "-rebuild-db" @@ -447,11 +445,11 @@ ;;====================================================================== ;; Get paths to tests ;;====================================================================== ;; Get test paths matching target, runname, testpatt, and itempatt -(if (args:get-arg "-test-paths") +(if (or (args:get-arg "-test-path")(args:get-arg "-test-paths")) ;; if we are in a test use the MT_CMDINFO data (if (getenv "MT_CMDINFO") (let* ((startingdir (current-directory)) (cmdinfo (read (open-input-string (base64:base64-decode (getenv "MT_CMDINFO"))))) (testpath (assoc/default 'testpath cmdinfo)) @@ -469,11 +467,11 @@ (begin (debug:print 0 "ERROR: -target is required.") (exit 1))) (if (not (setup-for-run)) (begin - (debug:print 0 "Failed to setup, giving up on -test-paths, exiting") + (debug:print 0 "Failed to setup, giving up on -test-path, exiting") (exit 1))) (set! db (open-db)) (if (not (args:get-arg "-server")) (server:client-setup db)) (let* ((itempatt (args:get-arg "-itempatt")) @@ -484,12 +482,12 @@ (for-each (lambda (path) (print path)) paths))) ;; else do a general-run-call (general-run-call - "-test-paths" - "Get paths to tests" + "-test-path" + "Get paths to test" (lambda (db target runname keys keynames keyvallst) (let* ((itempatt (args:get-arg "-itempatt")) (paths (rdb:test-get-paths-matching db keynames target))) (for-each (lambda (path) (print path)) Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -9,46 +9,46 @@ SERVER := runall : test1 test2 test1 : cleanprep - $(MEGATEST) -runtests ez_pass -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_a $(SERVER) + cd fullrun;$(MEGATEST) -runtests ez_pass -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_a $(SERVER) test2 : cleanprep - $(MEGATEST) -runtests runfirst -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b $(SERVER) -debug 10 + cd fullrun;$(MEGATEST) -runtests runfirst -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b $(SERVER) -debug 10 test3 : cleanprep - $(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b -m "This is a comment specific to a run" -v $(SERVER) + cd fullrun;$(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b -m "This is a comment specific to a run" -v $(SERVER) test4 : cleanprep - $(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_aa -v $(SERVER) 2&>1 aa.log & - $(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ab -v $(SERVER) 2&>1 ab.log & - $(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ac -v $(SERVER) 2&>1 ac.log & - $(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ad -v $(SERVER) 2&>1 ad.log & - $(MEGATEST) -runtests runfirst -itempatt %/1 -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_itempatt -v - $(MEGATEST) -runtests runfirst -itempatt %blahha% -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_itempatt -debug 10 + cd fullrun;$(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_aa -v $(SERVER) 2&>1 aa.log & + cd fullrun;$(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ab -v $(SERVER) 2&>1 ab.log & + cd fullrun;$(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ac -v $(SERVER) 2&>1 ac.log & + cd fullrun;$(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ad -v $(SERVER) 2&>1 ad.log & + cd fullrun;$(MEGATEST) -runtests runfirst -itempatt %/1 -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_itempatt -v + cd fullrun;$(MEGATEST) -runtests runfirst -itempatt %blahha% -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_itempatt -debug 10 cleanprep : ../*.scm Makefile *.config sqlite3 megatest.db "delete from metadat where var='SERVER';" mkdir -p /tmp/mt_runs /tmp/mt_links cd ..;make install - $(MEGATEST) -remove-runs :runname $(RUNNAME)% -target %/%/% -testpatt % -itempatt % - $(BINPATH)/dboard -rows 15 & + cd fullrun;$(MEGATEST) -remove-runs :runname $(RUNNAME)% -target %/%/% -testpatt % -itempatt % + cd fullrun;$(BINPATH)/dboard -rows 15 & touch cleanprep test : csi -b -I .. ../megatest.scm -- -runall -target ubuntu/afs/tmp :runname blah cd ../;make test make runall dashboard : cd ../;make install - $(BINPATH)/dboard & + cd fullrun;$(BINPATH)/dboard & remove : - (cd ../;make);$(MEGATEST) -remove-runs :runname $(RUN) -testpatt % -itempatt % :sysname % :fsname % :datapath % + (cd ../;make);cd fullrun;$(MEGATEST) -remove-runs :runname $(RUN) -testpatt % -itempatt % :sysname % :fsname % :datapath % clean : rm cleanprep runforever : - while(ls); do runname=`date +%F-%R:%S`;$(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 + 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/common_runconfigs.config Index: tests/common_runconfigs.config ================================================================== --- tests/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 - ADDED tests/fullrun/common_runconfigs.config Index: tests/fullrun/common_runconfigs.config ================================================================== --- /dev/null +++ tests/fullrun/common_runconfigs.config @@ -0,0 +1,17 @@ +[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 + ADDED tests/fullrun/megatest.config Index: tests/fullrun/megatest.config ================================================================== --- /dev/null +++ tests/fullrun/megatest.config @@ -0,0 +1,58 @@ +[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 + +[setup] +# exectutable /path/to/megatest +max_concurrent_jobs 200 +linktree /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 nbfake +# 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 -- + +[validvalues] +state start end +status pass fail n/a 0 1 running + +# These are set before all tests, override them +# in the testconfig [pre-launch-env-overrides] section +[env-override] +SPECIAL_ENV_VARS overide them here - should be seen at launch and in the runs +TESTVAR [system realpath .] +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 + +# XTERM [system xterm] +# RUNDEAD [system exit 56] + +## disks are: +## name host:/path/to/area +## -or- +## name /path/to/area +[disks] +1 /tmp/mt_runs + +[include #{getenv USER}_testing.config] ADDED tests/fullrun/runconfigs.config Index: tests/fullrun/runconfigs.config ================================================================== --- /dev/null +++ tests/fullrun/runconfigs.config @@ -0,0 +1,8 @@ +[include common_runconfigs.config] + +WACKYVAR0 #{get ubuntu/nfs/none CURRENT} +WACKYVAR1 #{scheme (args:get-arg "-target")} + +[default/ubuntu/nfs] +WACKYVAR2 #{runconfigs-get CURRENT} + ADDED tests/fullrun/tests/exit_0/main.sh Index: tests/fullrun/tests/exit_0/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/exit_0/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/exit_0/testconfig Index: tests/fullrun/tests/exit_0/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/exit_0/testconfig @@ -0,0 +1,10 @@ +[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 ADDED tests/fullrun/tests/exit_1/main.sh Index: tests/fullrun/tests/exit_1/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/exit_1/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/exit_1/testconfig Index: tests/fullrun/tests/exit_1/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/exit_1/testconfig @@ -0,0 +1,13 @@ +[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 ADDED tests/fullrun/tests/ez_exit2_fail/testconfig Index: tests/fullrun/tests/ez_exit2_fail/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/ez_exit2_fail/testconfig @@ -0,0 +1,15 @@ +[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 ADDED tests/fullrun/tests/ez_fail/testconfig Index: tests/fullrun/tests/ez_fail/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/ez_fail/testconfig @@ -0,0 +1,19 @@ +[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 ADDED tests/fullrun/tests/ez_pass/testconfig Index: tests/fullrun/tests/ez_pass/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/ez_pass/testconfig @@ -0,0 +1,13 @@ +[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 ADDED tests/fullrun/tests/ezlog_fail/example.logpro Index: tests/fullrun/tests/ezlog_fail/example.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_fail/example.logpro @@ -0,0 +1,44 @@ +;; (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/) ADDED tests/fullrun/tests/ezlog_fail/lookithome.logpro Index: tests/fullrun/tests/ezlog_fail/lookithome.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_fail/lookithome.logpro @@ -0,0 +1,10 @@ +;; (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 ADDED tests/fullrun/tests/ezlog_fail/lookittmp.logpro Index: tests/fullrun/tests/ezlog_fail/lookittmp.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_fail/lookittmp.logpro @@ -0,0 +1,6 @@ +;; (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 ADDED tests/fullrun/tests/ezlog_fail/testconfig Index: tests/fullrun/tests/ezlog_fail/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_fail/testconfig @@ -0,0 +1,13 @@ +[setup] + +[ezsteps] +lookittmp ls /tmp +lookithome ls /home + +[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 ADDED tests/fullrun/tests/ezlog_fail_then_pass/firststep.logpro Index: tests/fullrun/tests/ezlog_fail_then_pass/firststep.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_fail_then_pass/firststep.logpro @@ -0,0 +1,10 @@ +;; (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 ADDED tests/fullrun/tests/ezlog_fail_then_pass/main.sh Index: tests/fullrun/tests/ezlog_fail_then_pass/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_fail_then_pass/main.sh @@ -0,0 +1,18 @@ +#!/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 ADDED tests/fullrun/tests/ezlog_fail_then_pass/testconfig Index: tests/fullrun/tests/ezlog_fail_then_pass/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_fail_then_pass/testconfig @@ -0,0 +1,13 @@ +[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 ADDED tests/fullrun/tests/ezlog_pass/example.logpro Index: tests/fullrun/tests/ezlog_pass/example.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_pass/example.logpro @@ -0,0 +1,44 @@ +;; (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/) ADDED tests/fullrun/tests/ezlog_pass/lookittmp.logpro Index: tests/fullrun/tests/ezlog_pass/lookittmp.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_pass/lookittmp.logpro @@ -0,0 +1,10 @@ +;; (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 ADDED tests/fullrun/tests/ezlog_pass/testconfig Index: tests/fullrun/tests/ezlog_pass/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_pass/testconfig @@ -0,0 +1,13 @@ +[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 ADDED tests/fullrun/tests/ezlog_warn/lookithome.logpro Index: tests/fullrun/tests/ezlog_warn/lookithome.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_warn/lookithome.logpro @@ -0,0 +1,11 @@ +;; (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 ADDED tests/fullrun/tests/ezlog_warn/lookittmp.logpro Index: tests/fullrun/tests/ezlog_warn/lookittmp.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_warn/lookittmp.logpro @@ -0,0 +1,12 @@ +;; (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 ADDED tests/fullrun/tests/ezlog_warn/testconfig Index: tests/fullrun/tests/ezlog_warn/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/ezlog_warn/testconfig @@ -0,0 +1,13 @@ +[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 ADDED tests/fullrun/tests/lineitem_fail/main.sh Index: tests/fullrun/tests/lineitem_fail/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/lineitem_fail/main.sh @@ -0,0 +1,23 @@ +#!/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 + ADDED tests/fullrun/tests/lineitem_fail/testconfig Index: tests/fullrun/tests/lineitem_fail/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/lineitem_fail/testconfig @@ -0,0 +1,10 @@ +[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 ADDED tests/fullrun/tests/lineitem_pass/main.sh Index: tests/fullrun/tests/lineitem_pass/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/lineitem_pass/main.sh @@ -0,0 +1,22 @@ +#!/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 ADDED tests/fullrun/tests/lineitem_pass/testconfig Index: tests/fullrun/tests/lineitem_pass/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/lineitem_pass/testconfig @@ -0,0 +1,10 @@ +[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 ADDED tests/fullrun/tests/logpro_required_fail/lookittmp.logpro Index: tests/fullrun/tests/logpro_required_fail/lookittmp.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/logpro_required_fail/lookittmp.logpro @@ -0,0 +1,8 @@ +;; (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 ADDED tests/fullrun/tests/logpro_required_fail/testconfig Index: tests/fullrun/tests/logpro_required_fail/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/logpro_required_fail/testconfig @@ -0,0 +1,12 @@ +[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. + +tags logpro +reviewed 09/10/2011, by Matt ADDED tests/fullrun/tests/manual_example/results/results.csv Index: tests/fullrun/tests/manual_example/results/results.csv ================================================================== --- /dev/null +++ tests/fullrun/tests/manual_example/results/results.csv @@ -0,0 +1,1 @@ +category, variable, expected, value, tol, units, comment ADDED tests/fullrun/tests/manual_example/runsetupxterm.sh Index: tests/fullrun/tests/manual_example/runsetupxterm.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/manual_example/runsetupxterm.sh @@ -0,0 +1,13 @@ +#!/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 + ADDED tests/fullrun/tests/manual_example/setupremote.sh Index: tests/fullrun/tests/manual_example/setupremote.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/manual_example/setupremote.sh @@ -0,0 +1,28 @@ +#!/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 ADDED tests/fullrun/tests/manual_example/testconfig Index: tests/fullrun/tests/manual_example/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/manual_example/testconfig @@ -0,0 +1,13 @@ +[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 ADDED tests/fullrun/tests/neverrun/testconfig Index: tests/fullrun/tests/neverrun/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/neverrun/testconfig @@ -0,0 +1,4 @@ +[setup] +runscript idontexist + + ADDED tests/fullrun/tests/priority_1/main.sh Index: tests/fullrun/tests/priority_1/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_1/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/priority_1/testconfig Index: tests/fullrun/tests/priority_1/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_1/testconfig @@ -0,0 +1,13 @@ +[setup] +runscript main.sh + +[requirements] +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 ADDED tests/fullrun/tests/priority_10/main.sh Index: tests/fullrun/tests/priority_10/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_10/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/priority_10/testconfig Index: tests/fullrun/tests/priority_10/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_10/testconfig @@ -0,0 +1,13 @@ +[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 ADDED tests/fullrun/tests/priority_10_waiton_1/main.sh Index: tests/fullrun/tests/priority_10_waiton_1/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_10_waiton_1/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/priority_10_waiton_1/testconfig Index: tests/fullrun/tests/priority_10_waiton_1/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_10_waiton_1/testconfig @@ -0,0 +1,14 @@ +[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 ADDED tests/fullrun/tests/priority_2/main.sh Index: tests/fullrun/tests/priority_2/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_2/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/priority_2/testconfig Index: tests/fullrun/tests/priority_2/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_2/testconfig @@ -0,0 +1,13 @@ +[setup] +runscript main.sh + +[requirements] +priority 2 + +[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 ADDED tests/fullrun/tests/priority_3/main.sh Index: tests/fullrun/tests/priority_3/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_3/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/priority_3/testconfig Index: tests/fullrun/tests/priority_3/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_3/testconfig @@ -0,0 +1,14 @@ +[setup] +runscript main.sh + +[requirements] +priority 3 + + +[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 ADDED tests/fullrun/tests/priority_4/main.sh Index: tests/fullrun/tests/priority_4/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_4/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/priority_4/testconfig Index: tests/fullrun/tests/priority_4/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_4/testconfig @@ -0,0 +1,13 @@ +[setup] +runscript main.sh + +[requirements] +priority 4 + +[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 ADDED tests/fullrun/tests/priority_5/main.sh Index: tests/fullrun/tests/priority_5/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_5/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/priority_5/testconfig Index: tests/fullrun/tests/priority_5/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_5/testconfig @@ -0,0 +1,13 @@ +[setup] +runscript main.sh + +[requirements] +priority 5 + +[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 ADDED tests/fullrun/tests/priority_6/main.sh Index: tests/fullrun/tests/priority_6/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_6/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/priority_6/testconfig Index: tests/fullrun/tests/priority_6/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_6/testconfig @@ -0,0 +1,13 @@ +[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 ADDED tests/fullrun/tests/priority_7/main.sh Index: tests/fullrun/tests/priority_7/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_7/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/priority_7/testconfig Index: tests/fullrun/tests/priority_7/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_7/testconfig @@ -0,0 +1,13 @@ +[setup] +runscript main.sh + +[requirements] +priority 7 + +[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 ADDED tests/fullrun/tests/priority_8/main.sh Index: tests/fullrun/tests/priority_8/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_8/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/priority_8/testconfig Index: tests/fullrun/tests/priority_8/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_8/testconfig @@ -0,0 +1,13 @@ +[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 ADDED tests/fullrun/tests/priority_9/main.sh Index: tests/fullrun/tests/priority_9/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_9/main.sh @@ -0,0 +1,10 @@ +#!/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 ADDED tests/fullrun/tests/priority_9/testconfig Index: tests/fullrun/tests/priority_9/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/priority_9/testconfig @@ -0,0 +1,13 @@ +[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 ADDED tests/fullrun/tests/runfirst/main.sh Index: tests/fullrun/tests/runfirst/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/runfirst/main.sh @@ -0,0 +1,31 @@ +#!/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 $? + +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 + +$MT_MEGATEST -test-status :state COMPLETED :status $? -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" + +# $MT_MEGATEST -test-status :state COMPLETED :status FAIL ADDED tests/fullrun/tests/runfirst/testconfig Index: tests/fullrun/tests/runfirst/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/runfirst/testconfig @@ -0,0 +1,24 @@ +[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 ADDED tests/fullrun/tests/runfirst/wasting_time.logpro Index: tests/fullrun/tests/runfirst/wasting_time.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/runfirst/wasting_time.logpro @@ -0,0 +1,15 @@ +;; 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))) + ADDED tests/fullrun/tests/singletest/main.sh Index: tests/fullrun/tests/singletest/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/singletest/main.sh @@ -0,0 +1,9 @@ +#!/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_err "This is the first error" ADDED tests/fullrun/tests/singletest/testconfig Index: tests/fullrun/tests/singletest/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/singletest/testconfig @@ -0,0 +1,13 @@ +[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. + ADDED tests/fullrun/tests/singletest/wasting_time.logpro Index: tests/fullrun/tests/singletest/wasting_time.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/singletest/wasting_time.logpro @@ -0,0 +1,15 @@ +;; 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))) + ADDED tests/fullrun/tests/singletest2/main.sh Index: tests/fullrun/tests/singletest2/main.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/singletest2/main.sh @@ -0,0 +1,9 @@ +#!/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" ADDED tests/fullrun/tests/singletest2/testconfig Index: tests/fullrun/tests/singletest2/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/singletest2/testconfig @@ -0,0 +1,14 @@ +[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. + ADDED tests/fullrun/tests/singletest2/wasting_time.logpro Index: tests/fullrun/tests/singletest2/wasting_time.logpro ================================================================== --- /dev/null +++ tests/fullrun/tests/singletest2/wasting_time.logpro @@ -0,0 +1,15 @@ +;; 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))) + ADDED tests/fullrun/tests/sqlitespeed/runscript.rb Index: tests/fullrun/tests/sqlitespeed/runscript.rb ================================================================== --- /dev/null +++ tests/fullrun/tests/sqlitespeed/runscript.rb @@ -0,0 +1,37 @@ +#! /usr/bin/env ruby + +require "#{ENV['MT_RUN_AREA_HOME']}/supportfiles/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="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) + + + + ADDED tests/fullrun/tests/sqlitespeed/testconfig Index: tests/fullrun/tests/sqlitespeed/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/sqlitespeed/testconfig @@ -0,0 +1,11 @@ +[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 + ADDED tests/fullrun/tests/test_mt_vars/altvarnotset.sh Index: tests/fullrun/tests/test_mt_vars/altvarnotset.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/test_mt_vars/altvarnotset.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +! grep ALT_VAR megatest.sh ADDED tests/fullrun/tests/test_mt_vars/bogousnotset.sh Index: tests/fullrun/tests/test_mt_vars/bogousnotset.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/test_mt_vars/bogousnotset.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +! grep BOGOUS megatest.sh ADDED tests/fullrun/tests/test_mt_vars/currentisblah.sh Index: tests/fullrun/tests/test_mt_vars/currentisblah.sh ================================================================== --- /dev/null +++ tests/fullrun/tests/test_mt_vars/currentisblah.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +grep CURRENT megatest.sh | grep /tmp/nada ADDED tests/fullrun/tests/test_mt_vars/testconfig Index: tests/fullrun/tests/test_mt_vars/testconfig ================================================================== --- /dev/null +++ tests/fullrun/tests/test_mt_vars/testconfig @@ -0,0 +1,28 @@ +[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 + +[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/megatest.config Index: tests/megatest.config ================================================================== --- tests/megatest.config +++ /dev/null @@ -1,53 +0,0 @@ -[fields] -sysname TEXT -fsname TEXT -datapath TEXT - -[setup] -# exectutable /path/to/megatest -max_concurrent_jobs 200 -linktree /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 nbfake -# 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 -- - -[validvalues] -state start end -status pass fail n/a 0 1 running - -# These are set before all tests, override them -# in the testconfig [pre-launch-env-overrides] section -[env-override] -SPECIAL_ENV_VARS overide them here - should be seen at launch and in the runs -TESTVAR [system realpath .] -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 - -# XTERM [system xterm] -# RUNDEAD [system exit 56] - -## disks are: -## name host:/path/to/area -## -or- -## name /path/to/area -[disks] -1 /tmp/mt_runs - -[include #{getenv USER}_testing.config] DELETED tests/runconfigs.config Index: tests/runconfigs.config ================================================================== --- tests/runconfigs.config +++ /dev/null @@ -1,8 +0,0 @@ -[include common_runconfigs.config] - -WACKYVAR0 #{get ubuntu/nfs/none CURRENT} -WACKYVAR1 #{scheme (args:get-arg "-target")} - -[default/ubuntu/nfs] -WACKYVAR2 #{runconfigs-get CURRENT} - DELETED tests/tests/exit_0/main.sh Index: tests/tests/exit_0/main.sh ================================================================== --- tests/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/tests/exit_0/testconfig Index: tests/tests/exit_0/testconfig ================================================================== --- tests/tests/exit_0/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/tests/exit_1/main.sh Index: tests/tests/exit_1/main.sh ================================================================== --- tests/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/tests/exit_1/testconfig Index: tests/tests/exit_1/testconfig ================================================================== --- tests/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/tests/ez_exit2_fail/testconfig Index: tests/tests/ez_exit2_fail/testconfig ================================================================== --- tests/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/tests/ez_fail/testconfig Index: tests/tests/ez_fail/testconfig ================================================================== --- tests/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/tests/ez_pass/testconfig Index: tests/tests/ez_pass/testconfig ================================================================== --- tests/tests/ez_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, no logpro file. - -tags first,single -reviewed 09/10/2011, by Matt DELETED tests/tests/ezlog_fail/example.logpro Index: tests/tests/ezlog_fail/example.logpro ================================================================== --- tests/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/tests/ezlog_fail/lookithome.logpro Index: tests/tests/ezlog_fail/lookithome.logpro ================================================================== --- tests/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/tests/ezlog_fail/lookittmp.logpro Index: tests/tests/ezlog_fail/lookittmp.logpro ================================================================== --- tests/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/tests/ezlog_fail/testconfig Index: tests/tests/ezlog_fail/testconfig ================================================================== --- tests/tests/ezlog_fail/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 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/tests/ezlog_fail_then_pass/firststep.logpro Index: tests/tests/ezlog_fail_then_pass/firststep.logpro ================================================================== --- tests/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/tests/ezlog_fail_then_pass/main.sh Index: tests/tests/ezlog_fail_then_pass/main.sh ================================================================== --- tests/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/tests/ezlog_fail_then_pass/testconfig Index: tests/tests/ezlog_fail_then_pass/testconfig ================================================================== --- tests/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/tests/ezlog_pass/example.logpro Index: tests/tests/ezlog_pass/example.logpro ================================================================== --- tests/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/tests/ezlog_pass/lookittmp.logpro Index: tests/tests/ezlog_pass/lookittmp.logpro ================================================================== --- tests/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/tests/ezlog_pass/testconfig Index: tests/tests/ezlog_pass/testconfig ================================================================== --- tests/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/tests/ezlog_warn/lookithome.logpro Index: tests/tests/ezlog_warn/lookithome.logpro ================================================================== --- tests/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/tests/ezlog_warn/lookittmp.logpro Index: tests/tests/ezlog_warn/lookittmp.logpro ================================================================== --- tests/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/tests/ezlog_warn/testconfig Index: tests/tests/ezlog_warn/testconfig ================================================================== --- tests/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/tests/lineitem_fail/main.sh Index: tests/tests/lineitem_fail/main.sh ================================================================== --- tests/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/tests/lineitem_fail/testconfig Index: tests/tests/lineitem_fail/testconfig ================================================================== --- tests/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/tests/lineitem_pass/main.sh Index: tests/tests/lineitem_pass/main.sh ================================================================== --- tests/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/tests/lineitem_pass/testconfig Index: tests/tests/lineitem_pass/testconfig ================================================================== --- tests/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/tests/logpro_required_fail/lookittmp.logpro Index: tests/tests/logpro_required_fail/lookittmp.logpro ================================================================== --- tests/tests/logpro_required_fail/lookittmp.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; (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 DELETED tests/tests/logpro_required_fail/testconfig Index: tests/tests/logpro_required_fail/testconfig ================================================================== --- tests/tests/logpro_required_fail/testconfig +++ /dev/null @@ -1,12 +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. - -tags logpro -reviewed 09/10/2011, by Matt DELETED tests/tests/manual_example/results/results.csv Index: tests/tests/manual_example/results/results.csv ================================================================== --- tests/tests/manual_example/results/results.csv +++ /dev/null @@ -1,1 +0,0 @@ -category, variable, expected, value, tol, units, comment DELETED tests/tests/manual_example/runsetupxterm.sh Index: tests/tests/manual_example/runsetupxterm.sh ================================================================== --- tests/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/tests/manual_example/setupremote.sh Index: tests/tests/manual_example/setupremote.sh ================================================================== --- tests/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/tests/manual_example/testconfig Index: tests/tests/manual_example/testconfig ================================================================== --- tests/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/tests/neverrun/testconfig Index: tests/tests/neverrun/testconfig ================================================================== --- tests/tests/neverrun/testconfig +++ /dev/null @@ -1,4 +0,0 @@ -[setup] -runscript idontexist - - DELETED tests/tests/priority_1/main.sh Index: tests/tests/priority_1/main.sh ================================================================== --- tests/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/tests/priority_1/testconfig Index: tests/tests/priority_1/testconfig ================================================================== --- tests/tests/priority_1/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -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/tests/priority_10/main.sh Index: tests/tests/priority_10/main.sh ================================================================== --- tests/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/tests/priority_10/testconfig Index: tests/tests/priority_10/testconfig ================================================================== --- tests/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/tests/priority_10_waiton_1/main.sh Index: tests/tests/priority_10_waiton_1/main.sh ================================================================== --- tests/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/tests/priority_10_waiton_1/testconfig Index: tests/tests/priority_10_waiton_1/testconfig ================================================================== --- tests/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/tests/priority_2/main.sh Index: tests/tests/priority_2/main.sh ================================================================== --- tests/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 2 - $MT_MEGATEST -step step$i :state end :status 0 -done - -exit 0 DELETED tests/tests/priority_2/testconfig Index: tests/tests/priority_2/testconfig ================================================================== --- tests/tests/priority_2/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 2 - -[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/tests/priority_3/main.sh Index: tests/tests/priority_3/main.sh ================================================================== --- tests/tests/priority_3/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/tests/priority_3/testconfig Index: tests/tests/priority_3/testconfig ================================================================== --- tests/tests/priority_3/testconfig +++ /dev/null @@ -1,14 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 3 - - -[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/tests/priority_4/main.sh Index: tests/tests/priority_4/main.sh ================================================================== --- tests/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/tests/priority_4/testconfig Index: tests/tests/priority_4/testconfig ================================================================== --- tests/tests/priority_4/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 4 - -[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/tests/priority_5/main.sh Index: tests/tests/priority_5/main.sh ================================================================== --- tests/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/tests/priority_5/testconfig Index: tests/tests/priority_5/testconfig ================================================================== --- tests/tests/priority_5/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 5 - -[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/tests/priority_6/main.sh Index: tests/tests/priority_6/main.sh ================================================================== --- tests/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/tests/priority_6/testconfig Index: tests/tests/priority_6/testconfig ================================================================== --- tests/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/tests/priority_7/main.sh Index: tests/tests/priority_7/main.sh ================================================================== --- tests/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/tests/priority_7/testconfig Index: tests/tests/priority_7/testconfig ================================================================== --- tests/tests/priority_7/testconfig +++ /dev/null @@ -1,13 +0,0 @@ -[setup] -runscript main.sh - -[requirements] -priority 7 - -[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/tests/priority_8/main.sh Index: tests/tests/priority_8/main.sh ================================================================== --- tests/tests/priority_8/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/tests/priority_8/testconfig Index: tests/tests/priority_8/testconfig ================================================================== --- tests/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/tests/priority_9/main.sh Index: tests/tests/priority_9/main.sh ================================================================== --- tests/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/tests/priority_9/testconfig Index: tests/tests/priority_9/testconfig ================================================================== --- tests/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/tests/runfirst/main.sh Index: tests/tests/runfirst/main.sh ================================================================== --- tests/tests/runfirst/main.sh +++ /dev/null @@ -1,31 +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 $? - -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 - -$MT_MEGATEST -test-status :state COMPLETED :status $? -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" - -# $MT_MEGATEST -test-status :state COMPLETED :status FAIL DELETED tests/tests/runfirst/testconfig Index: tests/tests/runfirst/testconfig ================================================================== --- tests/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/tests/runfirst/wasting_time.logpro Index: tests/tests/runfirst/wasting_time.logpro ================================================================== --- tests/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/tests/singletest/main.sh Index: tests/tests/singletest/main.sh ================================================================== --- tests/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 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_err "This is the first error" DELETED tests/tests/singletest/testconfig Index: tests/tests/singletest/testconfig ================================================================== --- tests/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/tests/singletest/wasting_time.logpro Index: tests/tests/singletest/wasting_time.logpro ================================================================== --- tests/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/tests/singletest2/main.sh Index: tests/tests/singletest2/main.sh ================================================================== --- tests/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/tests/singletest2/testconfig Index: tests/tests/singletest2/testconfig ================================================================== --- tests/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/tests/singletest2/wasting_time.logpro Index: tests/tests/singletest2/wasting_time.logpro ================================================================== --- tests/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/tests/sqlitespeed/runscript.rb Index: tests/tests/sqlitespeed/runscript.rb ================================================================== --- tests/tests/sqlitespeed/runscript.rb +++ /dev/null @@ -1,37 +0,0 @@ -#! /usr/bin/env ruby - -require "#{ENV['MT_RUN_AREA_HOME']}/supportfiles/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="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/tests/sqlitespeed/testconfig Index: tests/tests/sqlitespeed/testconfig ================================================================== --- tests/tests/sqlitespeed/testconfig +++ /dev/null @@ -1,11 +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 - DELETED tests/tests/test_mt_vars/altvarnotset.sh Index: tests/tests/test_mt_vars/altvarnotset.sh ================================================================== --- tests/tests/test_mt_vars/altvarnotset.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -! grep ALT_VAR megatest.sh DELETED tests/tests/test_mt_vars/bogousnotset.sh Index: tests/tests/test_mt_vars/bogousnotset.sh ================================================================== --- tests/tests/test_mt_vars/bogousnotset.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -! grep BOGOUS megatest.sh DELETED tests/tests/test_mt_vars/currentisblah.sh Index: tests/tests/test_mt_vars/currentisblah.sh ================================================================== --- tests/tests/test_mt_vars/currentisblah.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -grep CURRENT megatest.sh | grep /tmp/nada DELETED tests/tests/test_mt_vars/testconfig Index: tests/tests/test_mt_vars/testconfig ================================================================== --- tests/tests/test_mt_vars/testconfig +++ /dev/null @@ -1,28 +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 - -[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