@@ -79,13 +79,18 @@ "runname")) (key-vals (get-key-vals db run-id)) (key-str (string-intersperse key-vals "/")) (dfullp (conc disk-path "/" key-str "/" runname "/" testname item-path)) + (toptest-path (conc disk-path "/" key-str "/" runname "/" testname)) (runsdir (config-lookup *configdat* "setup" "runsdir")) (lnkpath (conc (if runsdir runsdir (conc *toppath* "/runs")) "/" 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) (system (conc "mkdir -p " dfullp)) (print " - creating link from " dfullp "/" testname " to " lnkpath) (system (conc "mkdir -p " lnkpath)) @@ -93,12 +98,12 @@ (system (conc "rm -f " lnkpath "/" testname))) (system (conc "ln -sf " dfullp " " lnkpath "/" testname)) (if (directory? dfullp) (begin (system (conc "rsync -av " test-path "/ " dfullp "/")) - dfullp) - #f))) + (list dfullp toptest-path)) + (list #f #f)))) ;; 1. look though disks list for disk with most space ;; 2. create run dir on disk, path name is meaningful ;; 3. create link from run dir to megatest runs area ;; 4. remotely run the test on allocated host @@ -113,10 +118,11 @@ (hosts (config-lookup *configdat* "jobtools" "workhosts")) (remote-megatest (config-lookup *configdat* "setup" "executable")) (local-megatest (car (argv))) ;; (item-path (item-list->path itemdat)) test-path is the full path including the item-path (work-area #f) + (toptest-work-area #f) ;; for iterated tests the top test contains data relevant for all (diskpath #f) (cmdparms #f) (fullcmd #f) ;; (define a (with-output-to-string (lambda ()(write x)))) (mt-bindir-path #f)) (if hosts (set! hosts (string-split hosts))) @@ -124,11 +130,13 @@ (set! mt-bindir-path (pathname-directory remote-megatest)) (if launcher (set! launcher (string-split launcher))) ;; set up the run work area for this test (set! diskpath (get-best-disk *configdat*)) (if diskpath - (set! work-area (create-work-area db run-id test-path diskpath test-name itemdat)) + (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"))) (set! cmdparms (base64:base64-encode (with-output-to-string (lambda () ;; (list 'hosts hosts) @@ -135,11 +143,12 @@ (write (list (list 'testpath test-path) (list 'work-area work-area) (list 'test-name test-name) (list 'runscript runscript) (list 'run-id run-id ) - (list 'itemdat itemdat) + (list 'itemdat itemdat ) + (list 'megatest remote-megatest) (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