Megatest

Changes On Branch a24a1b2335a73377
Login

Changes In Branch extend-test-get-path Through [a24a1b2335] Excluding Merge-Ins

This is equivalent to a diff from 88d5b2682a to a24a1b2335

2012-04-23
09:58
Made genexample a bit safer Closed-Leaf check-in: f067e02af4 user: mrwellan tags: extend-test-get-path
09:27
Updated path due to move of tests check-in: a24a1b2335 user: mrwellan tags: extend-test-get-path
02:47
Minor tweak check-in: 091e1dd192 user: matt tags: extend-test-get-path
2012-04-22
16:57
Merged some layabout changes check-in: a378c1f1a9 user: matt tags: trunk
2012-04-20
22:29
Extend test get path check-in: 8f2a9bcf7c user: mrwellan tags: extend-test-get-path
12:12
Fixed bug with remove-runs removing a run record when tests still existed check-in: 88d5b2682a user: mrwellan tags: trunk
2012-04-19
23:58
go ahead and merge to trunk check-in: a06af4450a user: matt tags: trunk

Modified Makefile from [65935ed0ba] to [baa18dd99f].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

PREFIX=.
CSCOPTS= 
INSTALL=install
SRCFILES = common.scm items.scm launch.scm \
           ods.scm runconfig.scm server.scm configf.scm \
           db.scm keys.scm margs.scm megatest-version.scm \
           process.scm runs.scm tasks.scm tests.scm 

GUISRCF  = dashboard.scm dashboard-tests.scm dashboard-guimonitor.scm dashboard-main.scm

OFILES   = $(SRCFILES:%.scm=%.o)
GOFILES  = $(GUISRCF:%.scm=%.o)

HELPERS=$(addprefix $(PREFIX)/bin/,mt_laststep mt_runstep mt_ezstep)







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

PREFIX=.
CSCOPTS= 
INSTALL=install
SRCFILES = common.scm items.scm launch.scm \
           ods.scm runconfig.scm server.scm configf.scm \
           db.scm keys.scm margs.scm megatest-version.scm \
           process.scm runs.scm tasks.scm tests.scm genexample.scm

GUISRCF  = dashboard.scm dashboard-tests.scm dashboard-guimonitor.scm dashboard-main.scm

OFILES   = $(SRCFILES:%.scm=%.o)
GOFILES  = $(GUISRCF:%.scm=%.o)

HELPERS=$(addprefix $(PREFIX)/bin/,mt_laststep mt_runstep mt_ezstep)

Modified configf.scm from [26cad9ffd1] to [2c4fe9609e].

231
232
233
234
235
236
237



238
239
240
241
242
243
244

(define (configf:section-vars cfgdat section)
  (let ((sectdat (hash-table-ref/default cfgdat section '())))
    (if (null? sectdat)
	'()
	(map car sectdat))))




(define (setup)
  (let* ((configf (find-config))
	 (config  (if configf (read-config configf #f #t) #f)))
    (if config
	(setenv "RUN_AREA_HOME" (pathname-directory configf)))
    config))








>
>
>







231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247

(define (configf:section-vars cfgdat section)
  (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)))
    config))

Modified db.scm from [2c88e7344f] to [92d14b406b].

609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638




639






















640
641
642
643
644
645
646
		   logf test-id)
      (debug:print 0 "ERROR: db:test-set-log! called with non-string log file name " logf)))

;;======================================================================
;; 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") "%"))
	 (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 
		  (map (lambda (key val)
			 (conc "r." key " like '" val "'"))
		       keynames 
		       (string-split target "/"))
		  " AND "))
	 (qrystr (conc "SELECT t.rundir FROM tests AS t INNER JOIN runs AS r ON t.run_id=r.id WHERE "
		       keystr " AND r.runname LIKE '" runname "' AND item_path LIKE '" itempatt "' AND testname LIKE '"
		       testpatt "' AND t.state LIKE '" statepatt "' AND t.status LIKE '" statuspatt 
		       "'ORDER BY t.event_time ASC;")))
    (debug:print 3 "qrystr: " qrystr)
    (sqlite3:for-each-row 
     (lambda (p)
       (set! res (cons p res)))
     db 
     qrystr)




    res))























(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") "%"))
	 (statepatt  (if (args:get-arg ":state")   (args:get-arg ":state")    "%"))
	 (statuspatt (if (args:get-arg ":status")  (args:get-arg ":status")   "%"))







|
<
|




















>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







609
610
611
612
613
614
615
616

617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
		   logf test-id)
      (debug:print 0 "ERROR: db:test-set-log! called with non-string log file name " logf)))

;;======================================================================
;; Misc. test related queries
;;======================================================================

