Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -2339,11 +2339,13 @@ (parent . P))))) (define (common:get-pkts-dirs mtconf use-lt) (let* ((pktsdirs-str (or (configf:lookup mtconf "setup" "pktsdirs") (and use-lt - (conc *toppath* "/lt/.pkts")))) + (conc (or *toppath* + (current-directory)) + "/lt/.pkts")))) (pktsdirs (if pktsdirs-str (string-split pktsdirs-str " ") #f))) pktsdirs)) @@ -2381,11 +2383,11 @@ (let* ((pdb (open-queue-db pdbpath "pkts.db" schema: '("CREATE TABLE groups (id INTEGER PRIMARY KEY,groupname TEXT, CONSTRAINT group_constraint UNIQUE (groupname));")))) (proc pktsdirs pktsdir pdb) (dbi:close pdb))))) -(define (common:load-pkts-to-db mtconf) +(define (common:load-pkts-to-db mtconf #!key (use-lt #f)) (common:with-queue-db mtconf (lambda (pktsdirs pktsdir pdb) (for-each (lambda (pktsdir) ;; look at all @@ -2406,11 +2408,12 @@ (add-to-queue pdb pktdat uuid (or ptype 'cmd) #f 0) (debug:print 4 *default-log-port* "Added " uuid " of type " ptype " to queue")) (debug:print 4 *default-log-port* "pkt: " uuid " exists, skipping...") ))) pkts)))) - pktsdirs)))) + pktsdirs)) + use-lt: use-lt)) (define (common:get-pkt-alists pkts) (map (lambda (x) (alist-ref 'apkt x)) ;; 'pkta pulls out the alist from the read pkt pkts)) Index: mtut.scm ================================================================== --- mtut.scm +++ mtut.scm @@ -114,10 +114,11 @@ set-ss : set state/status archive : compress and move test data to archive disk kill : stop tests or entire runs db : database utilities areas, contours, setup : show areas, contours or setup section from megatest.config + gendot : generate a graphviz dot file from pkts. Contour actions: process : runs import, rungen and dispatch Selectors @@ -996,14 +997,16 @@ (print "No section \"" (car remargs) "\" found"))) (print "ERROR: list requires section parameter; areas, setup or contours"))) ((gendot) (let* ((mtconfdat (simple-setup (args:get-arg "-start-dir"))) (mtconf (car mtconfdat))) - (with-queue-db + (common:load-pkts-to-db mtconf use-lt: #t) ;; need to NOT do this by default ... + (common:with-queue-db mtconf (lambda (pktsdirs pktsdir conn) - (make-report "out.dot" conn '()))))) + (make-report "out.dot" conn common:pkts-spec '(action ipaddr port) )) + use-lt: #t))) ((db) (if (null? remargs) (print "ERROR: missing sub command for db command") (let ((subcmd (car remargs))) (case (string->symbol subcmd) @@ -1043,8 +1046,8 @@ (repl) (load (args:get-arg "-load"))))) #| (define mtconf (car (simple-setup #f))) -(define dat (with-queue-db mtconf (lambda (conn)(get-pkts conn '())))) +(define dat (common:with-queue-db mtconf (lambda (conn)(get-pkts conn '())))) (pp (pkts#flatten-all dat '((cmd . ((parent . P)(url . M)))(runtype . ((parent . P)))) 'id 'group-id 'uuid 'parent 'pkt-type 'pkt 'processed)) |#