@@ -91,10 +91,12 @@ -test-paths : get the test paths matching target, runname, item and test patterns. -list-disks : list the disks available for storing runs -list-targets : list the targets in runconfigs.config -list-db-targets : list the target combinations used in the db + -show-config : dump the internal representation of the megatest.config file + -show-runconfig : dump the internal representation of the runconfigs.config file 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 @@ -196,10 +198,11 @@ ;; mist queries "-list-disks" "-list-targets" "-list-db-targets" "-show-runconfig" + "-show-config" ;; queries "-test-paths" ;; get path(s) to a test, ordered by youngest first "-runall" ;; run all tests "-remove-runs" @@ -335,12 +338,19 @@ targets) (set! *didsomething* #t))) (if (args:get-arg "-show-runconfig") (begin + ;; keep this one local (pp (hash-table->alist (open-run-close setup-env-defaults #f "runconfigs.config" #f #f change-env: #f))) (set! *didsomething* #t))) + +(if (args:get-arg "-show-config") + (begin + ;; keep this one local + (pp (hash-table->alist (open-run-close setup-env-defaults #f "megatest.config" #f #f change-env: #f))) + (set! *didsomething* #t))) ;;====================================================================== ;; Remove old run(s) ;;====================================================================== @@ -439,11 +449,12 @@ "\n diskfree: " (db:test-get-diskfree test) "\n uname: " (db:test-get-uname test) "\n rundir: " (db:test-get-rundir test) ) ;; Each test - (let ((steps (cdb:remote-run db:get-steps-for-test #f (db:test-get-id test)))) + ;; DO NOT remote run + (let ((steps (db:get-steps-for-test #f (db:test-get-id test)))) (for-each (lambda (step) (format #t " Step: ~20a State: ~10a Status: ~10a Time ~22a\n" (db:step-get-stepname step) @@ -580,13 +591,13 @@ (exit 1))) (if (not (setup-for-run)) (begin (debug:print 0 "Failed to setup, giving up on -test-paths or -test-files, exiting") (exit 1))) - (let* ((keys (open-run-close db:get-keys db)) + (let* ((keys (cdb:remote-run db:get-keys db)) (keynames (map key:get-fieldname keys)) - (paths (open-run-close db:test-get-paths-matching db keynames target (args:get-arg "-test-files")))) + (paths (cdb:remote-run db:test-get-paths-matching db keynames target (args:get-arg "-test-files")))) (set! *didsomething* #t) (for-each (lambda (path) (print path)) paths))) ;; else do a general-run-call @@ -593,11 +604,11 @@ (general-run-call "-test-files" "Get paths to test" (lambda (target runname keys keynames keyvallst) (let* ((db #f) - (paths (open-run-close db:test-get-paths-matching db keynames target (args:get-arg "-test-files")))) + (paths (cdb:remote-run db:test-get-paths-matching db keynames target (args:get-arg "-test-files")))) (for-each (lambda (path) (print path)) paths)))))) ;;====================================================================== @@ -630,13 +641,13 @@ (exit 1))) (if (not (setup-for-run)) (begin (debug:print 0 "Failed to setup, giving up on -archive, exiting") (exit 1))) - (let* ((keys (open-run-close db:get-keys db)) + (let* ((keys (cdb:remote-run db:get-keys db)) (keynames (map key:get-fieldname keys)) - (paths (open-run-close db:test-get-paths-matching db keynames target))) + (paths (cdb:remote-run db:test-get-paths-matching db keynames target))) (set! *didsomething* #t) (for-each (lambda (path) (print path)) paths))) ;; else do a general-run-call @@ -643,11 +654,11 @@ (general-run-call "-test-paths" "Get paths to tests" (lambda (target runname keys keynames keyvallst) (let* ((db #f) - (paths (open-run-close db:test-get-paths-matching db keynames target))) + (paths (cdb:remote-run db:test-get-paths-matching db keynames target))) (for-each (lambda (path) (print path)) paths)))))) ;;====================================================================== @@ -663,11 +674,11 @@ (outputfile (args:get-arg "-extract-ods")) (runspatt (args:get-arg ":runname")) (pathmod (args:get-arg "-pathmod")) (keyvalalist (keys->alist keys "%"))) (debug:print 2 "Extract ods, outputfile: " outputfile " runspatt: " runspatt " keyvalalist: " keyvalalist) - (open-run-close db:extract-ods-file db outputfile keyvalalist (if runspatt runspatt "%") pathmod))))) + (cdb:remote-run db:extract-ods-file db outputfile keyvalalist (if runspatt runspatt "%") pathmod))))) ;;====================================================================== ;; execute the test ;; - gets called on remote host ;; - receives info from the -execute param @@ -706,11 +717,12 @@ (if (not (setup-for-run)) (begin (debug:print 0 "Failed to setup, exiting") (exit 1))) (if (and state status) - (open-run-close db:teststep-set-status! db test-id step state status msg logfile) + ;; DO NOT remote run + (db:teststep-set-status! db test-id step state status msg logfile) (begin (debug:print 0 "ERROR: You must specify :state and :status with every call to -step") (exit 6)))))) (if (args:get-arg "-step") @@ -744,11 +756,11 @@ (runscript (assoc/default 'runscript cmdinfo)) (db-host (assoc/default 'db-host cmdinfo)) (run-id (assoc/default 'run-id cmdinfo)) (test-id (assoc/default 'test-id cmdinfo)) (itemdat (assoc/default 'itemdat cmdinfo)) - (db #f) + (db #f) ;; (open-db)) (state (args:get-arg ":state")) (status (args:get-arg ":status"))) (change-directory testpath) ;; (set! *runremote* runremote) (set! *transport-type* (string->symbol transport)) @@ -760,18 +772,21 @@ ;; can setup as client for server mode now ;; (server:client-setup) (if (args:get-arg "-load-test-data") ;; has sub commands that are rdb: - (open-run-close db:load-test-data db test-id)) + ;; DO NOT put this one into either cdb:remote-run or open-run-close + (db:load-test-data db test-id)) (if (args:get-arg "-setlog") (let ((logfname (args:get-arg "-setlog"))) (cdb:test-set-log! *runremote* test-id logfname))) (if (args:get-arg "-set-toplog") - (open-run-close tests:test-set-toplog! db run-id test-name (args:get-arg "-set-toplog"))) + ;; DO NOT run remote + (tests:test-set-toplog! db run-id test-name (args:get-arg "-set-toplog"))) (if (args:get-arg "-summarize-items") - (open-run-close tests:summarize-items db run-id test-name #t)) ;; do force here + ;; DO NOT run remote + (tests:summarize-items db run-id test-name #t)) ;; do force here (if (args:get-arg "-runstep") (if (null? remargs) (begin (debug:print 0 "ERROR: nothing specified to run!") (if db (sqlite3:finalize! db)) @@ -789,11 +804,12 @@ (else ">&"))) (fullcmd (conc "(" (string-intersperse (cons cmd params) " ") ") " redir " " logfile))) ;; mark the start of the test - (open-run-close db:teststep-set-status! db test-id stepname "start" "n/a" (args:get-arg "-m") logfile) + ;; DO NOT run remote + (db:teststep-set-status! db test-id stepname "start" "n/a" (args:get-arg "-m") logfile) ;; run the test step (debug:print-info 2 "Running \"" fullcmd "\"") (change-directory startingdir) (set! exitstat (system fullcmd)) ;; cmd params)) (set! *globalexitstatus* exitstat) @@ -808,11 +824,12 @@ (set! exitstat (system cmd)) (set! *globalexitstatus* exitstat) ;; no necessary (change-directory testpath) (cdb:test-set-log! *runremote* test-id htmllogfile))) (let ((msg (args:get-arg "-m"))) - (open-run-close db:teststep-set-status! db test-id stepname "end" exitstat msg logfile)) + ;; DO NOT run remote + (db:teststep-set-status! db test-id stepname "end" exitstat msg logfile)) ))) (if (or (args:get-arg "-test-status") (args:get-arg "-set-values")) (let ((newstatus (cond ((number? status) (if (equal? status 0) "PASS" "FAIL")) @@ -850,11 +867,11 @@ (keys #f)) (if (not (setup-for-run)) (begin (debug:print 0 "Failed to setup, exiting") (exit 1))) - (set! keys (open-run-close db:get-keys db)) + (set! keys (cbd:remote-run db:get-keys db)) (debug:print 1 "Keys: " (string-intersperse (map key:get-fieldname keys) ", ")) (if db (sqlite3:finalize! db)) (set! *didsomething* #t))) (if (args:get-arg "-gui") @@ -881,10 +898,11 @@ (begin (if (not (setup-for-run)) (begin (debug:print 0 "Failed to setup, exiting") (exit 1))) + ;; keep this one local (open-run-close patch-db #f) (set! *didsomething* #t))) ;;====================================================================== ;; Update the tests meta data from the testconfig files @@ -895,10 +913,11 @@ (if (not (setup-for-run)) (begin (debug:print 0 "Failed to setup, exiting") (exit 1))) ;; now can find our db + ;; keep this one local (open-run-close runs:update-all-test_meta db) (set! *didsomething* #t))) ;;====================================================================== ;; Start a repl