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

Proposed by Vincent Ladeuil on 2016-01-21
Status: Merged
Approved by: Richard Wilbur on 2016-01-21
Approved revision: 6611
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 2016-01-21 Approve on 2016-01-21
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.
Richard Wilbur (richard-wilbur) wrote :

Good work! Thanks, Vincent!
+2

review: Approve
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
1=== modified file 'bzrlib/gpg.py'
2--- bzrlib/gpg.py 2013-11-10 15:29:06 +0000
3+++ bzrlib/gpg.py 2016-01-21 10:35:05 +0000
4@@ -1,4 +1,4 @@
5-# Copyright (C) 2005, 2011 Canonical Ltd
6+# Copyright (C) 2005, 2006, 2007, 2009, 2011, 2012, 2013, 2016 Canonical Ltd
7 # Authors: Robert Collins <robert.collins@canonical.com>
8 #
9 # This program is free software; you can redistribute it and/or modify
10@@ -322,12 +322,13 @@
11 return SIGNATURE_NOT_VALID, None
12 # A signature from a revoked key gets this.
13 # test_verify_revoked_signature()
14- if result[0].summary & gpgme.SIGSUM_SYS_ERROR:
15+ if ((result[0].summary & gpgme.SIGSUM_SYS_ERROR
16+ or result[0].status.strerror == 'Certificate revoked')):
17 return SIGNATURE_NOT_VALID, None
18 # Other error types such as revoked keys should (I think) be caught by
19 # SIGSUM_RED so anything else means something is buggy.
20- raise errors.SignatureVerificationFailed("Unknown GnuPG key "\
21- "verification result")
22+ raise errors.SignatureVerificationFailed(
23+ "Unknown GnuPG key verification result")
24
25 def set_acceptable_keys(self, command_line_input):
26 """Set the acceptable keys for verifying with this GPGStrategy.
27
28=== modified file 'doc/en/release-notes/bzr-2.7.txt'
29--- doc/en/release-notes/bzr-2.7.txt 2016-01-14 14:10:33 +0000
30+++ doc/en/release-notes/bzr-2.7.txt 2016-01-21 10:35:05 +0000
31@@ -76,6 +76,8 @@
32 suite. This can include new facilities for writing tests, fixes to
33 spurious test failures and changes to the way things should be tested.
34
35+* Fix gpgme test failure starting on wily. (Vincent Ladeuil)
36+
37 * Fix racy http tests (TestBadStatusServer is so simple, it exposes a race
38 in python 2.7.9. This happens only when both the http server and client
39 are run in the same process.). Only tests are affected.