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
|
;; archive - run bup
;;
;; 1. create the bup dir if not exists
;; 2. start the du of each directory
;; 3. gen index
;; 4. save
;;
(define (archive:run-bup archive-dir-in run-id run-name tests)
;; move the getting of archive space down into the below block so that a single run can
;; allocate as needed should a disk fill up
;;
(let* ((min-space (string->number (or (configf:lookup *configdat* "archive" "minspace") "1000")))
(archive-info (if (equal? archive-dir-in "-") ;; auto allocate an archive dir
(archive:allocate-new-archive-block *toppath* (common:get-testsuite-name) min-space)
(cons archive-dir-in 0))) ;; THIS WONT WORK!!!
(archive-dir (if archive-info (cdr archive-info) archive-dir-in))
(archive-id (if archive-info (car archive-info) -1))
(disk-groups (make-hash-table))
(test-groups (make-hash-table)) ;; these two (disk and test groups) could be combined nicely
(bup-exe (or (configf:lookup *configdat* "archive" "bup") "bup"))
(compress (or (configf:lookup *configdat* "archive" "compress") "9"))
(linktree (configf:lookup *configdat* "setup" "linktree")))
(if (not archive-dir) ;; no archive disk found, this is fatal
(begin
(debug:print 0 "FATAL: No archive disks found. Please add disks with at least " min-space " MB space to the [archive-disks] section of megatest.config")
(debug:print 0 " use [archive] minspace to specify minimum available space")
(debug:print 0 " disks: " (string-intersperse (map cadr (archive:get-archive-disks)) "\n "))
(exit 1))
|
|
|
<
|
<
|
|
|
|
|
|
|
|
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
|
;; archive - run bup
;;
;; 1. create the bup dir if not exists
;; 2. start the du of each directory
;; 3. gen index
;; 4. save
;;
(define (archive:run-bup archive-command run-id run-name tests)
;; move the getting of archive space down into the below block so that a single run can
;; allocate as needed should a disk fill up
;;
(let* ((min-space (string->number (or (configf:lookup *configdat* "archive" "minspace") "1000")))
(archive-info (archive:allocate-new-archive-block *toppath* (common:get-testsuite-name) min-space))
(archive-dir (if archive-info (cdr archive-info) #f))
(archive-id (if archive-info (car archive-info) -1))
(disk-groups (make-hash-table))
(test-groups (make-hash-table)) ;; these two (disk and test groups) could be combined nicely
(bup-exe (or (configf:lookup *configdat* "archive" "bup") "bup"))
(compress (or (configf:lookup *configdat* "archive" "compress") "9"))
(linktree (configf:lookup *configdat* "setup" "linktree")))
(if (not archive-dir) ;; no archive disk found, this is fatal
(begin
(debug:print 0 "FATAL: No archive disks found. Please add disks with at least " min-space " MB space to the [archive-disks] section of megatest.config")
(debug:print 0 " use [archive] minspace to specify minimum available space")
(debug:print 0 " disks: " (string-intersperse (map cadr (archive:get-archive-disks)) "\n "))
(exit 1))
|
189
190
191
192
193
194
195
196
197
198
199
|
(run-n-wait bup-exe params: bup-index-params print-cmd: print-prefix)
(debug:print-info 0 "Archiving data with bup")
(run-n-wait bup-exe params: bup-save-params print-cmd: print-prefix)
(for-each
(lambda (test-dat)
(let ((test-id (db:test-get-id test-dat))
(run-id (db:test-get-run_id test-dat)))
(rmt:test-set-archive-block-id run-id test-id archive-id)))
(hash-table-ref test-groups disk-group))))
(hash-table-keys disk-groups))
#t))
|
|
>
>
|
187
188
189
190
191
192
193
194
195
196
197
198
199
|
(run-n-wait bup-exe params: bup-index-params print-cmd: print-prefix)
(debug:print-info 0 "Archiving data with bup")
(run-n-wait bup-exe params: bup-save-params print-cmd: print-prefix)
(for-each
(lambda (test-dat)
(let ((test-id (db:test-get-id test-dat))
(run-id (db:test-get-run_id test-dat)))
(rmt:test-set-archive-block-id run-id test-id archive-id)
(if (member archive-command '("save-remove"))
(runs:remove-test-directory test-dat 'archive-remove))))
(hash-table-ref test-groups disk-group))))
(hash-table-keys disk-groups))
#t))
|