1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2025-03-05 08:07:16 +00:00

Create a temporary GNUPGHOME dir

This should prevent the paths from getting unwieldy, we'll see.
This commit is contained in:
Andreas Fuchs 2020-07-22 09:11:42 -04:00 committed by Jörg Thalheim
parent 8c33651e0c
commit 0d885b439f
No known key found for this signature in database
GPG key ID: 003F2096411B5F92

View file

@ -27,6 +27,10 @@ func TestCli(t *testing.T) {
ok(t, err)
defer os.RemoveAll(tempdir)
gpgHome := path.Join(tempdir, "gpg-home")
gpgEnv := append(os.Environ(), fmt.Sprintf("GNUPGHOME=%s", gpgHome))
ok(t, os.Mkdir(gpgHome, os.FileMode(0700)))
out := path.Join(tempdir, "out")
privKey := path.Join(assets, "id_rsa")
cmds := [][]string{
@ -41,6 +45,7 @@ func TestCli(t *testing.T) {
cmd := exec.Command("gpg", "--with-fingerprint", "--show-key", out)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Env = gpgEnv
ok(t, cmd.Run())
}
}