aboutsummaryrefslogtreecommitdiff
path: root/gnu/tests/base.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/tests/base.scm')
0 files changed, 0 insertions, 0 deletions
ult->list result) port))) ;; syslog (copy-file "/var/log/messages" "syslog") ;; core dump (when (file-exists? %core-dump) (copy-file %core-dump "core-dump")) ;; dmesg (let ((pipe (open-pipe* OPEN_READ "dmesg"))) (call-with-output-file "dmesg" (lambda (port) (dump-port pipe port) (close-pipe pipe))))) dump-dir) (define* (make-dump dump-dir file-choices) "Create a crash dump archive from DUMP-DIR containing FILE-CHOICES. Returns the archive path." (define output (string-append (basename dump-dir) ".tar.gz")) (with-directory-excursion (dirname dump-dir) (apply system* "tar" "-zcf" output (map (lambda (f) (string-append (basename dump-dir) "/" f)) file-choices))) (canonicalize-path (string-append (dirname dump-dir) "/" output))) (define* (send-dump-report dump #:key (url "https://dump.guix.gnu.org")) "Turn the DUMP archive into a multipart body and send it to the Guix crash dump server at URL." (define (match-boundary kont) (match-lambda (('boundary . (? string? b)) (kont b)) (x #f))) (define (response->string response) (bytevector->string (read-response-body response) "UTF-8")) (let-values (((body boundary) (call-with-input-file dump (lambda (port) (format-multipart-body `((,%dump-type . ,port))))))) (false-if-exception (response->string (http-post (string-append url "/upload") #:keep-alive? #t #:streaming? #t #:headers `((content-type . (multipart/form-data (boundary . ,boundary)))) #:body body)))))