tests: Add function to dump packets.
authorJustus Winter <justus@g10code.com>
Thu, 4 May 2017 12:24:50 +0000 (14:24 +0200)
committerJustus Winter <justus@g10code.com>
Thu, 4 May 2017 12:25:38 +0000 (14:25 +0200)
* tests/openpgp/defs.scm (gpg-dump-packets): New function.

Signed-off-by: Justus Winter <justus@g10code.com>
tests/openpgp/defs.scm

index 9e681bf..8d7caed 100644 (file)
    (pipe:spawn `(,@GPG --dearmor))
    (pipe:write-to sink-name (logior O_WRONLY O_CREAT O_BINARY) #o600)))
 
+(define (gpg-dump-packets source-name sink-name)
+  (pipe:do
+   (pipe:open source-name (logior O_RDONLY O_BINARY))
+   (pipe:spawn `(,@GPG --list-packets))
+   (pipe:write-to sink-name (logior O_WRONLY O_CREAT O_BINARY) #o600)))
+
 ;;
 ;; Support for test environment creation and teardown.
 ;;