Changes In Branch rpc-db-access Through [acc6c48585] Excluding Merge-Ins
This is equivalent to a diff from 30895dfd86 to acc6c48585
2012-10-08
| ||
22:39 | Added kill target for forced clean up check-in: ff4a2d4f85 user: matt tags: trunk | |
15:53 | tweaked-installall.sh check-in: 71b201eb77 user: mrwellan tags: rpc-db-access | |
15:45 | Cleaned up login for rpc. Fixes to install process for IUP check-in: acc6c48585 user: mrwellan tags: rpc-db-access, merged-to-trunk-via-cherrypick | |
11:38 | Added logging to an sqlite3 db, updated installall.sh to latest chicken and iup releases, proper capture of stderr on launch process. check-in: 69482225b7 user: mrwellan tags: rpc-db-access, these-changes-moved-to-logging-to-db-branch | |
2012-10-07
| ||
22:50 | Merged couple more changes from test-specific-db check-in: b2448ef0d3 user: mrwellan tags: rpc-db-access, test4-clean | |
12:14 | merged to trunk while sitting next to a creek in Prescott wilderness check-in: 30895dfd86 user: user tags: trunk, test4-clean | |
2012-10-06
| ||
21:44 | Tried rpc:close-all-connections check-in: 15de82c995 user: matt tags: test-specific-db | |
2012-09-14
| ||
14:17 | Merged in fix for symlink crash check-in: e6642c0f2d user: mrwellan tags: trunk | |
Modified common.scm from [b1035eae27] to [cc91d853d4].
︙ | |||
35 36 37 38 39 40 41 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | - + + + + + | (define *configdat* #f) (define *toppath* #f) (define *already-seen-runconfig-info* #f) (define *waiting-queue* (make-hash-table)) (define *test-meta-updated* (make-hash-table)) (define *globalexitstatus* 0) ;; attempt to work around possible thread issues (define *passnum* 0) ;; when running track calls to run-tests or similar |
︙ |
Modified common_records.scm from [305c308b19] to [d3914aa282].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | + - - + + + + | ;;====================================================================== ;; Copyright 2006-2012, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;;====================================================================== (define-inline (debug:print n . params) (begin |
Modified db.scm from [606081fd7b] to [378f0551a1].
︙ | |||
216 217 218 219 220 221 222 223 224 225 226 227 228 229 | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | + + + + | status TEXT DEFAULT 'n/a', type TEXT DEFAULT '', CONSTRAINT test_data_constraint UNIQUE (test_id,category,variable));") ;; Must do this *after* running patch db !! No more. (db:set-var db "MEGATEST_VERSION" megatest-version) )) ;;====================================================================== ;; T E S T S P E C I F I C D B ;;====================================================================== ;; Create the sqlite db for the individual test(s) (define (open-test-db testpath) (if (and (directory? testpath) (file-read-access? testpath)) (let* ((dbpath (conc testpath "/testdat.db")) (dbexists (file-exists? dbpath)) (db (sqlite3:open-database dbpath)) ;; (never-give-up-open-db dbpath)) |
︙ | |||
285 286 287 288 289 290 291 292 293 294 295 296 297 298 | 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | + + + + + + + + + + + + + + + + + + + + + + + + + | ;; the ackstate is set to 1 once the command has been completed "CREATE TABLE IF NOT EXISTS test_meta ( id INTEGER PRIMARY KEY, var TEXT, val TEXT, ackstate INTEGER DEFAULT 0, CONSTRAINT metadat_constraint UNIQUE (var));"))) ;;====================================================================== ;; L O G G I N G D B ;;====================================================================== (define (open-logging-db) ;; (conc *toppath* "/megatest.db") (car *configinfo*))) (let* ((dbpath (conc (if *toppath* (conc *toppath* "/") "") "logging.db")) ;; fname) (dbexists (file-exists? dbpath)) (db (sqlite3:open-database dbpath)) ;; (never-give-up-open-db dbpath)) (handler (make-busy-timeout (if (args:get-arg "-override-timeout") (string->number (args:get-arg "-override-timeout")) 36000)))) ;; 136000))) (sqlite3:set-busy-handler! db handler) (if (not dbexists) (begin (sqlite3:execute db "CREATE TABLE IF NOT EXISTS log (id INTEGER PRIMARY KEY,event_time TIMESTAMP DEFAULT (strftime('%s','now')),logline TEXT);") (sqlite3:execute db (conc "PRAGMA synchronous = 0;")))) db)) (define (db:log-event . loglst) (let ((db (open-logging-db)) (logline (apply conc loglst))) (sqlite3:execute db "INSERT INTO log (logline) VALUES (?);" logline) (sqlite3:finalize! db) logline)) ;;====================================================================== ;; TODO: ;; put deltas into an assoc list with version numbers ;; apply all from last to current ;;====================================================================== (define (patch-db db) |
︙ |
Modified launch.scm from [0714961a30] to [dc96227333].
︙ | |||
603 604 605 606 607 608 609 | 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | - + - + | (append (list (list "MT_TEST_RUN_DIR" work-area) (list "MT_TEST_NAME" test-name) (list "MT_ITEM_INFO" (conc itemdat)) (list "MT_RUNNAME" runname) (list "MT_TARGET" mt_target) ) itemdat))) |
︙ |
Modified megatest.scm from [e8b477af90] to [a442c44f02].
︙ | |||
94 95 96 97 98 99 100 101 102 103 104 105 106 107 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | + + | -update-meta : update the tests metadata for all tests -env2file fname : write the environment to fname.csh and fname.sh -setvars VAR1=val1,VAR2=val2 : Add environment variables to a run NB// these are overwritten by values set in config files. -server -|hostname : start the server (reduces contention on megatest.db), use - to automatically figure out hostname -repl : start a repl (useful for extending megatest) -debug N : increase verbosity to N. (try 10 for lots of noise) -logging : turn on logging all debug output to logging.db Spreadsheet generation -extract-ods fname.ods : extract an open document spreadsheet from the database -pathmod path : insert path, i.e. path/runame/itempath/logfile.html will clear the field if no rundir/testname/itempath/logfile if it contains forward slashes the path will be converted to windows style |
︙ | |||
188 189 190 191 192 193 194 195 196 197 198 199 200 201 | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | + | "-rebuild-db" "-rollup" "-update-meta" "-gen-megatest-area" "-v" ;; verbose 2, more than normal (normal is 1) "-q" ;; quiet 0, errors/warnings only "-logging" ) args:arg-hash 0)) (if (args:get-arg "-h") (begin (print help) |
︙ | |||
213 214 215 216 217 218 219 220 221 222 223 224 225 226 | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | + + | ((args:get-arg "-q") 0) (else 1))) (if (not (number? *verbosity*)) (begin (print "ERROR: Invalid debug value " (args:get-arg "-debug")) (exit))) (if (args:get-arg "-logging")(set! *logging* #t)) ;;====================================================================== ;; Misc general calls ;;====================================================================== (if (args:get-arg "-env2file") (begin |
︙ |
Modified process.scm from [71a058a91c] to [444a7f5a5f].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + | ;;====================================================================== ;; Process convience utils ;;====================================================================== (declare (unit process)) (declare (uses common)) (define (conservative-read port) (let loop ((res "")) (if (not (eof-object? (peek-char port))) (loop (conc res (read-char port))) res))) (define (cmd-run-with-stderr->list cmd . params) ;; (print "Called with cmd=" cmd ", proc=" proc ", params=" params) ;; (handle-exceptions ;; exn ;; (begin ;; (print "ERROR: Failed to run command: " cmd " " (string-intersperse params " ")) ;; (print " " ((condition-property-accessor 'exn 'message) exn)) ;; #f) (let-values (((fh fho pid fhe) (if (null? params) (process* cmd) (process* cmd params)))) (let loop ((curr (read-line fh)) (result '())) (let ((errstr (conservative-read fhe))) (if (not (string=? errstr "")) (set! result (append result (list errstr))))) (if (not (eof-object? curr)) (loop (read-line fh) (append result (list curr))) (begin (close-input-port fh) (close-input-port fhe) (close-output-port fho) result))))) ;; ) (define (cmd-run-proc-each-line cmd proc . params) ;; (print "Called with cmd=" cmd ", proc=" proc ", params=" params) (handle-exceptions exn (begin (print "ERROR: Failed to run command: " cmd " " (string-intersperse params " ")) #f) (let-values (((fh fho pid) (if (null? params) (process cmd) (process cmd params)))) |
︙ |
Modified server.scm from [e3a9a59227] to [d8295b1488].
︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | + | (hostname (if (string=? "-" hostn) (get-host-name) hostn)) (ipaddrstr (if (string=? "-" hostn) (string-intersperse (map number->string (u8vector->list (hostname->ip hostname))) ".") #f)) (host:port (conc (if ipaddrstr ipaddrstr hostname) ":" (rpc:default-server-port)))) (debug:print 0 "Server started on " host:port) (db:set-var db "SERVER" host:port) (set! *cache-on* #t) ;; can use this to run most anything at the remote (rpc:publish-procedure! 'remote:run (lambda (procstr . params) |
︙ | |||
134 135 136 137 138 139 140 | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | - + - - + + + + + - + - - + - - - + + | (mutex-unlock! *incoming-mutex*) (if (> queue-len 0) (begin (debug:print 0 "INFO: Queue not flushed, waiting ...") (loop (+ n 1))))) ))) (thread-start! th1) |
︙ | |||
197 198 199 200 201 202 203 | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | - + - + | ;; (lambda (db . param) ;; (sqlite3:execute db "DELETE FROM metadat WHERE var='SERVER'")) ;; #f) (set! *runremote* #f)) (if (and (not (args:get-arg "-server")) ;; no point in the server using the server using the server ((rpc:procedure 'server:login host portn) *toppath*)) (begin |
Modified tests/Makefile from [46cfd15912] to [8f7c0e557d].
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - + - - - - - - + + + + + + + - + | cd fullrun;$(MEGATEST) -runtests ez_pass,runfirst -reqtarg ubuntu/nfs/none -itempatt a/1 :runname $(RUNNAME)_a $(SERVER) test3 : fullprep cd fullrun;$(MEGATEST) -runtests runfirst -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b $(SERVER) -debug 10 test4 : fullprep cd fullrun;$(MEGATEST) $(SERVER) & |
︙ |
Modified tests/fullrun/tests/priority_3/main.sh from [0536bc3eb1] to [e8043acbce].
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | + + + + + + + + + | #!/bin/bash # a bunch of steps in 2 second increments for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17;do $MT_MEGATEST -step step$i :state start :status running -setlog results$i.html sleep 2 $MT_MEGATEST -step step$i :state end :status 0 done # get a previous test export EZFAILPATH=`$MT_MEGATEST -test-files envfile.txt -target $MT_TARGET :runname $MT_RUNNAME -testpatt ez_fail` if [[ -e $EZFAILPATH ]];then echo All good! else echo NOT good! exit 1 fi exit 0 |
Modified tests/tests.scm from [69324af198] to [6debbc62bb].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | + + + + + + + + + + + + + | (require-extension test) (require-extension regex) (define test-work-dir (current-directory)) ;; read in all the _record files (let ((files (glob "*_records.scm"))) (for-each (lambda (file) (print "Loading " file) (load file)) files)) ;;====================================================================== ;; P R O C E S S E S ;;====================================================================== (test "cmd-run-with-stderr->list" '("No such file or directory") (let ((reslst (cmd-run-with-stderr->list "ls" "/tmp/ihadbetternotexist"))) (string-search (regexp "No such file or directory")(car reslst)))) ;;====================================================================== ;; 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))) (test "Read a config that doesn't exist" #t (hash-table? (read-config "nada.config" #f #f))) (set! conffile (read-config "test.config" #f #f)) (test "Get available diskspace" #t (number? (get-df "./"))) |
︙ |
Modified utils/installall.sh from [68db492657] to [61a8728287].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | + - + + + + + + + + + | #!/bin/bash # Copyright 2007-2010, Matthew Welland. # # This program is made available under the GNU GPL version 2.0 or # greater. See the accompanying file COPYING for details. # # This program is distributed WITHOUT ANY WARRANTY; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. echo You may need to do the following first: echo sudo apt-get install libreadline-dev echo sudo apt-get install libwebkitgtk-dev echo sudo apt-get install libmotif3 -OR- set KTYPE=26g4 |
︙ | |||
36 37 38 39 40 41 42 | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | - + - + | if [[ $KTYPE == "" ]]; then echo 'Using KTYPE=26' export KTYPE=26 else echo Using KTYPE=$KTYPE fi |
︙ | |||
62 63 64 65 66 67 68 | 71 72 73 74 75 76 77 78 79 80 81 82 83 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 122 123 124 125 126 127 128 129 130 | + - - + + + + + + + + + + - - + + - - - + + + + + + + - + + + + - + | tar xfvz chicken-${CHICKEN_VERSION}.tar.gz cd chicken-${CHICKEN_VERSION} make PLATFORM=linux PREFIX=$PREFIX make PLATFORM=linux PREFIX=$PREFIX install cd $BUILDHOME fi # Some eggs are quoted since they are reserved to Bash |
︙ | |||
118 119 120 121 122 123 124 | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | - + | cd ffcall ./configure --prefix=$PREFIX --enable-shared make make install cd $BUILDHOME |
︙ |