Index: rmtmod.scm ================================================================== --- rmtmod.scm +++ rmtmod.scm @@ -208,20 +208,22 @@ (ipaddr (alist-ref 'ipaddr the-srv)) (port (alist-ref 'port the-srv)) (srvready (server-ready? ipaddr port)) (fullpath (db:dbname->path apath dbname))) (if srvready - (hash-table-set! (rmt:remote-conns remote) - fullpath - (make-rmt:conn - apath: apath - dbname: dbname - fullname: fullpath - hostport: srv-addr - lastmsg: (current-seconds) - expires: (+ (current-seconds) 60) ;; this needs to be gathered during the ping - )) + (begin + (hash-table-set! (rmt:remote-conns remote) + fullpath + (make-rmt:conn + apath: apath + dbname: dbname + fullname: fullpath + hostport: srv-addr + lastmsg: (current-seconds) + expires: (+ (current-seconds) 60) ;; this needs to be gathered during the ping + )) + #t) (start-main-srv))) (start-main-srv)))) ;; NB// remote is a rmt:remote struct ;; Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -40,12 +40,13 @@ TARGET = "ubuntu/nfs/none" all : build unit test4 # test1 test2 test3 test4 test5 test6 test7 test8 test9 -unit : basicserver.log all-rmt.log all-api.log -# basicserver.log runs.log misc.log tests.log +unit : basicserver.log +# all-rmt.log all-api.log +# runs.log misc.log tests.log # inter dependencies on the unit tests, I wish these could be "suggestions" all-rmt.log : all-api.log rel : Index: tests/rununittest.sh ================================================================== --- tests/rununittest.sh +++ tests/rununittest.sh @@ -26,14 +26,12 @@ export PATH="${mtbindir}:$PATH" # Clean setup # -dbdir=$(echo /tmp/$USER/megatest_localdb/simplerun/.[a-zA-Z]*/) -echo "dbdir=$dbdir" -rm -f simplerun/megatest.db simplerun/monitor.db simplerun/db/monitor.db -rm -rf simplelinks/ simpleruns/ simplerun/db/ $dbdir +rm -rf simplerun/megatest.db simplerun/.db simplerun/.meta +rm -rf simplelinks/ simpleruns/ simplerun/db/ mkdir -p simplelinks simpleruns (cd simplerun;cp ../../*_records.scm .;perl -pi.bak -e 's/define-inline/define/' *_records.scm) (cd simplerun;cp ../../altdb.scm .) # Run the test $1 is the unit test to run Index: tests/tests.scm ================================================================== --- tests/tests.scm +++ tests/tests.scm @@ -15,11 +15,11 @@ ;; You should have received a copy of the GNU General Public License ;; along with Megatest. If not, see . ;; ;; strftime('%m/%d/%Y %H:%M:%S','now','localtime') -(import srfi-18) +(import srfi-18 test) (define test-work-dir (current-directory)) ;; given list of lists ;; ( ( msg expected param1 param2 ...) Index: tests/unittests/basicserver.scm ================================================================== --- tests/unittests/basicserver.scm +++ tests/unittests/basicserver.scm @@ -20,11 +20,24 @@ ;; Run like this: ;; ;; ./rununittest.sh server 1;(cd simplerun;megatest -stop-server 0) -(delete-file* "logs/1.log") +(import rmtmod trace) +(trace-call-sites #t) +(trace + rmt:find-main-server + ) + +(test #f #t (rmt:remote? (let ((r (make-rmt:remote))) + (set! *rmt:remote* r) + r))) +(test #f #f (rmt:get-connection *rmt:remote* *toppath* ".db/main.db")) +(test #f #f (rmt:find-main-server *toppath* ".db/main.db")) +(test #f #t (rmt:open-main-connection *rmt:remote* *toppath*)) + +;; (delete-file* "logs/1.log") ;; (define run-id 1) ;; (test "setup for run" #t (begin (launch:setup) ;; (string? (getenv "MT_RUN_AREA_HOME")))) ;;