-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1779 from mtrmac/gpg-signing-tests
GPG signing test improvements
- Loading branch information
Showing
4 changed files
with
110 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package gpgagent | ||
|
||
import ( | ||
"os" | ||
"os/exec" | ||
) | ||
|
||
// Kill the running gpg-agent to drop unlocked keys. | ||
// This is useful to ensure tests don’t leave processes around (in TestMain), or for testing handling of invalid passphrases. | ||
func KillGPGAgent(gpgHomeDir string) error { | ||
cmd := exec.Command("gpgconf", "--kill", "gpg-agent") | ||
cmd.Env = append(os.Environ(), "GNUPGHOME="+gpgHomeDir) | ||
return cmd.Run() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters