Fix test failure of test_XXX caused by upgrade of gpgme from 1.6.0 to 1.8.0: ====================================================================== FAIL: test_encrypt_to_signonly (tests.test_encrypt_decrypt.EncryptDecryptTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/tmp/guix-build-python2-pygpgme-0.3.drv-0/pygpgme-0.3/tests/test_encrypt_decrypt.py", line 185, in test_encrypt_to_signonly self.assertEqual(exc.args[0], gpgme.ERR_SOURCE_UNKNOWN) AssertionError: 7 != 0 ---------------------------------------------------------------------- Patch copied from the Debian package pygpgme-0.3-1.2: https://sources.debian.net/src/pygpgme/0.3-1.2/debian/patches/0005-Fix-test-failures-with-pinentry.patch/ From: "Dr. Tobias Quathamer" Date: Thu, 24 Nov 2016 12:20:54 +0100 Subject: Fix test failures with pinentry --- tests/test_encrypt_decrypt.py | 5 +++-- tests/test_passphrase.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_encrypt_decrypt.py b/tests/test_encrypt_decrypt.py index 21ae83e..05707e1 100644 --- a/tests/test_encrypt_decrypt.py +++ b/tests/test_encrypt_decrypt.py @@ -132,6 +132,7 @@ class EncryptDecryptTestCase(GpgHomeTestCase): os.write(fd, b'Symmetric passphrase\n') ctx = gpgme.Context() ctx.armor = True + ctx.pinentry_mode = gpgme.PINENTRY_MODE_LOOPBACK ctx.passphrase_cb = passphrase ctx.encrypt(None, 0, plaintext, ciphertext) self.assertTrue( @@ -182,8 +183,8 @@ class EncryptDecryptTestCase(GpgHomeTestCase): ctx.encrypt([recipient], gpgme.ENCRYPT_ALWAYS_TRUST, plaintext, ciphertext) except gpgme.GpgmeError as exc: - self.assertEqual(exc.args[0], gpgme.ERR_SOURCE_UNKNOWN) - self.assertEqual(exc.args[1], gpgme.ERR_GENERAL) + self.assertEqual(exc.args[0], gpgme.ERR_SOURCE_GPGME) + self.assertEqual(exc.args[1], gpgme.ERR_UNUSABLE_PUBKEY) else: self.fail('gpgme.GpgmeError not raised') diff --git a/tests/test_passphrase.py b/tests/test_passphrase.py index 35b3c59..05e6811 100644 --- a/tests/test_passphrase.py +++ b/tests/test_passphrase.py @@ -34,6 +34,7 @@ class PassphraseTestCase(GpgHomeTestCase): ctx = gpgme.Context() key = ctx.get_key('EFB052B4230BBBC51914BCBB54DCBBC8DBFB9EB3') ctx.signers = [key] + ctx.pinentry_mode = gpgme.PINENTRY_MODE_LOOPBACK plaintext = BytesIO(b'Hello World\n') signature = BytesIO() @@ -55,6 +56,7 @@ class PassphraseTestCase(GpgHomeTestCase): ctx = gpgme.Context() key = ctx.get_key('EFB052B4230BBBC51914BCBB54DCBBC8DBFB9EB3') ctx.signers = [key] + ctx.pinentry_mode = gpgme.PINENTRY_MODE_LOOPBACK ctx.passphrase_cb = self.passphrase_cb plaintext = BytesIO(b'Hello World\n') signature = BytesIO() org. * guix/store.scm (%default-substitute-urls): Add bordeaux.guix.gnu.org. * doc/guix.texi: Adjust accordingly. * doc/contributing.texi: Adjust accordingly. Christopher Baines 2020-12-11maint: Remove unused 'NIX_VERSION' macro....* config-daemon.ac: Do not define NIX_VERSION. Ludovic Courtès 2020-12-11maint: Avoid macros obsolete in Autoconf 2.70....* configure.ac: Require Autoconf 2.69. Use 'AS_HELP_STRING' instead of 'AC_HELP_STRING'. * m4/guix.m4: Likewise. * config-daemon.ac: Use 'AC_CONFIG_HEADERS' instead of the singular variant. Ludovic Courtès 2019-11-27daemon: GC remove-unused-links phase uses 'statx' when available....* config-daemon.ac: Check for 'statx'. * nix/libstore/gc.cc (LocalStore::removeUnusedLinks) [HAVE_STATX]: Use 'statx' instead of 'lstat'. Ludovic Courtès 2019-11-13daemon: Don't include <linux/fs.h>....As of GNU libc 2.29, <sys/mount.h> declares all the constants and functions we need, so there's no use in including <linux/fs.h> anymore. This silences annoying warnings like this one: In file included from nix/libstore/local-store.cc:32:0: /gnu/store/…-linux-libre-headers-4.19.56/include/linux/fs.h:108:0: warning: "MS_RDONLY" redefined #define MS_RDONLY 1 /* Mount read-only */ In file included from nix/libstore/local-store.cc:28:0: /gnu/store/…-glibc-2.29/include/sys/mount.h:36:0: note: this is the location of the previous definition #define MS_RDONLY MS_RDONLY * config-daemon.ac: Remove check for <linux/fs.h>. * nix/libstore/build.cc: Remove conditional inclusion of <linux/fs.h>. * nix/libstore/local-store.cc: Remove "#if HAVE_LINUX_FS_H" and inclusion of <linux/fs.h>. Ludovic Courtès