Skip to contentSkip to conversation

support/testing: add python-asn1crypto runtime test

PATCH In review Marcus Hoffmann via buildroot 2 participants 3 messages Feb 12, 2024 – Aug 27, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support/testing: add python-asn1crypto runtime test

---
 .../tests/package/sample_python_asn1crypto.py       | 11 +++++++++++
 .../testing/tests/package/test_python_asn1crypto.py | 13 +++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_asn1crypto.py
 create mode 100644 support/testing/tests/package/test_python_asn1crypto.py
support/testing/tests/package/sample_python_asn1crypto.py new file +11 -0
new file mode 100644
index 0000000000..0b10487572
@@ -0,0 +1,11 @@
+from asn1crypto import pem, x509
+
+
+with open('/etc/ssl/certs/ISRG_Root_X2.pem', 'rb') as f:
+    der_bytes = f.read()
+    if pem.detect(der_bytes):
+        type_name, headers, der_bytes = pem.unarmor(der_bytes)
+
+cert = x509.Certificate.load(der_bytes)
+
+assert cert.subject.native["common_name"] == "ISRG Root X2"
support/testing/tests/package/test_python_asn1crypto.py new file +13 -0
new file mode 100644
index 0000000000..97df3d3ac8
@@ -0,0 +1,13 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3Asn1Crypto(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_CA_CERTIFICATES=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_ASN1CRYPTO=y
+        """
+    sample_scripts = ["tests/package/sample_python_asn1crypto.py"]
+    timeout = 40
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 7 lines · On Mon, 12 Feb 2024 13:56:49 +0100 Marcus Hoffmann via buildroot…
---
 .../tests/package/sample_python_asn1crypto.py       | 11 +++++++++++
 .../testing/tests/package/test_python_asn1crypto.py | 13 +++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_asn1crypto.py
 create mode 100644 support/testing/tests/package/test_python_asn1crypto.py

You forgot the entries in the DEVELOPERS, so I added them and applied. Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Marcus Hoffmann via buildroot
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Marcus" == Marcus Hoffmann via buildroot <[email protected]> writes:

Committed to 2024.02.x and 2024.05.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot