Merge lp:~vila/bzr/1536566-gpgme-test-failure into lp:bzr

Proposed by Vincent Ladeuil
Status: Merged
Approved by: Richard Wilbur
Approved revision: no longer in the source branch.
Merged at revision: 6611
Proposed branch: lp:~vila/bzr/1536566-gpgme-test-failure
Merge into: lp:bzr
Diff against target: 39 lines (+7/-4)
2 files modified
bzrlib/gpg.py (+5/-4)
doc/en/release-notes/bzr-2.7.txt (+2/-0)
To merge this branch: bzr merge lp:~vila/bzr/1536566-gpgme-test-failure
Reviewer Review Type Date Requested Status
Richard Wilbur Approve
Review via email: mp+283419@code.launchpad.net

Commit message

Fix bzrlib.tests.test_gpg.TestVerify.test_verify_revoked_signature with recent versions of gpg.

Description of the change

bzrlib.tests.test_gpg.TestVerify.test_verify_revoked_signature started failing on wily.

I couldn't find the precise change in the gpg package set triggering the issue but the fix seems more precise than the existing version and as such shouldn't cause any regressions.

To post a comment you must log in.
Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

Good work! Thanks, Vincent!
+2

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/gpg.py'
--- bzrlib/gpg.py 2013-11-10 15:29:06 +0000
+++ bzrlib/gpg.py 2016-01-21 10:35:05 +0000
@@ -1,4 +1,4 @@
1# Copyright (C) 2005, 2011 Canonical Ltd1# Copyright (C) 2005, 2006, 2007, 2009, 2011, 2012, 2013, 2016 Canonical Ltd
2# Authors: Robert Collins <robert.collins@canonical.com>2# Authors: Robert Collins <robert.collins@canonical.com>
3#3#
4# This program is free software; you can redistribute it and/or modify4# This program is free software; you can redistribute it and/or modify
@@ -322,12 +322,13 @@
322 return SIGNATURE_NOT_VALID, None322 return SIGNATURE_NOT_VALID, None
323 # A signature from a revoked key gets this.323 # A signature from a revoked key gets this.
324 # test_verify_revoked_signature()324 # test_verify_revoked_signature()
325 if result[0].summary & gpgme.SIGSUM_SYS_ERROR:325 if ((result[0].summary & gpgme.SIGSUM_SYS_ERROR
326 or result[0].status.strerror == 'Certificate revoked')):
326 return SIGNATURE_NOT_VALID, None327 return SIGNATURE_NOT_VALID, None
327 # Other error types such as revoked keys should (I think) be caught by328 # Other error types such as revoked keys should (I think) be caught by
328 # SIGSUM_RED so anything else means something is buggy.329 # SIGSUM_RED so anything else means something is buggy.
329 raise errors.SignatureVerificationFailed("Unknown GnuPG key "\330 raise errors.SignatureVerificationFailed(
330 "verification result")331 "Unknown GnuPG key verification result")
331332
332 def set_acceptable_keys(self, command_line_input):333 def set_acceptable_keys(self, command_line_input):
333 """Set the acceptable keys for verifying with this GPGStrategy.334 """Set the acceptable keys for verifying with this GPGStrategy.
334335
=== modified file 'doc/en/release-notes/bzr-2.7.txt'
--- doc/en/release-notes/bzr-2.7.txt 2016-01-14 14:10:33 +0000
+++ doc/en/release-notes/bzr-2.7.txt 2016-01-21 10:35:05 +0000
@@ -76,6 +76,8 @@
76 suite. This can include new facilities for writing tests, fixes to 76 suite. This can include new facilities for writing tests, fixes to
77 spurious test failures and changes to the way things should be tested.77 spurious test failures and changes to the way things should be tested.
7878
79* Fix gpgme test failure starting on wily. (Vincent Ladeuil)
80
79* Fix racy http tests (TestBadStatusServer is so simple, it exposes a race81* Fix racy http tests (TestBadStatusServer is so simple, it exposes a race
80 in python 2.7.9. This happens only when both the http server and client82 in python 2.7.9. This happens only when both the http server and client
81 are run in the same process.). Only tests are affected.83 are run in the same process.). Only tests are affected.