mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-30 04:20:53 +00:00
Unit tests for PGP signing/verification
These unit-tests cover operations via both PGP providers: built-in `openpgp` and external `gpg`. Next step is to run these tests for gpg1 & gpg2 as separate entities.
This commit is contained in:
@@ -77,3 +77,35 @@ func (s *GnupgSuite) TestGPGVNothing(c *C) {
|
||||
|
||||
c.Assert(func() { NewGpgVerifier() }, PanicMatches, `Couldn't find a suitable gpgv executable.+`)
|
||||
}
|
||||
|
||||
type Gnupg1VerifierSuite struct {
|
||||
VerifierSuite
|
||||
}
|
||||
|
||||
var _ = Suite(&Gnupg1VerifierSuite{})
|
||||
|
||||
func (s *Gnupg1VerifierSuite) SetUpTest(c *C) {
|
||||
s.verifier = NewGpgVerifier()
|
||||
s.verifier.AddKeyring("./trusted.gpg")
|
||||
|
||||
c.Assert(s.verifier.InitKeyring(), IsNil)
|
||||
}
|
||||
|
||||
type Gnupg1SignerSuite struct {
|
||||
SignerSuite
|
||||
}
|
||||
|
||||
var _ = Suite(&Gnupg1SignerSuite{})
|
||||
|
||||
func (s *Gnupg1SignerSuite) SetUpTest(c *C) {
|
||||
s.signer = NewGpgSigner()
|
||||
s.signer.SetBatch(true)
|
||||
|
||||
s.verifier = &GoVerifier{}
|
||||
s.verifier.AddKeyring("./keyrings/aptly.pub")
|
||||
s.verifier.AddKeyring("./keyrings/aptly_passphrase.pub")
|
||||
|
||||
c.Assert(s.verifier.InitKeyring(), IsNil)
|
||||
|
||||
s.SignerSuite.SetUpTest(c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user