Index: api.scm ================================================================== --- api.scm +++ api.scm @@ -117,11 +117,16 @@ #t (let ((cmd (vector-ref dat 0)) (params (vector-ref dat 1))) (case (if (symbol? cmd) cmd - (string->symbol cmd)) + (if (string? cmd) + (string->symbol cmd) + (begin + (debug:print 0 *default-log-port* "ERROR: received bad data in execute-requests \"" cmd "\"" + " and params " params) + (exit 1)))) ;;=============================================== ;; READ/WRITE QUERIES ;;=============================================== Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -2890,18 +2890,26 @@ ;; foo,abl, 1.2, 1.3, 0.1 ;; foo,bra, 1.2, pass, silly stuff ;; faz,bar, 10, 8mA, , ,"this is a comment" ;; EOF + +(define (db:csv->list-safe csvdata) + (if (string? csvdata) + (csv->list (make-csv-reader + (open-input-string csvdata) + '((strip-leading-whitespace? #t) + (strip-trailing-whitespace? #t)))) + (begin + (debug:print 0 *default-log-port* "ERROR: received non-string data for csv") + '()))) + (define (db:csv->test-data dbstruct run-id test-id csvdata) (debug:print 4 *default-log-port* "test-id " test-id ", csvdata: " csvdata) (let* ((dbdat (db:get-db dbstruct run-id)) (db (db:dbdat-get-db dbdat)) - (csvlist (csv->list (make-csv-reader - (open-input-string csvdata) - '((strip-leading-whitespace? #t) - (strip-trailing-whitespace? #t)))))) ;; (csv->list csvdata))) + (csvlist (db:csv->list-safe csvdata))) (for-each (lambda (csvrow) (let* ((padded-row (take (append csvrow (list #f #f #f #f #f #f #f #f #f)) 9)) (category (list-ref padded-row 0)) (variable (list-ref padded-row 1)) Index: db_records.scm ================================================================== --- db_records.scm +++ db_records.scm @@ -67,47 +67,43 @@ (define (dbr:dbstruct-localdb-set! v run-id db) (hash-table-set! (dbr:dbstruct-locdbs v) run-id db)) (require-extension typed-records) (defstruct db:test-rec ((id -1) : number) - ((run_id -1) : number) - ((testname "") : string) - ((state "") : string) - ((status "") : string) - ((event_time -1) : number) - ((host "") : string) - ((cpuload -1) : number) - ((diskfree -1) : number) - ((uname "") : string) - ((rundir "") : string) - ((item_path "") : string) - ((run_duration -1) : number) - ((final_logf "") : string) - ((comment "") : string) - ((process-id -1) : number) - ((archived -1) : number) - ((shortdir -1) : number) - ((attemptnum -1) : number)) - -"id" "run_id" "testname" "state" "status" "event_time" - "host" "cpuload" "diskfree" "uname" "rundir" "item_path" - "run_duration" "final_logf" "comment" "shortdir" "attemptnum" "archived" + ((run_id -1) : number) + ((testname "") : string) + ((state "") : string) + ((status "") : string) + ((event_time -1) : number) + ((host "") : string) + ((cpuload -1) : number) + ((diskfree -1) : number) + ((uname "") : string) + ((rundir "") : string) + ((item_path "") : string) + ((run_duration -1) : number) + ((final_logf "") : string) + ((comment "") : string) + ((process-id -1) : number) + ((archived -1) : number) + ((shortdir -1) : number) + ((attemptnum -1) : number)) (define (db:qry-gen-alist qrystr listvals) - (define listqry (string-split qrystr ",")) - (if (null? listqry) - '() - (let loop ((strhead (car listqry)) - (strtail (cdr listqry)) - (valhead (car listvals)) - (valtail (cdr listvals)) - (res '())) - (let* ((slot-val-pair (cons (string->symbol strhead) valhead))) - (if (or (null? strtail) - (null? valtail)) - (cons slot-val-pair res);;(print strhead valhead));;(cons (cons (string->symbol strhead) valhead) res)) - (loop (car strtail)(cdr strtail)(car valtail)(cdr valtail)(cons slot-val-pair res))))))) + (define listqry (string-split qrystr ",")) + (if (null? listqry) + '() + (let loop ((strhead (car listqry)) + (strtail (cdr listqry)) + (valhead (car listvals)) + (valtail (cdr listvals)) + (res '())) + (let* ((slot-val-pair (cons (string->symbol strhead) valhead))) + (if (or (null? strtail) + (null? valtail)) + (cons slot-val-pair res);;(print strhead valhead));;(cons (cons (string->symbol strhead) valhead) res)) + (loop (car strtail)(cdr strtail)(car valtail)(cdr valtail)(cons slot-val-pair res))))))) (define (db:test-get-id typed-rec) (db:test-rec-id typed-rec)) (define (db:test-get-run_id typed-rec) (db:test-rec-run_id typed-rec)) (define (db:test-get-testname typed-rec) (db:test-rec-testname typed-rec)) (define (db:test-get-state typed-rec) (db:test-rec-state typed-rec)) Index: tests/fullrun/megatest.config ================================================================== --- tests/fullrun/megatest.config +++ tests/fullrun/megatest.config @@ -148,11 +148,11 @@ # RUNDEAD [system exit 56] [server] # force use of server always -# required yes +required yes # Use http instead of direct filesystem access transport http # transport fs # transport nmsg