mirror of
https://github.com/containers/skopeo.git
synced 2025-07-04 18:37:00 +00:00
Explicitly disable encrypting test GPG keys
Since GPG 2.1, GPG asks for a passphrase by default; opt out when generating test keys to avoid > gpg: agent_genkey failed: No pinentry > gpg: key generation failed: No pinentry which happens otherwise (and we can't use an interactive pinentry in a batch process anyway). Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
6307635b5f
commit
23c6b42b26
@ -14,7 +14,7 @@ import (
|
|||||||
"github.com/containers/image/manifest"
|
"github.com/containers/image/manifest"
|
||||||
"github.com/containers/image/signature"
|
"github.com/containers/image/signature"
|
||||||
"github.com/go-check/check"
|
"github.com/go-check/check"
|
||||||
"github.com/opencontainers/go-digest"
|
digest "github.com/opencontainers/go-digest"
|
||||||
imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
|
imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
"github.com/opencontainers/image-tools/image"
|
"github.com/opencontainers/image-tools/image"
|
||||||
)
|
)
|
||||||
@ -64,7 +64,7 @@ func (s *CopySuite) SetUpSuite(c *check.C) {
|
|||||||
os.Setenv("GNUPGHOME", s.gpgHome)
|
os.Setenv("GNUPGHOME", s.gpgHome)
|
||||||
|
|
||||||
for _, key := range []string{"personal", "official"} {
|
for _, key := range []string{"personal", "official"} {
|
||||||
batchInput := fmt.Sprintf("Key-Type: RSA\nName-Real: Test key - %s\nName-email: %s@example.com\n%%commit\n",
|
batchInput := fmt.Sprintf("Key-Type: RSA\nName-Real: Test key - %s\nName-email: %s@example.com\n%%no-protection\n%%commit\n",
|
||||||
key, key)
|
key, key)
|
||||||
runCommandWithInput(c, batchInput, gpgBinary, "--batch", "--gen-key")
|
runCommandWithInput(c, batchInput, gpgBinary, "--batch", "--gen-key")
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ func (s *SigningSuite) SetUpSuite(c *check.C) {
|
|||||||
c.Assert(err, check.IsNil)
|
c.Assert(err, check.IsNil)
|
||||||
os.Setenv("GNUPGHOME", s.gpgHome)
|
os.Setenv("GNUPGHOME", s.gpgHome)
|
||||||
|
|
||||||
runCommandWithInput(c, "Key-Type: RSA\nName-Real: Testing user\n%commit\n", gpgBinary, "--homedir", s.gpgHome, "--batch", "--gen-key")
|
runCommandWithInput(c, "Key-Type: RSA\nName-Real: Testing user\n%no-protection\n%commit\n", gpgBinary, "--homedir", s.gpgHome, "--batch", "--gen-key")
|
||||||
|
|
||||||
lines, err := exec.Command(gpgBinary, "--homedir", s.gpgHome, "--with-colons", "--no-permission-warning", "--fingerprint").Output()
|
lines, err := exec.Command(gpgBinary, "--homedir", s.gpgHome, "--with-colons", "--no-permission-warning", "--fingerprint").Output()
|
||||||
c.Assert(err, check.IsNil)
|
c.Assert(err, check.IsNil)
|
||||||
|
Loading…
Reference in New Issue
Block a user