84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
-
+
+
+
+
+
+
+
+
+
+
+
+
+
|
(open-run-close tasks:server-register tasks:open-db 1 "bob" 1234 100 'live)
(set! res (open-run-close tasks:get-best-server tasks:open-db))
res))
(test "de-register server" #f (let ((res #f))
(open-run-close tasks:server-deregister tasks:open-db "bob" port: 1234)
(open-run-close tasks:get-best-server tasks:open-db)))
;; (exit)
(set! *verbosity* 3) ;; enough to trigger turning off exception handling in db accesses
(define server-pid (process-run "../../bin/megatest" (list "-server" "-" "-debug" (conc *verbosity*))))
(sleep 3)
(set! *verbosity* 1)
(define hostinfo #f)
(test #f #t (let ((dat (open-run-close tasks:get-best-server tasks:open-db)))
(set! hostinfo dat)
(and (string? (car dat))
(number? (cadr dat)))))
(test #f #t (socket? (let ((s (server:client-login (car hostinfo)(cadr hostinfo))))
(set! *runremote* s)
s)))
(define th1 (make-thread (lambda ()(server:client-setup))))
(thread-start! th1)
(test #f #t (cdb:login *runremote* *toppath* *my-client-signature*))
(test #f #t (socket? *runremote*))
(exit)
;;======================================================================
;; C O N F I G F I L E S
;;======================================================================
(define conffile #f)
(test "Read a config" #t (hash-table? (read-config "test.config" #f #f)))
|