Index: configf.scm ================================================================== --- configf.scm +++ configf.scm @@ -70,15 +70,18 @@ (loop (read-line inp) curr-section-name))) (else (print "ERROR: Should not get here,\n \"" inl "\"") (loop (read-line inp) curr-section-name)))))))) (define (find-and-read-config fname) - (let* ((configinfo (find-config fname)) + (let* ((curr-dir (current-directory)) + (configinfo (find-config fname)) (toppath (car configinfo)) - (configfile (cadr configinfo)) - (configdat (if configfile (read-config configfile) #f))) ;; (make-hash-table)))) - (list configdat toppath configfile fname))) + (configfile (cadr configinfo))) + (if toppath (change-directory toppath)) + (let ((configdat (if configfile (read-config configfile) #f))) ;; (make-hash-table)))) + (if toppath (change-directory curr-dir)) + (list configdat toppath configfile fname)))) (define (config-lookup cfgdat section var) (let ((sectdat (hash-table-ref/default cfgdat section '()))) (if (null? sectdat) #f Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -109,10 +109,11 @@ ;; 4. remotely run the test on allocated host ;; - could be ssh to host from hosts table (update regularly with load) ;; - could be netbatch ;; (launch-test db (cadr status) test-conf)) (define (launch-test db run-id test-conf keyvallst test-name test-path itemdat) + (change-directory *toppath*) (let ((launcher (config-lookup *configdat* "jobtools" "launcher")) (runscript (config-lookup test-conf "setup" "runscript")) (diskspace (config-lookup test-conf "requirements" "diskspace")) (memory (config-lookup test-conf "requirements" "memory")) (hosts (config-lookup *configdat* "jobtools" "workhosts")) @@ -145,10 +146,11 @@ (list 'test-name test-name) (list 'runscript runscript) (list 'run-id run-id ) (list 'itemdat itemdat ) (list 'megatest remote-megatest) + (list 'env-ovrd (hash-table-ref/default *configdat* "env-override" '())) (list 'runname (args:get-arg ":runname")) (list 'mt-bindir-path mt-bindir-path))))))) ;; (string-intersperse keyvallst " ")))) (change-directory work-area) ;; so that log files from the launch process don't clutter the test dir (cond ((and launcher hosts) ;; must be using ssh hostname Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -319,10 +319,11 @@ (test-name (assoc/default 'test-name cmdinfo)) (runscript (assoc/default 'runscript cmdinfo)) (db-host (assoc/default 'db-host cmdinfo)) (run-id (assoc/default 'run-id cmdinfo)) (itemdat (assoc/default 'itemdat cmdinfo)) + (env-ovrd (assoc/default 'env-ovrd cmdinfo)) (runname (assoc/default 'runname cmdinfo)) (megatest (assoc/default 'megatest cmdinfo)) (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo)) (fullrunscript (conc testpath "/" runscript)) (db #f)) @@ -344,10 +345,12 @@ (change-directory work-area) (let ((runconfigf (conc *toppath* "/runconfigs.config"))) (if (file-exists? runconfigf) (setup-env-defaults db runconfigf run-id) (print "WARNING: You do not have a run config file: " runconfigf))) + ;; environment overrides are done *before* the remaining critical envars. + (alist->env-vars env-ovrd) (set-megatest-env-vars db run-id) (set-item-env-vars itemdat) (save-environment-as-files "megatest") (test-set-meta-info db run-id test-name itemdat) (test-set-status! db run-id test-name "REMOTEHOSTSTART" "n/a" itemdat (args:get-arg "-m")) Index: tests/megatest.config ================================================================== --- tests/megatest.config +++ tests/megatest.config @@ -24,11 +24,12 @@ status pass fail n/a # These are set before all tests, override them # in the testconfig [pre-launch-env-overrides] section [env-override] -SPECIAL_ENV_VARS overide them here - seen only by the test launcher +SPECIAL_ENV_VARS overide them here - should be seen at launch and in the runs +TESTVAR [system realpath .] ## disks are: ## name host:/path/to/area ## -or- ## name /path/to/area