Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -1507,11 +1507,10 @@ state TEXT DEFAULT 'new', status TEXT DEFAULT 'n/a', archive_type TEXT DEFAULT 'bup', du INTEGER, archive_path TEXT);"))) - (print "creating triggers from init") (db:create-triggers db) db)) ;; ) ;;====================================================================== ;; A R C H I V E S Index: dbfile.scm ================================================================== --- dbfile.scm +++ dbfile.scm @@ -462,11 +462,11 @@ ;; (define (dbfile:lazy-modification-time fpath) (handle-exceptions exn (begin - (dbfile:print-err "Failed to get modifcation time for " fpath ", treating it as zero. exn=" exn) + (dbfile:print-err "Failed to get modification time for " fpath ", treating it as zero. exn=" exn) 0) (if (file-exists? fpath) (file-modification-time fpath) 0))) Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -526,11 +526,11 @@ (allowed-tests #f) (runconf #f)) ;; check if readonly (when readonly-mode - (debug:print-error 0 *default-log-port* "megatest.db is readonly. Cannot proceed.") + (debug:print-error 0 *default-log-port* "Megatest database is readonly. Cannot proceed.") (exit 1)) ;; per user request. If less than 100Meg space on dbdir partition, bail out with error ;; this will reduce issues in database corruption (common:check-db-dir-and-exit-if-insufficient) @@ -2347,15 +2347,15 @@ (bup-mutex (make-mutex)) (keep-records (args:get-arg "-keep-records")) ;; used in conjunction with -remove-runs to keep the records, TODO: consolidate this with "mode". (test-records '())) ;; for tasks that we wish to operate on all tests in one fell swoop (let* ((write-access-actions '(remove-runs set-state-status archive run-wait kill-runs)) - (dbfile (conc *toppath* "/megatest.db")) + (dbfile (conc *toppath* "/.db/main.db")) (readonly-mode (not (file-write-access? dbfile)))) (when (and readonly-mode (member action write-access-actions)) - (debug:print-error 0 *default-log-port* "megatest.db is readonly. Cannot proceed with action ["action"] in which write-access isrequired .") + (debug:print-error 0 *default-log-port* dbfile " is readonly. Cannot proceed with action ["action"] in which write-access isrequired .") (exit 1))) (debug:print-info 4 *default-log-port* "runs:operate-on => Header: " header " action: " action " new-state-status: " new-state-status) (if (> 2 (length state-status)) (begin Index: tests/simplerun/thebeginning.scm ================================================================== --- tests/simplerun/thebeginning.scm +++ tests/simplerun/thebeginning.scm @@ -11,10 +11,12 @@ ;; dbfile:set-subdb ;; db:with-db ;; dbfile:get-subdb ) +;; *************** dbfile.scm tests **************** + (define tmpdir (common:get-db-tmp-area)) (test #f #t (dbr:dbstruct? (dbfile:setup #t *toppath* tmpdir))) (test #f #t (dbr:dbstruct? (db:setup #t))) (define dbstruct *dbstruct-dbs*) (test #f #t (dbr:dbdat? (dbfile:open-db *dbstruct-dbs* #f db:initialize-main-db))) @@ -38,5 +40,17 @@ (test #f #t (db:close-all dbstruct)) (test #f #t (db:safely-close-sqlite3-db (dbr:dbdat-dbh rundbdat) (dbr:dbdat-stmt-cache rundbdat))) (test #f #t (db:safely-close-sqlite3-db (dbr:dbdat-dbh maindbdat) (dbr:dbdat-stmt-cache maindbdat))) +(test #f #t (> (dbfile:lazy-sqlite-db-modification-time ".db/main.db") 0)) + +(test #f #t (common:simple-file-lock "./db.lock")) +(test #f "./db.lock" (common:simple-file-release-lock "./db.lock")) + + + +;; *************** db.scm tests **************** + + +(define thisdbdat (db:open-db dbstruct #f)) +(test #f #t (dbr:dbdat? thisdbdat))