Megatest

Check-in [5f9c37278f]
Login
Overview
Comment:updated megatest version to 1.8015
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.80
Files: files | file ages | folders
SHA1: 5f9c37278f9b137b5cbf4614a6206f66a943076a
User & Date: mmgraham on 2023-07-19 22:44:53
Other Links: branch diff | manifest | tags
Context
2023-07-21
18:45
added code to remove logs/server and .servinfo files when stop-the-train is found check-in: de8d1d67ff user: mmgraham tags: v1.80, v1.8015
2023-07-19
22:44
updated megatest version to 1.8015 check-in: 5f9c37278f user: mmgraham tags: v1.80
2023-07-18
15:44
fix for multidb pgdb sync check-in: 2049d41c44 user: pjhatwal tags: v1.80
Changes

Modified megatest-version.scm from [74f4850897] to [e58c3f925a].

16
17
18
19
20
21
22
23
;;     along with Megatest.  If not, see <http://www.gnu.org/licenses/>.

;; Always use two or four digit decimal
;; 1.01, 1.02...1.10,1.11,1.1101 ... 1.99,2.00..

;; (declare (unit megatest-version))

(define megatest-version 1.8014)







|
16
17
18
19
20
21
22
23
;;     along with Megatest.  If not, see <http://www.gnu.org/licenses/>.

;; Always use two or four digit decimal
;; 1.01, 1.02...1.10,1.11,1.1101 ... 1.99,2.00..

;; (declare (unit megatest-version))

(define megatest-version 1.8015)

Modified mtut.scm from [81482bb7a2] to [156220c91d].

1407
1408
1409
1410
1411
1412
1413
1414

1415
1416
1417
1418
1419
1420
1421
	    (set! ret #f))
	(if (string-contains cmd "-modepatt")
	    (if (check-if-modepatt-defined pkta notification-hook pktfile)
		(print "Modepatt is valid")
		(set! ret #f)))) 
    ret))

   

;; collect all needed data and create run pkts for contours with changed inputs
;;
(define (dispatch-commands mtconf toppath)
  ;; we are expecting a directory "logs", check and create it, create the log in /tmp if not able to create logs dir
  (let ((logdir
	 (if (if (not (directory? "logs"))
		 (handle-exceptions







|
>







1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
	    (set! ret #f))
	(if (string-contains cmd "-modepatt")
	    (if (check-if-modepatt-defined pkta notification-hook pktfile)
		(print "Modepatt is valid")
		(set! ret #f)))) 
    ret))



;; collect all needed data and create run pkts for contours with changed inputs
;;
(define (dispatch-commands mtconf toppath)
  ;; we are expecting a directory "logs", check and create it, create the log in /tmp if not able to create logs dir
  (let ((logdir
	 (if (if (not (directory? "logs"))
		 (handle-exceptions
1439
1440
1441
1442
1443
1444
1445

1446
1447
1448
1449
1450
1451
1452
       (let* ((rgconfdat (find-and-read-config (conc toppath "/runconfigs.config")))
	      (rgconf    (car rgconfdat))
	      (areas     (configf:get-section mtconf "areas"))
	      (contours  (configf:get-section mtconf "contours"))
	      (pkts      (find-pkts pdb '(cmd) '()))
	      (torun     (make-hash-table)) ;; target => ( ... info ... )
	      (rgentargs (hash-table-keys rgconf))) ;; these are the targets registered for automatically triggering

         (sqlite3:set-busy-handler! (dbi:db-conn pdb) (sqlite3:make-busy-timeout 10000))
	 (for-each
	  (lambda (pktdat)
	    (let* ((pkta    (alist-ref 'apkt pktdat))
		   (action  (alist-ref 'A pkta))
		   (cmdline (pkt->cmdline pkta))
		   (uuid    (alist-ref 'Z pkta))







>







1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
       (let* ((rgconfdat (find-and-read-config (conc toppath "/runconfigs.config")))
	      (rgconf    (car rgconfdat))
	      (areas     (configf:get-section mtconf "areas"))
	      (contours  (configf:get-section mtconf "contours"))
	      (pkts      (find-pkts pdb '(cmd) '()))
	      (torun     (make-hash-table)) ;; target => ( ... info ... )
	      (rgentargs (hash-table-keys rgconf))) ;; these are the targets registered for automatically triggering
         (debug:print 0 *default-log-port* "dispatch-commands: number of pkts = " (length pkts))
         (sqlite3:set-busy-handler! (dbi:db-conn pdb) (sqlite3:make-busy-timeout 10000))
	 (for-each
	  (lambda (pktdat)
	    (let* ((pkta    (alist-ref 'apkt pktdat))
		   (action  (alist-ref 'A pkta))
		   (cmdline (pkt->cmdline pkta))
		   (uuid    (alist-ref 'Z pkta))
1466
1467
1468
1469
1470
1471
1472


1473

1474
1475
1476
1477
1478
1479
1480
			      (system notification-cmd))))
		      (begin
			;; if modepatt used chek if it is defined for the target. If -reqtarg check if target exist.
			(if (validate-cmd fullcmd pkta notification-hook pktfile)
			    (begin
			      (print "RUNNING: " fullcmd)
			      (system fullcmd) ;; replace with process ...


			      (mark-processed pdb (list (alist-ref 'id pktdat)))

			      (let-values (((ack-uuid ack-pkt)
					    (add-z-card
					     (construct-sdat 'P uuid
							     'T (case (string->symbol action)
								  ((run) "runstart")
								  ((sync) "syncstart")    ;; example of translating run -> runstart
								  (else   action))







>
>

>







1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
			      (system notification-cmd))))
		      (begin
			;; if modepatt used chek if it is defined for the target. If -reqtarg check if target exist.
			(if (validate-cmd fullcmd pkta notification-hook pktfile)
			    (begin
			      (print "RUNNING: " fullcmd)
			      (system fullcmd) ;; replace with process ...
                              (debug:print 0 *default-log-port* "doing mark-processed. pktsdir: " pktsdir)
                              (debug:print 0 *default-log-port* "fullcmd: " fullcmd)
			      (mark-processed pdb (list (alist-ref 'id pktdat)))
                              (thread-sleep! 100)
			      (let-values (((ack-uuid ack-pkt)
					    (add-z-card
					     (construct-sdat 'P uuid
							     'T (case (string->symbol action)
								  ((run) "runstart")
								  ((sync) "syncstart")    ;; example of translating run -> runstart
								  (else   action))