summaryrefslogtreecommitdiff
path: root/t/000_setup.t
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-05-25 16:07:45 -0400
committerNiko Tyni <ntyni@debian.org>2018-06-29 10:20:20 +0200
commitddc919c9c1fa7181662bfcb60ee3edf8d715b589 (patch)
treefaf8c5eff693f756d460248d7f8f25ce88cb532d /t/000_setup.t
parentf1a0d94040443490400b08b37307212f775bfc68 (diff)
Kill any GnuPG agent before and after the test suite.
This helps to ensure that the test suite daemon is started fresh at every test suite run. And it also avoids leaving a daemon running after the test suite, assuming the test suite manages to reach the end. This is considered a reasonable practice by upstream. Gbp-Pq: Name 0017-Kill-any-GnuPG-agent-before-and-after-the-test-suite.patch
Diffstat (limited to 't/000_setup.t')
-rw-r--r--t/000_setup.t3
1 files changed, 3 insertions, 0 deletions
diff --git a/t/000_setup.t b/t/000_setup.t
index b183241..4dc4329 100644
--- a/t/000_setup.t
+++ b/t/000_setup.t
@@ -17,6 +17,9 @@ TEST
$agentconf->write("pinentry-program " . getcwd() . "/test/fake-pinentry.pl\n");
$agentconf->close();
copy('test/gpg.conf', 'test/gnupghome/gpg.conf');
+ # reset the state of any long-lived gpg-agent, ignoring errors:
+ system('gpgconf', '--homedir=test/gnupghome', '--quiet', '--kill', 'gpg-agent');
+
reset_handles();
my $pid = $gnupg->import_keys(command_args => [ 'test/public_keys.pgp', 'test/secret_keys.pgp', 'test/new_secret.pgp' ],