(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 
		  (map (lambda (key val)
			 (conc "r." key " like '" val "'"))
		       keynames 
		       (string-split target "/"))
		  " AND "))
	 (qrystr (conc "SELECT t.rundir FROM tests AS t INNER JOIN runs AS r ON t.run_id=r.id WHERE "
		       keystr " AND r.runname LIKE '" runname "' AND item_path LIKE '" itempatt "' AND testname LIKE '"
		       testpatt "' AND t.state LIKE '" statepatt "' AND t.status LIKE '" statuspatt 
		       "'ORDER BY t.event_time ASC;")))
    (debug:print 3 "qrystr: " qrystr)
    (sqlite3:for-each-row 
     (lambda (p)
       (set! res (cons p res)))
     db 
     qrystr)
    (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") "%"))
	 (statepatt  (if (args:get-arg ":state")   (args:get-arg ":state")    "%"))
	 (statuspatt (if (args:get-arg ":status")  (args:get-arg ":status")   "%"))

Added genexample.scm version [35a0785685].

















































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
;;======================================================================
;; Copyright 2006-2012, Matthew Welland.
;; 
;;  This program is made available under the GNU GPL version 2.0 or
;;  greater. See the accompanying file COPYING for details.
;; 
;;  This program is distributed WITHOUT ANY WARRANTY; without even the
;;  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
;;  PURPOSE.
;;======================================================================

(declare (unit genexample))
(use posix)

(define genexample:example-logpro
#<<EOF
;; You should have at least one expect:required. This ensures that your process ran
(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/)

;; You may need ignores to suppress false error or warning hits from the later expects
;; NOTE: Order is important here!
(expect:ignore   in "LogFileBody"  < 99 "Ignore the word error in comments" #/^\/\/.*error/)
(expect:warning  in "LogFileBody"  = 0 "Any warning" #/warn/)
(expect:error    in "LogFileBody"  = 0 "Any error"  (list #/ERROR/ #/error/)) ;; but disallow any other errors
EOF
)

(define genexample:example-script
#<<EOF
#!/usr/bin/env bash

# Run your step here
EOF
)

(define (genexample:mk-megatest.config)
  (let ((keystr #f)
	(keys   #f)
	(lntree #f)
	(path   #f)
	(firstd #f))
    (print "Note: don't worry too much about typos in this process, you will be able to edit
the generated files before starting your first runs")

    ;; create the needed area
    (print "==================\nWhere can I create your Megatest regresssion/continuous build area? Note, your \n"
	   "tests will not necessarily be run in this area, disk space needs are modest.")
    (display "Enter your megatest directory: ")
    (set! path (read-line))

    (if (not (directory? path))
	(begin
	  (print "The path " path " does not exist or is not a directory. Attempting to create it now")
	  (create-directory path #t)))

    ;; first prompt user for fields
    ;;
    (print "==================\nNext you must specify fields or keys for your megatest area. These will 
be used to organise your runs. One field should probably be \"RELEASE\". 
Other examples of useful fields might be \"PLATFORM\", \"TARGET_OS\" or if you are in the
semiconductor business perhaps things like \"TECHNOLOGY_NODE\", \"DESIGN_KIT\" or \"METAL_STACK\".

The all caps is a convention because the variables you choose will be available to your tests
as environment variables. You can edit these values later but it is generally a good idea to
settle on them and get them right early on. Your runs will be stored in directories specified by
your keys. Example, if you have keys OSFAMILY/VARIANT/OSVER/RELEASE you may get a test \"build\"
in a directory like this: linux/ubuntu/11.04/rev_1.2/build

Please enter your keys now, separated by spaces or slashes. Only alpha-numeric characters. 
Upper case recommended.")
    (display "Enter keys separated by spaces or slashes: ")
    (set! keystr (read-line))
    (set! keys   (apply append
			(map string-split (string-split keystr "/"))))
    
    ;; Now get the link tree location and a first disk
    (print "==================\nNow you need an initial place to store your runs. These are called \"disks\" and you
can add more at any time. To get going provide a writeable directory name. ")
    (display "Enter your test runs directory: ")
    (set! firstd (read-line))
    (if (not (directory? firstd))
	(begin
	  (print "WARNING: you have specified a path " firstd " that does not exist. Attempting to create it...\n")
	  (create-directory firstd #t)))

    (print "==================\nMegatest uses a tree of symlinks to provide a uniform structure for finding all the tests
you run over time. Please provide a path where we can create this link tree.")
    (display "Enter link tree directory: ")
    (set! lntree (read-line))
    (if (not (directory? lntree))
	(begin
	  (print "WARNING: you have specified a path " lntree "that does not exist. Attempting to create it...\n")
	  (create-directory lntree #t)))
    
    (with-output-to-file (conc path "/megatest.config")
      (lambda ()
	(print "[fields]")
	(map (lambda (k)(print k " TEXT")) keys)
	(print "")
	(print "[setup]")
	(print "# Adjust max_concurrent_jobs to limit how much you load your machines")
	(print "max_concurrent_jobs 50\n")
	(print "# This is your link path, you can move it but it is generally better to keep it stable")
	(print "linktree " lntree)
	(print "\n# Job tools are more advanced ways to control how your jobs are launched")
	(print "[jobtools]\nuseshell yes\nlauncher nbfind\n")
	(print "# You can override environment variables for all your tests here")
	(print "[env-override]\nEXAMPLE_VAR example value\n")
	(print "# As you run more tests you may need to add additional disks, the names are arbitrary but must be unique")
	(print "[disks]\ndisk0 " firstd)))

    (print "==================\nI'm now creating a runconfigs.config file for you with a default section.
You can use this file to set variables for your tests based on the \"target\" (the combination
of keys).")
    (with-output-to-file (conc path "/runconfigs.config")
      (lambda ()
	(print "# The variables in the default category will be seen in all runs\n[default]\nALLTESTS see this variable\n")
	
	(print "# Your variables here are grouped by targets [" (string-intersperse keys "/") "]")
	(let ((example-target (string-intersperse (map (lambda (k)(conc k "_val")) keys) "/")))
	  (print "[" example-target "]")
	  (print "ANOTHERVAR only defined if target is " example-target))))

    ;; Now create a test and logpro file
    (print "You now have the basic common files for your megatest setup. Next run \"megatest -gentest\"\n"
	   "to create a test.\n\nThanks for using Megatest. You can edit your config files and create tests\n"
	   "in the " path " directory")))


;;======================================================================
;; create skeleton files for a test
;;======================================================================

(define (genexample:mk-megatest-test testname)
  ;; Gather needed data
  (let ((waiton   #f)
	(priority #f)
	(description #f)
	(steps    '())
	(scripts  '())
	(items    '())
	(rel-path #f))
    (print "We are going to generate a skeleton set of files for your test " testname " Note: do not worry "
	   "too much about typos, you can edit the files when you are done")

    (print "==================\nPlease describe this test. The description will be visible in various dialogs and reports")
    (display "Enter one line description for this test: ")
    (set! description (read-line))

    (print "==================\nDoes this test, " testname ", require any other test be run prior to launch?")
    (display (conc "Enter space delimited list of tests which " testname " must wait for: "))
    (set! waiton (read-line))

    (print "==================\nDo you wish to prioritize the running of this test over other tests? If so")
    (print "enter a number greater than zero here")
    (display "Enter a priority of 0 (default) or higher: ")
    (set! priority (read-line))

    ;; Get the steps
    (print "==================\nNow to enter the one or more steps that make up your test, note; you can add more later")
    (print "Hint; use .sh extension on the script names and we'll create placeholder scripts."

    (let ((stepname   #f)
	  (scriptname #f))
      (let loop ((done #f))
	(display "Enter the name for this step (blank to stop): ")
	(set! stepname (read-line))
	(if (not (equal? stepname ""))
	    (begin
	      (display "Enter the script or progam to run: ")
	      (set! scriptname (read-line))
	      (set! steps (append steps (list (list stepname scriptname))))))
	(if (not (equal? stepname ""))
	    (loop #f))))

    ;; Get the items
    (print "==================\nNext we need to get the variables and values you wish to iterate this test over (blank for none)")
    (let ((varname #f)
	  (values  #f))
      (let loop ((done #f))
	(display "Enter the variable name: ")
	(set! varname (read-line))
	(if (not (equal? varname ""))
	    (begin
	      (display (conc "Enter the space separated list of values for " varname ": "))
	      (set! values (read-line))
	      (set! items (append items (list (conc varname " " values))))))
	(if (not (equal? varname ""))
	    (loop #f))))

    ;; Now create the test
    (cond
     ((file-exists? "megatest.config")         (set! rel-path "./"))
     ((file-exists? "../megatest.config")      (set! rel-path "../"))
     ((file-exists? "../../megatest.config")   (set! rel-path "../../"))
     ((file-exists? "../../../megatest.config")(set! rel-path "../../../"))) ;; good enough dang it.
    (if (not rel-path)
	(begin
	  (print "ERROR: You must run this command in a megatest area under where the megatest.config file exists.")
	  (exit 1))
	(let ((testdir (conc rel-path "tests/" testname)))
	  (create-directory testdir #t)
	  (with-output-to-file (conc testdir "/testconfig")
	    (lambda ()
	      (print "# Add additional steps here. Format is \"stepname script\"\n[ezsteps]")
	      (map (lambda (stp)(print (string-intersperse stp " "))) steps)
	      (print "")
	      (print "# Test requirements are specified here\n[requirements]")
	      (print "waiton " waiton)
	      (print "priority " priority "\n")
	      (print "# Iteration for your tests are controlled by the items section\n[items]")
	      (map print items)
	      (print "")
	      (print "# test_meta is a section for storing additional data on your test\n[test_meta]")
	      (print "author " (get-environment-variable "USER"))
	      (print "owner  " (get-environment-variable "USER"))
	      (print "description " description)
	      (print "tags tagone,tagtwo")
	      (print "reviewed never")))
	  ;; Now create shell scripts (if extension is .sh) and logpro files
	  (for-each (lambda (stp)
		      (let ((stepname (car stp))
			    (script   (cadr stp)))
			(with-output-to-file (conc testdir "/" stepname ".logpro")
			  (lambda ()
			    (print genexample:example-logpro)))
			(with-output-to-file (conc testdir "/" script ".sh")
			  (lambda ()
			    (print genexample:example-script)))
			(system (conc "chmod ug+r " (conc testdir "/" script ".sh")))))
		    steps))))))
	  ;; 

Modified megatest.scm from [7edaf0bfca] to [4e1718db76].

17
18
19
20
21
22
23

24
25
26
27
28
29
30
(declare (uses common))
(declare (uses megatest-version))
(declare (uses margs))
(declare (uses runs))
(declare (uses launch))
(declare (uses server))
(declare (uses tests))


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

(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")








>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
(declare (uses common))
(declare (uses megatest-version))
(declare (uses margs))
(declare (uses runs))
(declare (uses launch))
(declare (uses server))
(declare (uses tests))
(declare (uses genexample))

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

(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106

107
108
109
110
111
112
113
114
115
116
117
118
  -set-values             : update or set values in the testdata table
  :category               : set the category field (optional)
  :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. %/%... 
                            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
  -env2file fname         : write the environment to fname.csh and fname.sh
  -setvars VAR1=val1,VAR2=val2 : Add environment variables to a run NB// these are
                                 overwritten by values set in config files.
  -server -|hostname      : start the server (reduces contention on megatest.db), use
                            - to automatically figure out hostname
  -repl                   : start a repl (useful for extending megatest)

Spreadsheet generation
  -extract-ods fname.ods  : extract an open document spreadsheet from the database
  -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%

Called as " (string-intersperse (argv) " ")))

;;  -gui                    : start a gui interface
;;  -config fname           : override the runconfig file with fname

;; process args







<







|


















|
|
>



|
|







72
73
74
75
76
77
78

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
  -set-values             : update or set values in the testdata table
  :category               : set the category field (optional)
  :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-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
  -env2file fname         : write the environment to fname.csh and fname.sh
  -setvars VAR1=val1,VAR2=val2 : Add environment variables to a run NB// these are
                                 overwritten by values set in config files.
  -server -|hostname      : start the server (reduces contention on megatest.db), use
                            - to automatically figure out hostname
  -repl                   : start a repl (useful for extending megatest)

Spreadsheet generation
  -extract-ods fname.ods  : extract an open document spreadsheet from the database
  -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
Getting started
  -gen-megatest-area      : create a skeleton megatest area. You will be prompted for paths
  -gen-megatest-test      : create a skeleton megatest test. You will be prompted for info

Examples

# 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

;; process args
152
153
154
155
156
157
158

159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

177
178
179
180
181
182
183

184
185
186
187
188
189
190
			"-server"
			"-extract-ods"
			"-pathmod"
			"-env2file"
			"-setvars"
			"-set-state-status"
			"-debug" ;; for *verbosity* > 2

			"-override-timeout"
			) 
		 (list  "-h"
		        "-force"
		        "-xterm"
		        "-showkeys"
		        "-test-status"
			"-set-values"
			"-load-test-data"
			"-summarize-items"
		        "-gui"
			;; misc
			"-archive"
			"-repl"
			"-lock"
			"-unlock"
			;; queries
			"-test-paths" ;; get path(s) to a test, ordered by youngest first


			"-runall"    ;; run all tests
			"-remove-runs"
			"-usequeue"
			"-rebuild-db"
			"-rollup"
			"-update-meta"


			"-v" ;; verbose 2, more than normal (normal is 1)
			"-q" ;; quiet 0, errors/warnings only
		       )
		 args:arg-hash
		 0))








>


















>







>







153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
			"-server"
			"-extract-ods"
			"-pathmod"
			"-env2file"
			"-setvars"
			"-set-state-status"
			"-debug" ;; for *verbosity* > 2
			"-gen-megatest-test"
			"-override-timeout"
			) 
		 (list  "-h"
		        "-force"
		        "-xterm"
		        "-showkeys"
		        "-test-status"
			"-set-values"
			"-load-test-data"
			"-summarize-items"
		        "-gui"
			;; misc
			"-archive"
			"-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"
			"-rollup"
			"-update-meta"
			"-gen-megatest-area"

			"-v" ;; verbose 2, more than normal (normal is 1)
			"-q" ;; quiet 0, errors/warnings only
		       )
		 args:arg-hash
		 0))

445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
		  (args:get-arg "-unlock")
		  user))))

;;======================================================================
;; Get paths to tests
;;======================================================================
;; Get test paths matching target, runname, testpatt, and itempatt
(if (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))
	       (test-name (assoc/default 'test-name cmdinfo))
	       (runscript (assoc/default 'runscript cmdinfo))







|







449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
		  (args:get-arg "-unlock")
		  user))))

;;======================================================================
;; Get paths to tests
;;======================================================================
;; Get test paths matching target, runname, testpatt, and itempatt
(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))
	       (test-name (assoc/default 'test-name cmdinfo))
	       (runscript (assoc/default 'runscript cmdinfo))
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
	  (change-directory testpath)
	  (if (not target)
	      (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")
		(exit 1)))
	  (set! db (open-db))    
	  (if (not (args:get-arg "-server"))
	      (server:client-setup db))
	  (let* ((itempatt (args:get-arg "-itempatt"))
		 (keys     (rdb:get-keys db))
		 (keynames (map key:get-fieldname keys))
		 (paths    (rdb:test-get-paths-matching db keynames target)))
	    (set! *didsomething* #t)
	    (for-each (lambda (path)
			(print path))
		      paths)))
	;; else do a general-run-call
	(general-run-call 
	 "-test-paths"
	 "Get paths to tests"
	 (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))
		       paths))))))








|














|
|







471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
	  (change-directory testpath)
	  (if (not target)
	      (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-path, exiting")
		(exit 1)))
	  (set! db (open-db))    
	  (if (not (args:get-arg "-server"))
	      (server:client-setup db))
	  (let* ((itempatt (args:get-arg "-itempatt"))
		 (keys     (rdb:get-keys db))
		 (keynames (map key:get-fieldname keys))
		 (paths    (rdb:test-get-paths-matching db keynames target)))
	    (set! *didsomething* #t)
	    (for-each (lambda (path)
			(print path))
		      paths)))
	;; else do a general-run-call
	(general-run-call 
	 "-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))
		       paths))))))

753
754
755
756
757
758
759










760
761
762
763
764
765
766
      (set! *didsomething* #t)))

(if (args:get-arg "-gui")
    (begin
      (debug:print 0 "Look at the dashboard for now")
      ;; (megatest-gui)
      (set! *didsomething* #t)))











;;======================================================================
;; Update the database schema on request
;;======================================================================

(if (args:get-arg "-rebuild-db")
    (begin







>
>
>
>
>
>
>
>
>
>







757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
      (set! *didsomething* #t)))

(if (args:get-arg "-gui")
    (begin
      (debug:print 0 "Look at the dashboard for now")
      ;; (megatest-gui)
      (set! *didsomething* #t)))

(if (args:get-arg "-gen-megatest-area")
    (begin
      (genexample:mk-megatest.config)
      (set! *didsomething* #t)))

(if (args:get-arg "-gen-megatest-test")
    (let ((testname (args:get-arg "-gen-megatest-test")))
      (genexample:mk-megatest-test testname)
      (set! *didsomething* #t)))

;;======================================================================
;; Update the database schema on request
;;======================================================================

(if (args:get-arg "-rebuild-db")
    (begin

Modified tests.scm from [e315223b61] to [ce4320f87b].

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
			   (not (null? tal)))
		      (loop (car tal)(cdr tal))
		      (if (null? results) #f
			  (car results))))))))))
    
;; get the previous records for when these tests were run where all keys match but runname
;; NB// Merge this with test:get-previous-test-run-records? This one looks for all matching tests
;; can use wildcards. 
(define (test:get-matching-previous-test-run-records db run-id test-name item-path)
  (let* ((keys    (db:get-keys db))
	 (selstr  (string-intersperse (map (lambda (x)(vector-ref x 0)) keys) ","))
	 (qrystr  (string-intersperse (map (lambda (x)(conc (vector-ref x 0) "=?")) keys) " AND "))
	 (keyvals #f)
	 (tests-hash (make-hash-table)))
    ;; first look up the key values from the run selected by run-id







|







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
			   (not (null? tal)))
		      (loop (car tal)(cdr tal))
		      (if (null? results) #f
			  (car results))))))))))
    
;; get the previous records for when these tests were run where all keys match but runname
;; NB// Merge this with test:get-previous-test-run-records? This one looks for all matching tests
;; can use wildcards. Also can likely be factored in with get test paths?
(define (test:get-matching-previous-test-run-records db run-id test-name item-path)
  (let* ((keys    (db:get-keys db))
	 (selstr  (string-intersperse (map (lambda (x)(vector-ref x 0)) keys) ","))
	 (qrystr  (string-intersperse (map (lambda (x)(conc (vector-ref x 0) "=?")) keys) " AND "))
	 (keyvals #f)
	 (tests-hash (make-hash-table)))
    ;; first look up the key values from the run selected by run-id

Modified tests/Makefile from [13b200064d] to [02211f7dd5].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# run some tests

BINPATH=$(shell realpath ../bin)
MEGATEST=$(BINPATH)/megatest
PATH := $(BINPATH):$(PATH)
RUNNAME := $(shell date +w%V.%u.%H.%M)
IPADDR := "-"
# Set SERVER to "-server -"
SERVER := 

runall : test1 test2

test1 : cleanprep
	$(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

test3 : cleanprep
	$(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

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 &
	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 &

remove :
	(cd ../;make);$(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













|


|


|


|
|
|
|
|
|





|
|









|


|





|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# run some tests

BINPATH=$(shell realpath ../bin)
MEGATEST=$(BINPATH)/megatest
PATH := $(BINPATH):$(PATH)
RUNNAME := $(shell date +w%V.%u.%H.%M)
IPADDR := "-"
# Set SERVER to "-server -"
SERVER := 

runall : test1 test2

test1 : cleanprep
	cd fullrun;$(MEGATEST) -runtests ez_pass -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_a $(SERVER)

test2 : cleanprep
	cd fullrun;$(MEGATEST) -runtests runfirst -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b  $(SERVER) -debug 10

test3 : cleanprep
	cd fullrun;$(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b -m "This is a comment specific to a run" -v $(SERVER)

test4 : cleanprep
	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
	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
	cd fullrun;$(BINPATH)/dboard &

remove :
	(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`;(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 version [bf3b671e75].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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/common_runconfigs.config version [bf3b671e75].



































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 version [507b18874c].





















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
[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 version [bc079a5fba].

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
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 version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [475b97c77b].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [c5651ffc6c].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [b41a76aacb].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [fc174ee7f2].































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 version [d90c6719c8].







































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 version [55e83172e9].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [e50a47bd5d].

























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;; (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 version [1d9c0ef873].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [961ab4aef4].













>
>
>
>
>
>
1
2
3
4
5
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 version [39388ec16f].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [1d9c0ef873].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [e978ba6f87].





































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 version [be9f816262].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [e50a47bd5d].

























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;; (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 version [1d9c0ef873].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [13eb33bb90].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [b2a6575abf].























>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
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 version [5323023529].

























>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
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 version [bb1f94c96f].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [b8aaccbe35].















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 version [475b97c77b].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [c43fd19ef0].













































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 version [475b97c77b].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [312a36066e].

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
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 version [e006dc1513].

























>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
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 version [5aae106e5b].



>
1
category, variable, expected,   value,  tol,   units,  comment

Added tests/fullrun/tests/manual_example/runsetupxterm.sh version [de48b1c9d6].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [4f3f90bb14].

























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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 version [a183e20093].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [88f71844f4].









>
>
>
>
1
2
3
4
[setup]
runscript idontexist


Added tests/fullrun/tests/priority_1/main.sh version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [a4d944cb23].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [393387936a].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [b7686d9e51].





























>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
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 version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [62b7ebcc8f].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [3693d6b2ed].





























>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
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 version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [331e061c45].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [ef11eb1493].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [b12d3ed5db].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [3208e34990].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [cce675c747].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [0536bc3eb1].





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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 version [b41a76aacb].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [e4be557feb].































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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 version [f0b52bc3c6].

















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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 version [1c532ab9c9].































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 version [e63ffb76fa].



















>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
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 version [e1b002dc2e].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
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 version [1c532ab9c9].































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 version [54d3e4ef49].



















>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
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 version [2527ed7627].





























>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
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 version [1c532ab9c9].































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 version [a573e1a656].











































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /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 version [a64305aaab].























>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
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 version [e1b639c562].







>
>
>
1
2
3
#!/usr/bin/env bash

! grep ALT_VAR megatest.sh

Added tests/fullrun/tests/test_mt_vars/bogousnotset.sh version [25167b86d9].







>
>
>
1
2
3
#!/usr/bin/env bash

! grep BOGOUS megatest.sh

Added tests/fullrun/tests/test_mt_vars/currentisblah.sh version [38498b5b33].







>
>
>
1
2
3
#!/usr/bin/env bash

grep CURRENT megatest.sh | grep /tmp/nada

Added tests/fullrun/tests/test_mt_vars/testconfig version [601765abe8].

























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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 version [1f4eabb06d].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
[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 version [bc079a5fba].

1
2
3
4
5
6
7
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/simplerun/megatest.config version [12e33187ca].















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[fields]
SYSTEM TEXT
RELEASE TEXT

[setup]
# Adjust max_concurrent_jobs to limit how much you load your machines
max_concurrent_jobs 50

# This is your link path, you can move it but it is generally better to keep it stable
linktree ../simplelinks

# Job tools are more advanced ways to control how your jobs are launched
[jobtools]
useshell yes
launcher nbfind

# You can override environment variables for all your tests here
[env-override]
EXAMPLE_VAR example value

# As you run more tests you may need to add additional disks, the names are arbitrary but must be unique
[disks]
disk0 ../simpleruns

Added tests/simplerun/runconfigs.config version [346ed47154].













>
>
>
>
>
>
1
2
3
4
5
6
[default]
ALLTESTS see this variable

# Your variables here are grouped by targets [SYSTEM/RELEASE]
[SYSTEM_val/RELEASE_val]
ANOTHERVAR only defined if target is SYSTEM_val/RELEASE_val

Added tests/simplerun/tests/test1/testconfig version [9ddcfab86d].











































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Add additional steps here. Format is "stepname script"
[ezsteps]
step1 step1.sh
step2 step2.sh

# Test requirements are specified here
[requirements]
waiton setup
priority 0

# Iteration for your tests are controlled by the items section
[items]
PARTOFDAY morning noon afternoon evening night

# test_meta is a section for storing additional data on your test
[test_meta]
author matt
owner  matt
description An example test
tags tagone,tagtwo
reviewed never

Added tests/simplerun/tests/test2/step1.logpro version [22f12ee837].

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
;; You should have at least one expect:required. This ensures that your process ran
(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/)

;; You may need ignores to suppress false error or warning hits from the later expects
;; NOTE: Order is important here!
(expect:ignore   in "LogFileBody"  < 99 "Ignore the word error in comments" #/^\/\/.*error/)
(expect:warning  in "LogFileBody"  = 0 "Any warning" #/warn/)
(expect:error    in "LogFileBody"  = 0 "Any error"  (list #/ERROR/ #/error/)) ;; but disallow any other errors

Added tests/simplerun/tests/test2/step1.sh.sh version [67f9a133dc].







>
>
>
1
2
3
#!/usr/bin/env bash

# Run your step here

Added tests/simplerun/tests/test2/step2.logpro version [22f12ee837].

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
;; You should have at least one expect:required. This ensures that your process ran
(expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/)

;; You may need ignores to suppress false error or warning hits from the later expects
;; NOTE: Order is important here!
(expect:ignore   in "LogFileBody"  < 99 "Ignore the word error in comments" #/^\/\/.*error/)
(expect:warning  in "LogFileBody"  = 0 "Any warning" #/warn/)
(expect:error    in "LogFileBody"  = 0 "Any error"  (list #/ERROR/ #/error/)) ;; but disallow any other errors

Added tests/simplerun/tests/test2/step2.sh.sh version [67f9a133dc].







>
>
>
1
2
3
#!/usr/bin/env bash

# Run your step here

Added tests/simplerun/tests/test2/testconfig version [704f9b3ec4].











































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Add additional steps here. Format is "stepname script"
[ezsteps]
step1 step1.sh
step2 step2.sh

# Test requirements are specified here
[requirements]
waiton test1
priority 0

# Iteration for your tests are controlled by the items section
[items]
LANDTYPE desert plains forest jungle beach

# test_meta is a section for storing additional data on your test
[test_meta]
author matt
owner  matt
description Yet another example test
tags tagone,tagtwo
reviewed never

Deleted tests/tests/exit_0/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/exit_0/testconfig version [475b97c77b].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/exit_1/main.sh version [c5651ffc6c].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/exit_1/testconfig version [b41a76aacb].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/ez_exit2_fail/testconfig version [fc174ee7f2].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























Deleted tests/tests/ez_fail/testconfig version [d90c6719c8].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






































Deleted tests/tests/ez_pass/testconfig version [55e83172e9].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/ezlog_fail/example.logpro version [e50a47bd5d].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;; (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 version [1d9c0ef873].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/ezlog_fail/lookittmp.logpro version [961ab4aef4].

1
2
3
4
5
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
<
<
<
<
<
<












Deleted tests/tests/ezlog_fail/testconfig version [39388ec16f].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/ezlog_fail_then_pass/firststep.logpro version [1d9c0ef873].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/ezlog_fail_then_pass/main.sh version [e978ba6f87].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































Deleted tests/tests/ezlog_fail_then_pass/testconfig version [be9f816262].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/ezlog_pass/example.logpro version [e50a47bd5d].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;; (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 version [1d9c0ef873].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/ezlog_pass/testconfig version [13eb33bb90].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/ezlog_warn/lookithome.logpro version [b2a6575abf].

1
2
3
4
5
6
7
8
9
10
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
<
<
<
<
<
<
<
<
<
<
<






















Deleted tests/tests/ezlog_warn/lookittmp.logpro version [5323023529].

1
2
3
4
5
6
7
8
9
10
11
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
<
<
<
<
<
<
<
<
<
<
<
<
























Deleted tests/tests/ezlog_warn/testconfig version [bb1f94c96f].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/lineitem_fail/main.sh version [b8aaccbe35].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































Deleted tests/tests/lineitem_fail/testconfig version [475b97c77b].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/lineitem_pass/main.sh version [c43fd19ef0].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































Deleted tests/tests/lineitem_pass/testconfig version [475b97c77b].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/logpro_required_fail/lookittmp.logpro version [312a36066e].

1
2
3
4
5
6
7
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
<
<
<
<
<
<
<
<
















Deleted tests/tests/logpro_required_fail/testconfig version [e006dc1513].

1
2
3
4
5
6
7
8
9
10
11
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
<
<
<
<
<
<
<
<
<
<
<
<
























Deleted tests/tests/manual_example/results/results.csv version [5aae106e5b].

1
category, variable, expected,   value,  tol,   units,  comment
<


Deleted tests/tests/manual_example/runsetupxterm.sh version [de48b1c9d6].

1
2
3
4
5
6
7
8
9
10
11
12
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

<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/manual_example/setupremote.sh version [4f3f90bb14].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































Deleted tests/tests/manual_example/testconfig version [a183e20093].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/neverrun/testconfig version [88f71844f4].

1
2
3
4
[setup]
runscript idontexist


<
<
<
<








Deleted tests/tests/priority_1/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/priority_1/testconfig version [a4d944cb23].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/priority_10/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/priority_10/testconfig version [393387936a].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/priority_10_waiton_1/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/priority_10_waiton_1/testconfig version [b7686d9e51].

1
2
3
4
5
6
7
8
9
10
11
12
13
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
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























Deleted tests/tests/priority_2/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/priority_2/testconfig version [62b7ebcc8f].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/priority_3/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/priority_3/testconfig version [3693d6b2ed].

1
2
3
4
5
6
7
8
9
10
11
12
13
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
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























Deleted tests/tests/priority_4/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/priority_4/testconfig version [331e061c45].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/priority_5/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/priority_5/testconfig version [ef11eb1493].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/priority_6/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/priority_6/testconfig version [b12d3ed5db].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/priority_7/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/priority_7/testconfig version [3208e34990].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/priority_8/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/priority_8/testconfig version [cce675c747].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/priority_9/main.sh version [0536bc3eb1].

1
2
3
4
5
6
7
8
9
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
<
<
<
<
<
<
<
<
<
<




















Deleted tests/tests/priority_9/testconfig version [b41a76aacb].

1
2
3
4
5
6
7
8
9
10
11
12
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
<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/runfirst/main.sh version [e4be557feb].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































Deleted tests/tests/runfirst/testconfig version [f0b52bc3c6].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































Deleted tests/tests/runfirst/wasting_time.logpro version [1c532ab9c9].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)))

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























Deleted tests/tests/singletest/main.sh version [e63ffb76fa].

1
2
3
4
5
6
7
8
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"
<
<
<
<
<
<
<
<
<


















Deleted tests/tests/singletest/testconfig version [e1b002dc2e].

1
2
3
4
5
6
7
8
9
10
11
12
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.

<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted tests/tests/singletest/wasting_time.logpro version [1c532ab9c9].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)))

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























Deleted tests/tests/singletest2/main.sh version [54d3e4ef49].

1
2
3
4
5
6
7
8
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"
<
<
<
<
<
<
<
<
<


















Deleted tests/tests/singletest2/testconfig version [2527ed7627].

1
2
3
4
5
6
7
8
9
10
11
12
13
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.

<
<
<
<
<
<
<
<
<
<
<
<
<
<




























Deleted tests/tests/singletest2/wasting_time.logpro version [1c532ab9c9].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)))

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























Deleted tests/tests/sqlitespeed/runscript.rb version [4107e1724c].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /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 version [a64305aaab].

1
2
3
4
5
6
7
8
9
10
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  

<
<
<
<
<
<
<
<
<
<
<






















Deleted tests/tests/test_mt_vars/altvarnotset.sh version [e1b639c562].

1
2
3
#!/usr/bin/env bash

! grep ALT_VAR megatest.sh
<
<
<






Deleted tests/tests/test_mt_vars/bogousnotset.sh version [25167b86d9].

1
2
3
#!/usr/bin/env bash

! grep BOGOUS megatest.sh
<
<
<






Deleted tests/tests/test_mt_vars/currentisblah.sh version [38498b5b33].

1
2
3
#!/usr/bin/env bash

grep CURRENT megatest.sh | grep /tmp/nada
<
<
<






Deleted tests/tests/test_mt_vars/testconfig version [601765abe8].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<