[Buildroot] [PATCH 2/2] support/testing: add pyudev test

Thomas Petazzoni via buildroot <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
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 <[email protected]>
---
 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"]
-- 
2.55.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.