Megatest

Check-in [82c92c7c77]
Login
Overview
Comment:Updated tests to push on simultaneous running
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 82c92c7c770a9c75e86428fd9091c542c593d544
User & Date: matt on 2012-02-26 19:44:53
Other Links: manifest | tags
Context
2012-02-26
21:35
Tweaked some queries to increase the amount of interleaving possible check-in: 5d93144663 user: matt tags: trunk
19:44
Updated tests to push on simultaneous running check-in: 82c92c7c77 user: matt tags: trunk
19:01
Improved effiency of polling for data by dashboard check-in: 804e3438ad user: matt tags: trunk
Changes

Modified dashboard-tests.scm from [c62871416c] to [4961c0ebfe].

245
246
247
248
249
250
251
252




253
254
255
256
257
258
259
	       btns))))))


;;======================================================================
;;
;;======================================================================
(define (examine-test db test-id) ;; run-id run-key origtest)
  (let* ((testdat       (rdb:get-test-data-by-id db test-id)))




    (if (not testdat)
	(begin
	  (debug:print 0 "ERROR: No test data found for test " test-id ", exiting")
	  (exit 1))
	(let* ((run-id        (if testdat (db:test-get-run_id testdat) #f))
	       (keydat        (if testdat (rdb:get-key-val-pairs db run-id) #f))
	       (rundat        (if testdat (rdb:get-run-info db run-id) #f))







|
>
>
>
>







245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
	       btns))))))


;;======================================================================
;;
;;======================================================================
(define (examine-test db test-id) ;; run-id run-key origtest)
  (let* ((testdat       (rdb:get-test-data-by-id db test-id))
	 (db-path       (conc *toppath* "/megatest.db"))
	 (db-mod-time   (file-modification-time db-path))
	 (last-update   (current-seconds))
	 (request-update #f))
    (if (not testdat)
	(begin
	  (debug:print 0 "ERROR: No test data found for test " test-id ", exiting")
	  (exit 1))
	(let* ((run-id        (if testdat (db:test-get-run_id testdat) #f))
	       (keydat        (if testdat (rdb:get-key-val-pairs db run-id) #f))
	       (rundat        (if testdat (rdb:get-run-info db run-id) #f))
287
288
289
290
291
292
293




294

295
296
297
298
299
300
301
302
303
304
305

306
307
308
309
310
311
312
313
				 (let ((shell (if (get-environment-variable "SHELL") 
						  (conc "-e " (get-environment-variable "SHELL"))
						  "")))
				   (system (conc "cd " rundir 
						 ";xterm -T \"" (string-translate testfullname "()" "  ") "\" " shell "&")))
				 (message-window  (conc "Directory " rundir " not found")))))
	       (refreshdat (lambda ()




			     (let ((newtestdat (rdb:get-test-data-by-id db test-id)))

			       (if newtestdat 
				   (begin
					;(mutex-lock! mx1)
				     (set! testdat newtestdat)
				     (set! teststeps    (rdb:get-steps-for-test db test-id))
				     (set! logfile      (conc (db:test-get-rundir testdat) "/" (db:test-get-final_logf testdat)))
				     (set! rundir       (db:test-get-rundir testdat))
				     (set! testfullname (db:test-get-fullname testdat))
					;(mutex-unlock! mx1)
				     )
				   (begin

				     (db:test-set-testname! testdat "DEAD OR DELETED TEST"))))))
	       (widgets      (make-hash-table))
	       (meta-widgets (make-hash-table))
	       (self         #f)
	       (store-label  (lambda (name lbl cmd)
			       (hash-table-set! widgets name 
						(lambda (testdat)
						  (let ((newval (cmd testdat))







>
>
>
>
|
>
|
<
<
|
|
|
|
|
<
<
<
>
|







291
292
293
294
295
296
297
298
299
300
301
302
303
304


305
306
307
308
309



310
311
312
313
314
315
316
317
318
				 (let ((shell (if (get-environment-variable "SHELL") 
						  (conc "-e " (get-environment-variable "SHELL"))
						  "")))
				   (system (conc "cd " rundir 
						 ";xterm -T \"" (string-translate testfullname "()" "  ") "\" " shell "&")))
				 (message-window  (conc "Directory " rundir " not found")))))
	       (refreshdat (lambda ()
			     (let* ((curr-mod-time (file-modification-time db-path))
				    (need-update   (or (and (> curr-mod-time db-mod-time)
							    (> (current-seconds) (+ last-update 2))) ;; every two seconds if db touched
						       request-update))
				    (newtestdat (if need-update (rdb:get-test-data-by-id db test-id))))
			       (cond
				((and need-update newtestdat)


				 (set! testdat newtestdat)
				 (set! teststeps    (rdb:get-steps-for-test db test-id))
				 (set! logfile      (conc (db:test-get-rundir testdat) "/" (db:test-get-final_logf testdat)))
				 (set! rundir       (db:test-get-rundir testdat))
				 (set! testfullname (db:test-get-fullname testdat)))



				(need-update ;; if this was true and yet there is no data ....
				 (db:test-set-testname! testdat "DEAD OR DELETED TEST"))))))
	       (widgets      (make-hash-table))
	       (meta-widgets (make-hash-table))
	       (self         #f)
	       (store-label  (lambda (name lbl cmd)
			       (hash-table-set! widgets name 
						(lambda (testdat)
						  (let ((newval (cmd testdat))

Modified tests/megatest.config from [ca2c047d9a] to [729204831f].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[fields]
sysname TEXT
fsname TEXT
datapath TEXT

[setup]
# exectutable /path/to/megatest
max_concurrent_jobs 50
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







|







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

Modified tests/tests/exit_0/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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

Modified tests/tests/exit_1/main.sh from [20482da49e] to [c5651ffc6c].

1







2
3
#!/bin/bash








exit 1

>
>
>
>
>
>
>


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

Modified tests/tests/ezlog_fail_then_pass/main.sh from [fd6c1c1d59] to [e978ba6f87].

1
2
3
4
5
6
7
8
9







10
11
#!/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








megatest -test-status :state COMPLETED :status AUTO









>
>
>
>
>
>
>


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

Modified tests/tests/lineitem_fail/main.sh from [04d243acb5] to [b8aaccbe35].

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







13
14
15
16
#!/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








# Needed to force rolling up the results and set the test to COMPLETED
$MT_MEGATEST -test-status :state COMPLETED :status AUTO













>
>
>
>
>
>
>




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

Modified tests/tests/priority_1/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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

Modified tests/tests/priority_10/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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

Modified tests/tests/priority_10_waiton_1/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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

Modified tests/tests/priority_2/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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

Modified tests/tests/priority_3/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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

Modified tests/tests/priority_4/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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

Modified tests/tests/priority_5/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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

Modified tests/tests/priority_6/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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

Modified tests/tests/priority_7/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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

Modified tests/tests/priority_8/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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

Modified tests/tests/priority_9/main.sh from [aa59fff554] to [0536bc3eb1].

1







2
3
#!/bin/bash








exit 0

>
>
>
>
>
>
>


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