@@ -17,21 +17,21 @@ (set! *configinfo* (find-and-read-config (if (args:get-arg "-config")(args:get-arg "-config") "megatest.config"))) (set! *configdat* (if (car *configinfo*)(car *configinfo*) #f)) (set! *toppath* (if (car *configinfo*)(cadr *configinfo*) #f)) (if *toppath* (setenv "MT_RUN_AREA_HOME" *toppath*) ;; to be deprecated - (print "ERROR: failed to find the top path to your run setup.")) + (debug:print 0 "ERROR: failed to find the top path to your run setup.")) *toppath*) (define (setup-env-defaults db fname run-id . already-seen) (let* ((keys (get-keys db)) (keyvals (get-key-vals db run-id)) (thekey (string-intersperse (map (lambda (x)(if x x "-na-")) keyvals) "/")) (confdat (read-config fname)) (whatfound (make-hash-table)) (sections (list "default" thekey))) - ;; (print "Using key=\"" thekey "\"") + (debug:print 4 "Using key=\"" thekey "\"") (for-each (lambda (section) (let ((section-dat (hash-table-ref/default confdat section #f))) (if section-dat (for-each @@ -41,15 +41,15 @@ (map car section-dat))))) sections) (if (and (not (null? already-seen)) (not (car already-seen))) (begin - (print "Key settings found in runconfig.config:") + (debug:print 2 "Key settings found in runconfig.config:") (for-each (lambda (fullkey) - (format #t "~20a ~a\n" fullkey (hash-table-ref/default whatfound fullkey 0))) + (debug:print 2 (format #f "~20a ~a\n" fullkey (hash-table-ref/default whatfound fullkey 0)))) sections) - (print "---") + (debug:print 2 "---") (set! *already-seen-runconfig-info* #t))))) (define (get-best-disk confdat) (let* ((disks (hash-table-ref/default confdat "disks" #f)) (best #f) @@ -59,11 +59,11 @@ (lambda (disk-num) (let* ((dirpath (cadr (assoc disk-num disks))) (freespc (if (directory? dirpath) (get-df dirpath) (begin - (print "WARNING: path " dirpath " in [disks] section not valid") + (debug:print 0 "WARNING: path " dirpath " in [disks] section not valid") 0)))) (if (> freespc bestsize) (begin (set! best dirpath) (set! bestsize freespc))))) @@ -87,14 +87,14 @@ "/" key-str "/" runname item-path))) ;; since this is an iterated test this is as good a place as any to ;; update the toptest record with its location rundir (if (not (equal? item-path "")) (db:test-set-rundir! db run-id testname "" toptest-path)) - (print "Setting up test run area") - (print " - creating run area in " dfullp) + (debug:print 2 "Setting up test run area") + (debug:print 2 " - creating run area in " dfullp) (system (conc "mkdir -p " dfullp)) - (print " - creating link from " dfullp "/" testname " to " lnkpath) + (debug:print 2 " - creating link from " dfullp "/" testname " to " lnkpath) (system (conc "mkdir -p " lnkpath)) (if (file-exists? (conc lnkpath "/" testname)) (system (conc "rm -f " lnkpath "/" testname))) (system (conc "ln -sf " dfullp " " lnkpath "/" testname)) (if (directory? dfullp) @@ -136,11 +136,11 @@ (let ((dat (create-work-area db run-id test-path diskpath test-name itemdat))) (set! work-area (car dat)) (set! toptest-work-area (cadr dat))) (begin (set! work-area test-path) - (print "WARNING: No disk work area specified - running in the test directory"))) + (debug:print 0 "WARNING: No disk work area specified - running in the test directory"))) (set! cmdparms (base64:base64-encode (with-output-to-string (lambda () ;; (list 'hosts hosts) (write (list (list 'testpath test-path) (list 'work-area work-area) (list 'test-name test-name) @@ -160,11 +160,11 @@ (launcher (set! fullcmd (append launcher (list remote-megatest "-execute" cmdparms)))) (else (set! fullcmd (list remote-megatest "-execute" cmdparms)))) (if (args:get-arg "-xterm")(set! fullcmd (append fullcmd (list "-xterm")))) - (print "Launching megatest for test " test-name " in " work-area" ...") + (debug:print 1 "Launching megatest for test " test-name " in " work-area" ...") (test-set-status! db run-id test-name "LAUNCHED" "n/a" itemdat) ;; (if launch-results launch-results "FAILED")) ;; set ;; set pre-launch-env-vars before launching, keep the vars in prevvals and put the envionment back when done (let* ((commonprevvals (alist->env-vars (hash-table-ref/default *configdat* "env-override" '()))) @@ -177,10 +177,10 @@ itemdat))) (launch-results (apply cmd-run-proc-each-line (car fullcmd) print (cdr fullcmd)))) ;; launcher fullcmd)));; (apply cmd-run-proc-each-line launcher print fullcmd))) ;; (cmd-run->list fullcmd)) - (print "Launching completed, updating db") + (debug:print 2 "Launching completed, updating db") (alist->env-vars miscprevvals) (alist->env-vars testprevvals) (alist->env-vars commonprevvals))))