tests: Simplify test.
authorJustus Winter <justus@g10code.com>
Tue, 8 Nov 2016 14:38:17 +0000 (15:38 +0100)
committerJustus Winter <justus@g10code.com>
Tue, 8 Nov 2016 15:03:16 +0000 (16:03 +0100)
* tests/openpgp/issue2417.scm: Simplify.

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

index 5f70e08..f584000 100755 (executable)
 ;; along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 (load (with-path "defs.scm"))
-(setup-legacy-environment)
+(setup-environment)
 
-(define old-home (getenv "GNUPGHOME"))
+(define keyfile (in-srcdir "samplekeys" "rsa-rsa-sample-1.asc"))
 
 (define (touch file-name)
   (close (open file-name (logior O_WRONLY O_BINARY O_CREAT) #o600)))
 
 (info "Checking robustness wrt empty databases in gnupghome (issue2417)...")
-
-(lettmp
- ;; Prepare some random key to import later.
- (keyfile)
- (pipe:do
-  (pipe:gpg '(--export alpha))
-  (pipe:write-to keyfile (logior O_WRONLY O_BINARY O_CREAT) #o600))
-
- (with-temporary-working-directory
-  (file-copy (path-join old-home "gpg.conf") "gpg.conf")
-  (file-copy (path-join old-home "gpg-agent.conf") "gpg-agent.conf")
-  (setenv "GNUPGHOME" "." #t)
-  (touch "trustdb.gpg")
-  (touch "pubring.gpg")
-  (touch "pubring.kbx")
-  (call-check `(,(tool 'GPG) --import ,keyfile))))
+(touch "trustdb.gpg")
+(touch "pubring.gpg")
+(touch "pubring.kbx")
+(call-check `(,(tool 'GPG) --import ,keyfile))