summaryrefslogtreecommitdiff
path: root/t/000_setup.t
blob: 7f7f7b0f6be3134267bb6898617b58106be3d9de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl -w

use strict;
use English qw( -no_match_vars );

use lib './t';
use MyTest;
use MyTestSpecific;
use Cwd;
use File::Path qw (make_path);
use File::Copy;

TEST
{
    make_path('test/gnupghome', { mode => 0700 });
    my $agentconf = IO::File->new( "> test/gnupghome/gpg-agent.conf" );
    $agentconf->write("pinentry-program " . getcwd() . "/test/fake-pinentry.pl\n");
    $agentconf->close();
    copy('test/gpg.conf', 'test/gnupghome/gpg.conf');
    reset_handles();

    my $pid = $gnupg->import_keys(command_args => [ 'test/pubring.gpg', 'test/secring.gpg' ],
                                  options => [ 'batch'],
                                  handles => $handles);
    waitpid $pid, 0;

    return $CHILD_ERROR == 0;
};