Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -37,11 +37,11 @@ transport-mode.scm : transport-mode.scm.template cp transport-mode.scm.template transport-mode.scm dashboard-mode.scm : transport-mode.scm.template - cp transport-mode.scm.template transport-mode.scm + cp transport-mode.scm.template dashboard-transport-mode.scm megatest.scm : transport-mode.scm # dbmod.import.o is just a hack here mofiles/dbfile.o : mofiles/debugprint.o mofiles/commonmod.o dbmod.import.o Index: rmt.scm ================================================================== --- rmt.scm +++ rmt.scm @@ -140,11 +140,11 @@ (set! runremote newremote))) (let* ((dbfname (conc (dbfile:run-id->dbnum run-id)".db"))) ;;(dbfile:run-id->path areapath run-id))) (tt:handler runremote cmd run-id params attemptnum area-dat areapath readonly-mode dbfname testsuite mtexe))) (define (http-transport-handler runremote cmd rid params attemptnum area-dat areapath readonly-mode) - ;; do all the prep locked under the rmt-mutex + ;; do all the prep locked under the rmt-mutex (mutex-lock! *rmt-mutex*) ;; ensure we have a record for our connection for given area (if (not runremote) ;; can remove this one. should never get here. (begin Index: tcp-transportmod.scm ================================================================== --- tcp-transportmod.scm +++ tcp-transportmod.scm @@ -105,16 +105,16 @@ (make-tt areapath: areapath)) ;; do all the busy work of finding and setting up conn for ;; connecting to a server ;; -(define (tt:client-connect-to-server ttdat dbfname run-id ) +(define (tt:client-connect-to-server ttdat dbfname run-id testsuite) (let* ((conn (hash-table-ref/default (tt-conns ttdat) dbfname #f)) (server-start-proc (lambda () (tt:server-process-run (tt-areapath ttdat) - (dbfile:testsuite-name) + testsuite ;; (dbfile:testsuite-name) (common:find-local-megatest) run-id)))) (if conn conn ;; we are already connected to the server (let* ((sdat (tt:get-current-server-info ttdat dbfname run-id))) @@ -136,15 +136,15 @@ conn (begin ;; rm the (last server) would go here (server-start-proc) (thread-sleep! 1) - (tt:client-connect-to-server ttdat dbfname run-id))))) + (tt:client-connect-to-server ttdat dbfname run-id testsuite))))) (else (server-start-proc) (thread-sleep! 1) - (tt:client-connect-to-server ttdat dbfname run-id))))))) + (tt:client-connect-to-server ttdat dbfname run-id testsuite))))))) (define (tt:ping host port server-id) (let* ((res (tt:send-receive-direct host port `(ping #f #f #f)))) ;; please send me your server-id ;; ;; need two threads, one a 5 second timer @@ -162,11 +162,11 @@ ;; client side handler ;; (define (tt:handler ttdat cmd run-id params attemptnum area-dat areapath readonly-mode dbfname testsuite mtexe) ;; NOTE: areapath is passed in and in tt struct. We'll use passed in value for now. - (let* ((conn (tt:client-connect-to-server ttdat dbfname run-id))) ;; (hash-table-ref/default (tt-conns ttdat) dbfname #f))) + (let* ((conn (tt:client-connect-to-server ttdat dbfname run-id testsuite))) ;; (hash-table-ref/default (tt-conns ttdat) dbfname #f))) (if conn ;; have connection, call the server (let* ((res (tt:send-receive ttdat conn cmd run-id params))) ;; res is (status errmsg result meta) (match res @@ -451,10 +451,13 @@ ;; if the target-host is set ;; try running on that host ;; incidental: rotate logs in logs/ dir. ;; (define (tt:server-process-run areapath testsuite mtexe run-id #!key (profile-mode "")) ;; areapath is *toppath* for a given testsuite area + (assert areapath "FATAL: tt:server-process-run called without areapath defined.") + (assert testsuite "FATAL: tt:server-process-run called without testsuite defined.") + (assert mtexe "FATAL: tt:server-process-run called without mtexe defined.") (let* ((logfile (conc areapath "/logs/server.log")) ;; -" curr-pid "-" target-host ".log")) (cmdln (conc mtexe " -server - ";; (or target-host "-") " -m testsuite:" testsuite @@ -461,15 +464,18 @@ " -run-id " (or run-id "main") " -db " (dbmod:run-id->dbfname run-id) " " profile-mode ))) ;; (conc " >> " logfile " 2>&1 &"))))) ;; we want the remote server to start in *toppath* so push there - (push-directory areapath) - (debug:print 0 *default-log-port* "INFO: Trying to start server in tcp mode (" cmdln ") ...") - (debug:print 0 *default-log-port* "INFO: starting server at " (common:human-time)) - (system (conc "nbfake " cmdln)) - (pop-directory))) + ;; (push-directory areapath) ;; use cd in the command line instead + (debug:print 0 *default-log-port* "INFO: Trying to start server in tcp mode (" cmdln ") at "(common:human-time)"...") + ;; (debug:print 0 *default-log-port* "INFO: starting server at " (common:human-time)) + (setenv "NBFAKE_QUIET" "yes") ;; BUG: change to with-environment-variable ... + (system (conc "cd "areapath" ; nbfake " cmdln)) + (unsetenv "NBFAKE_QUIET") + ;;(pop-directory) + )) ;;====================================================================== ;; tcp connection stuff ;;====================================================================== Index: utils/nbfake ================================================================== --- utils/nbfake +++ utils/nbfake @@ -39,10 +39,11 @@ nbfake behavior can be changed by setting the following env vars: NBFAKE_HOST SSH to \$NBFAKE_HOST and run command NBFAKE_LOG Logfile for nbfake output NB_WASH_GROUPS comma-separated list of groups to wash into NB_WASH_ENABLED must be set in order to enable wash groups + NBFAKE_QUIET set to suppress informational output __EOF exit fi @@ -87,19 +88,21 @@ #============================================================================== # Run and log #============================================================================== +if [[ -z "$NBFAKE_QUIET" ]];then cat <<__EOF >&2 #====================================================================== # NBFAKE logging command to: $MY_NBFAKE_LOG # $WASHCMD $* #====================================================================== __EOF +fi if [[ -z "$MY_NBFAKE_HOST" ]]; then # Run locally sh -c "cd $CURRWD;export DISPLAY=$DISPLAY; export PATH=\"$PATH\"; nohup $WASHCMD $* >> $MY_NBFAKE_LOG 2>&1 &" else # run remotely ssh -X -n -f $MY_NBFAKE_HOST "sh -c \"cd $CURRWD;export DISPLAY=$DISPLAY; export PATH=\"$PATH\"; nohup $WASHCMD $* >> $MY_NBFAKE_LOG 2>&1 &\"" fi