diff options
Diffstat (limited to 'dev-python/python-gnupg')
4 files changed, 53 insertions, 57 deletions
diff --git a/dev-python/python-gnupg/Manifest b/dev-python/python-gnupg/Manifest index 959b6428ef64..c6ec19126538 100644 --- a/dev-python/python-gnupg/Manifest +++ b/dev-python/python-gnupg/Manifest @@ -1,9 +1,9 @@ -AUX python-gnupg-0.4.3-skip_network_needing_test.patch 2037 BLAKE2B 533de55c29a67c2be1f45c6a315a80f7eb913dee237ee735b72152153f62d037c301e7cff3b04231ca12cb0be1aa6d4678e41e5240e252a6b81d757651f7b585 SHA512 195ca392d94141b8396fdf9b984770f8920e2060db6654fc7aca224d716649e745f9f51c50080f6b15a89b2d6a85bba3155acb41839bc7bb511886bea2dc4532 -AUX python-gnupg-0.4.3-use_seperate_keys_directory.patch 2181 BLAKE2B 48aebfd208ee4d84d2144d6b4b829420e0517e4f45d87a01fff08fcf0af3788f2c042b52f9ed53d425288e00431c49d3e3b236bb30d072735c581acc0d3e8173 SHA512 0925e5c31ee1dccaea33ed3798ccd3b4544fc786597740028f3adedfb0c65b8d1dadd04428ff75a63a99aa76c9d4fa33ff6847b138226481c5fcb63fc7f5d3d2 +AUX python-gnupg-0.4.3-skip_network_needing_test.patch 2286 BLAKE2B df6f591f70a12b7241781eebc7cb6f2a425a9479bb02e2d482e69dff9beae4741bc931aee953e99306731ca77f405e9b12366b262d63c54cedc9168f2551f869 SHA512 2189702d0fe00afbff59c494de2c02d97a91fd264e3f241c2b6f4b376fd188110b1da2ba27700cfc92fe6dc8b3246ecb8a072933a1fca3d7d3929d6cf0acaa76 +AUX python-gnupg-0.4.3-use_seperate_keys_directory.patch 1847 BLAKE2B 5488b55302336f4ddccea517684f1825b6a52f3100989c871846e6b140e98869ca682ad062507f8b3c5af9e99833c995d5737bc7e69597d247fbd6b68c71c507 SHA512 fee4817a26f934c5e7c216a0390abd3d1375168467e2695e1b35be34eed2b279bbfa8ba32ebe0347913a7750111b00c05264418f758c56f094c91e7c2b7ece52 DIST python-gnupg-0.4.0.tar.gz 43987 BLAKE2B 59e72f894c5d554ba2a7c348ad3625500798ad6ac18332a3bb668b42559f52b58e3cd0f8b79ef1a99f37e796b48169d0bf36414e938e9039784cede4303cbb03 SHA512 f486ec97aee01cf46d055421211ff5704093a382155043b7ced6f809dc15d7669d5869038a1b26c5f1831076d85c929d781bc22e35ab293a14bc6e2f5f27fa32 DIST python-gnupg-0.4.1.tar.gz 44534 BLAKE2B 0b58312b9f094b29f7009bb7a44ea3607be826ae2fda958dae0ba9dd5a2d7f81843fe23a6fe336b9df85c059e5b114787dab372df42b14b83cb73fb02abee919 SHA512 0920a1de4d98a745f7747280672975db04c40b59ea4436745cdbefa86a0c88bfdc086d6dd312c82a0a9e9f8cafb5651f8e17d86e0ee37282b5fc36e7ac8d1a1e DIST python-gnupg-0.4.3.tar.gz 46958 BLAKE2B c83b13f8b36c136ac75e8a69dccb07025be3397284e27d9624677cd76ac8527bed67644be7a00958fdb248772a0c37de09257fb711eb16a2c982dbca0368dbd6 SHA512 9381acb1246b6ceec4de21091f2ce57dba9c6600dfb52ddee181effbd2e749d18935e6b6bb2183816064e9129cd1bb3ebfdd28a5dcddc9be1c56261a501067d8 EBUILD python-gnupg-0.4.0.ebuild 668 BLAKE2B 997b51a02c0d170687385fd2970af5fa43872d055414e76a3bce2b17d37f39511572b9ace9d97ac94c4ae9e1141fd582df2b3073c9b294e2c73fc5eb3de5054b SHA512 360bae4d63ae2834971f548f00be76065a38f5456e0387fe4fa4810d9b4fc66be0ef2846a5581d92a6890c5e5e18732ae75c375f71863bfac89272702e9bd388 EBUILD python-gnupg-0.4.1.ebuild 654 BLAKE2B 77e2eb575c2376b94ea96bc0244ac00af0d0c17cd5f7f3ffee1e5a89559dd5c1acd789e75a0a45a51768123040fdbc0b5a1bfb1938b0477874acb5dfe41546dc SHA512 828537af3a81c46752c7ec0af2291cf0f38382bfffcc113c3664f63360783d57c0efe7a6412b0743e2cacdea7eeee8a8602ae7d72ce8c78fe613b16ec95694ee -EBUILD python-gnupg-0.4.3.ebuild 701 BLAKE2B 28aedea3a9e6f90a9c15c99b6417b3cd1de351c4980b7c47b8c1ad3a71ea157a7ab684ed0d2e2e3a18074dada0c3de51ec25f5765669eb64b25252521c4283f0 SHA512 3a01c29863da781112d817d289bf962df97aaf41c8cc55dd0d9393b93d6d3861ec26eb6e016ee8d5950ecbc58a6b36acff1974c85b0423f97a5ba60765fd9202 +EBUILD python-gnupg-0.4.3.ebuild 812 BLAKE2B 1db0342e433a84ede71b2ab854646620c13a757a5766a3f752c72dcf505ea7364d0db9a7574ddefc829d23cfbc34ffcaa09601a34eaef18850d9e0c724b2f800 SHA512 cd5b487747e7341968491f1c85a6c1099bc3aadcd797a83907e033389fb9cecd8128698feca5eb53293919a886b09e4562be9f0d11c52649e994cdc09e37dc83 MISC metadata.xml 645 BLAKE2B 23e7cfc3792cd9aa1c8eac9c52fe3d01076f93880a17f4fd8aed0c6c30d8e00b866a9f3e71664ca08c41d1a8a6ea4a1ef55a01d6b12285ce36aa0654e2a837ba SHA512 77f5c9739da1875f655257da826acdb16e5dbdbac02f5c05ab66a91c842d63b478b26af52901fb6dcb2ab0b6ea19c3ffd09e761ddcb1df0d5e55d25c105fbc65 diff --git a/dev-python/python-gnupg/files/python-gnupg-0.4.3-skip_network_needing_test.patch b/dev-python/python-gnupg/files/python-gnupg-0.4.3-skip_network_needing_test.patch index 2e5b4145182f..f6df14348c1a 100644 --- a/dev-python/python-gnupg/files/python-gnupg-0.4.3-skip_network_needing_test.patch +++ b/dev-python/python-gnupg/files/python-gnupg-0.4.3-skip_network_needing_test.patch @@ -1,49 +1,51 @@ -From: Elena Grandi <elena.valhalla@gmail.com> -Date: Thu, 8 Oct 2015 12:11:21 -0700 -Subject: Skip tests that require internet access - -Forwarded: not-needed -Patch-Name: skip_network_needing_test.patch ---- - gnupg.py | 8 ++++---- - test_gnupg.py | 1 + - 2 files changed, 5 insertions(+), 4 deletions(-) +# HG changeset patch +# User Vinay Sajip <vinay_sajip@yahoo.co.uk> +# Date 1528916733 -3600 +# Node ID f16d4e17cf349cf9ee561e117262a4041e4fe2ee +# Parent 60ece27e564ef381392dc19a544aa289fb598c7e +Conditionally skip tests that rely on flaky external servers/networks. diff --git a/gnupg.py b/gnupg.py -index cd662d4..bf6dc64 100644 --- a/gnupg.py +++ b/gnupg.py -@@ -1117,8 +1117,8 @@ class GPG(object): - >>> GPGBINARY = os.environ.get('GPGBINARY', 'gpg') +@@ -1118,7 +1118,7 @@ >>> gpg = GPG(gpgbinary=GPGBINARY, gnupghome="keys") >>> os.chmod('keys', 0x1C0) -- >>> result = gpg.recv_keys('pgp.mit.edu', '92905378') + >>> result = gpg.recv_keys('pgp.mit.edu', '92905378') - >>> assert result -+ >>> result = gpg.recv_keys('pgp.mit.edu', '92905378') # doctest: +SKIP -+ >>> assert result # doctest: +SKIP ++ >>> if 'NO_EXTERNAL_TESTS' not in os.environ: assert result """ result = self.result_map['import'](self) -@@ -1320,8 +1320,8 @@ class GPG(object): - >>> GPGBINARY = os.environ.get('GPGBINARY', 'gpg') +@@ -1321,7 +1321,7 @@ >>> gpg = GPG(gpgbinary=GPGBINARY, gnupghome='keys') >>> os.chmod('keys', 0x1C0) -- >>> result = gpg.search_keys('<vinay_sajip@hotmail.com>') + >>> result = gpg.search_keys('<vinay_sajip@hotmail.com>') - >>> assert result, 'Failed using default keyserver' -+ >>> result = gpg.search_keys('<vinay_sajip@hotmail.com>') # doctest: +SKIP -+ >>> assert result, 'Failed using default keyserver' # doctest: +SKIP ++ >>> if 'NO_EXTERNAL_TESTS' not in os.environ: assert result, 'Failed using default keyserver' >>> #keyserver = 'keyserver.ubuntu.com' >>> #result = gpg.search_keys('<vinay_sajip@hotmail.com>', keyserver) >>> #assert result, 'Failed using keyserver.ubuntu.com' diff --git a/test_gnupg.py b/test_gnupg.py -index 7a5b705..25817da 100644 --- a/test_gnupg.py +++ b/test_gnupg.py -@@ -834,6 +834,7 @@ class GPGTestCase(unittest.TestCase): - logger.debug("test_filename_with_spaces ends") - +@@ -836,12 +836,13 @@ #@skipIf(os.name == 'nt', 'Test not suitable for Windows') -+ @unittest.skip('requires network') def test_search_keys(self): "Test that searching for keys works" - r = self.gpg.search_keys('<vinay_sajip@hotmail.com>') +- r = self.gpg.search_keys('<vinay_sajip@hotmail.com>') +- self.assertTrue(r) +- self.assertTrue('Vinay Sajip <vinay_sajip@hotmail.com>' in r[0]['uids']) +- r = self.gpg.search_keys('92905378') +- self.assertTrue(r) +- self.assertTrue('Vinay Sajip <vinay_sajip@hotmail.com>' in r[0]['uids']) ++ if 'NO_EXTERNAL_TESTS' not in os.environ: ++ r = self.gpg.search_keys('<vinay_sajip@hotmail.com>') ++ self.assertTrue(r) ++ self.assertTrue('Vinay Sajip <vinay_sajip@hotmail.com>' in r[0]['uids']) ++ r = self.gpg.search_keys('92905378') ++ self.assertTrue(r) ++ self.assertTrue('Vinay Sajip <vinay_sajip@hotmail.com>' in r[0]['uids']) + + def test_quote_with_shell(self): + "Test shell quoting with a real shell" diff --git a/dev-python/python-gnupg/files/python-gnupg-0.4.3-use_seperate_keys_directory.patch b/dev-python/python-gnupg/files/python-gnupg-0.4.3-use_seperate_keys_directory.patch index b5318ede0d87..b57137200990 100644 --- a/dev-python/python-gnupg/files/python-gnupg-0.4.3-use_seperate_keys_directory.patch +++ b/dev-python/python-gnupg/files/python-gnupg-0.4.3-use_seperate_keys_directory.patch @@ -1,30 +1,14 @@ # HG changeset patch -# User Michał Górny <mgorny@gentoo.org> -# Date 1533916222 -7200 -# Node ID 2c8991b1c9080adc61e63d00fe9415b88f3e6208 -# Parent 9cb2a856677237b528ead6fff68de7d488dbfeec -Use private temporary GPG-homes for tests to fix race conditions. - -Create unique temporary directories to use as GPG home in each test -instead of reusing a single hardcoded 'keys' directory. This is -necessary to fix race conditions between directory operations -and gpg-agent in GnuPG 2.0+. - -GnuPG 2.0 started using gpg-agent for all operations. It is -automatically spawned when GPG is called to do something, and it stops -automatically when its homedir is removed (e.g. as part of rmtree() -call). However, with the homedir being instantly recreated and next -test being run, it seems that gpg-agent sometimes failed to stop fully -before being started again and causes one of the tests to fail with -gpg-agent connection errors. - -With this change, I am finally able to successfully run all tests -in a single batch. +# User Vinay Sajip <vinay_sajip@yahoo.co.uk> +# Date 1534104706 -3600 +# Node ID aeb916c839c0f556dae96bb1136be760ccc19cfe +# Parent 1a5795e58fe216c1227a11d169dbe4c09c625d15 +Fixed problem with a fixed 'keys' homedir on slow/busy systems (see PR #24). diff --git a/test_gnupg.py b/test_gnupg.py --- a/test_gnupg.py +++ b/test_gnupg.py -@@ -173,11 +173,7 @@ +@@ -173,11 +173,14 @@ class GPGTestCase(unittest.TestCase): def setUp(self): @@ -33,21 +17,29 @@ diff --git a/test_gnupg.py b/test_gnupg.py - self.assertTrue(os.path.isdir(hd), - "Not a directory: %s" % hd) - shutil.rmtree(hd, ignore_errors=True) -+ hd = tempfile.mkdtemp() ++ if 'STATIC_TEST_HOMEDIR' not in os.environ: ++ hd = tempfile.mkdtemp(prefix='keys-') ++ else: ++ hd = os.path.join(os.getcwd(), 'keys') ++ if os.path.exists(hd): ++ self.assertTrue(os.path.isdir(hd), ++ "Not a directory: %s" % hd) ++ shutil.rmtree(hd, ignore_errors=True) prepare_homedir(hd) self.homedir = hd self.gpg = gpg = gnupg.GPG(gnupghome=hd, gpgbinary=GPGBINARY) -@@ -193,6 +189,9 @@ +@@ -193,6 +196,10 @@ data_file.write(os.urandom(5120 * 1024)) data_file.close() + def tearDown(self): -+ shutil.rmtree(self.homedir, ignore_errors=True) ++ if 'STATIC_TEST_HOMEDIR' not in os.environ: ++ shutil.rmtree(self.homedir, ignore_errors=True) + def test_environment(self): "Test the environment by ensuring that setup worked" hd = self.homedir -@@ -373,7 +372,7 @@ +@@ -373,7 +380,7 @@ # and the keyring file name has changed. pkn = 'pubring.kbx' skn = None diff --git a/dev-python/python-gnupg/python-gnupg-0.4.3.ebuild b/dev-python/python-gnupg/python-gnupg-0.4.3.ebuild index f5deea7ec6ed..419c69562293 100644 --- a/dev-python/python-gnupg/python-gnupg-0.4.3.ebuild +++ b/dev-python/python-gnupg/python-gnupg-0.4.3.ebuild @@ -25,5 +25,7 @@ PATCHES=( ) python_test() { - "${PYTHON}" test_gnupg.py || die "Tests failed with ${EPYTHON}" + # NO_EXTERNAL_TESTS must be enabled, + # to disable all tests, which need internet access. + NO_EXTERNAL_TESTS=1 "${PYTHON}" test_gnupg.py || die "Tests failed with ${EPYTHON}" } |