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 <thomas.petazzoni@bootlin.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Thomas Petazzoni
2026-08-08 12:13:47 +02:00
committed by Julien Olivain
parent 6ceb2a8b06
commit 9fa59eb7db
3 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
import pyudev
context = pyudev.Context()
assert('/dev/ttyAMA0' in [ d.device_node for d in context.list_devices() ])

View File

@@ -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"]