diff options
3 files changed, 37 insertions, 20 deletions
diff --git a/meta/recipes-devtools/python/python3-cryptography/fix-leak-metric.patch b/meta/recipes-devtools/python/python3-cryptography/fix-leak-metric.patch new file mode 100644 index 0000000000..904984f43d --- /dev/null +++ b/meta/recipes-devtools/python/python3-cryptography/fix-leak-metric.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | Trigger hashlib initialisation so that the test_create_certificate_with_extensions | ||
| 2 | test doesn't fail. | ||
| 3 | |||
| 4 | Upstream-Status: Backport | ||
| 5 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 6 | |||
| 7 | From dc989d563ab6a078651160e5e6d4ee3df8cb08d7 Mon Sep 17 00:00:00 2001 | ||
| 8 | From: Alex Gaynor <alex.gaynor@gmail.com> | ||
| 9 | Date: Thu, 7 Apr 2022 03:15:09 -0400 | ||
| 10 | Subject: [PATCH] Added Ubuntu Jammy to CI (#7047) | ||
| 11 | |||
| 12 | * Added Ubuntu Jammy to CI | ||
| 13 | |||
| 14 | * try thing | ||
| 15 | --- | ||
| 16 | .github/workflows/ci.yml | 1 + | ||
| 17 | docs/installation.rst | 2 +- | ||
| 18 | tests/hazmat/backends/test_openssl_memleak.py | 3 +++ | ||
| 19 | 3 files changed, 5 insertions(+), 1 deletion(-) | ||
| 20 | |||
| 21 | diff --git a/tests/hazmat/backends/test_openssl_memleak.py b/tests/hazmat/backends/test_openssl_memleak.py | ||
| 22 | index 835c9256a6..2605566bd5 100644 | ||
| 23 | --- a/tests/hazmat/backends/test_openssl_memleak.py | ||
| 24 | +++ b/tests/hazmat/backends/test_openssl_memleak.py | ||
| 25 | @@ -82,8 +82,11 @@ def free(ptr, path, line): | ||
| 26 | assert result == 1 | ||
| 27 | |||
| 28 | # Trigger a bunch of initialization stuff. | ||
| 29 | + import hashlib | ||
| 30 | from cryptography.hazmat.backends.openssl.backend import backend | ||
| 31 | |||
| 32 | + hashlib.sha256() | ||
| 33 | + | ||
| 34 | start_heap = set(heap) | ||
| 35 | |||
| 36 | try: | ||
diff --git a/meta/recipes-devtools/python/python3-cryptography/skip-leaky-test.patch b/meta/recipes-devtools/python/python3-cryptography/skip-leaky-test.patch deleted file mode 100644 index 64248d57bd..0000000000 --- a/meta/recipes-devtools/python/python3-cryptography/skip-leaky-test.patch +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | Mark as test as expected-failure, OpenSSL is leaking memory. | ||
| 2 | |||
| 3 | xfail not skip so we can remove this when OpenSSL doesn't leak anymore. | ||
| 4 | |||
| 5 | Upstream-Status: Inappropriate | ||
| 6 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 7 | |||
| 8 | diff --git a/tests/hazmat/backends/test_openssl_memleak.py b/tests/hazmat/backends/test_openssl_memleak.py | ||
| 9 | index 835c9256..639f6ba2 100644 | ||
| 10 | --- a/tests/hazmat/backends/test_openssl_memleak.py | ||
| 11 | +++ b/tests/hazmat/backends/test_openssl_memleak.py | ||
| 12 | @@ -466,6 +466,7 @@ class TestOpenSSLMemoryLeaks: | ||
| 13 | ) | ||
| 14 | ) | ||
| 15 | |||
| 16 | + @pytest.mark.xfail(reason="has memory leaks") | ||
| 17 | def test_create_certificate_with_extensions(self): | ||
| 18 | assert_no_memory_leaks( | ||
| 19 | textwrap.dedent( | ||
diff --git a/meta/recipes-devtools/python/python3-cryptography_36.0.2.bb b/meta/recipes-devtools/python/python3-cryptography_36.0.2.bb index cb3acdf7e2..9ef5ff39c8 100644 --- a/meta/recipes-devtools/python/python3-cryptography_36.0.2.bb +++ b/meta/recipes-devtools/python/python3-cryptography_36.0.2.bb | |||
| @@ -16,7 +16,7 @@ SRC_URI += " \ | |||
| 16 | file://check-memfree.py \ | 16 | file://check-memfree.py \ |
| 17 | file://0001-Cargo.toml-specify-pem-version.patch \ | 17 | file://0001-Cargo.toml-specify-pem-version.patch \ |
| 18 | file://0002-Cargo.toml-edition-2018-2021.patch \ | 18 | file://0002-Cargo.toml-edition-2018-2021.patch \ |
| 19 | file://skip-leaky-test.patch \ | 19 | file://fix-leak-metric.patch \ |
| 20 | " | 20 | " |
| 21 | 21 | ||
| 22 | inherit pypi python_setuptools3_rust | 22 | inherit pypi python_setuptools3_rust |
