From 9fa59eb7dbc4016086ff14cb3c9a3ebead507d08 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 8 Aug 2026 12:13:47 +0200 Subject: [PATCH] support/testing: add pyudev test In order to verify that pyudev works fine, including with just libudev-zero, add a basic test for this package. Signed-off-by: Thomas Petazzoni Signed-off-by: Julien Olivain --- DEVELOPERS | 2 ++ .../testing/tests/package/sample_python_pyudev.py | 4 ++++ support/testing/tests/package/test_python_pyudev.py | 12 ++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 support/testing/tests/package/sample_python_pyudev.py create mode 100644 support/testing/tests/package/test_python_pyudev.py diff --git a/DEVELOPERS b/DEVELOPERS index 56dd9f3943..353f4a2ccf 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -3285,6 +3285,7 @@ F: support/testing/tests/package/sample_python_augeas.py F: support/testing/tests/package/sample_python_flask.py F: support/testing/tests/package/sample_python_flask_expects_json.py F: support/testing/tests/package/sample_python_git.py +F: support/testing/tests/package/sample_python_pyudev.py F: support/testing/tests/package/sample_python_unittest_xml_reporting.py F: support/testing/tests/package/test_nodejs.py F: support/testing/tests/package/test_python_augeas.py @@ -3294,6 +3295,7 @@ F: support/testing/tests/package/test_python_flask_expects_json.py F: support/testing/tests/package/test_python_fs.py F: support/testing/tests/package/test_python_git.py F: support/testing/tests/package/test_python_pyfatfs.py +F: support/testing/tests/package/test_python_pyudev.py F: support/testing/tests/package/test_python_pyusb.py F: support/testing/tests/package/test_python_serial.py F: support/testing/tests/package/test_snagboot.py diff --git a/support/testing/tests/package/sample_python_pyudev.py b/support/testing/tests/package/sample_python_pyudev.py new file mode 100644 index 0000000000..8e4ae32511 --- /dev/null +++ b/support/testing/tests/package/sample_python_pyudev.py @@ -0,0 +1,4 @@ +import pyudev + +context = pyudev.Context() +assert('/dev/ttyAMA0' in [ d.device_node for d in context.list_devices() ]) diff --git a/support/testing/tests/package/test_python_pyudev.py b/support/testing/tests/package/test_python_pyudev.py new file mode 100644 index 0000000000..ec8985b31f --- /dev/null +++ b/support/testing/tests/package/test_python_pyudev.py @@ -0,0 +1,12 @@ +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3PyUdev(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_LIBUDEV_ZERO=y + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_PYUDEV=y + """ + sample_scripts = ["tests/package/sample_python_pyudev.py"]