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:
parent
8c33651e0c
commit
0d885b439f
1 changed files with 5 additions and 0 deletions
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue