From 4c74afbcaabbe4ecd59d1af556c11f1352a6ac4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= Date: Fri, 5 Jul 2024 11:14:07 +0200 Subject: [PATCH] support/testing: add new test for python-sdbus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Mélotte Signed-off-by: Yann E. MORIN --- DEVELOPERS | 2 ++ .../testing/tests/package/sample_python_sdbus.py | 13 +++++++++++++ support/testing/tests/package/test_python_sdbus.py | 12 ++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 support/testing/tests/package/sample_python_sdbus.py create mode 100644 support/testing/tests/package/test_python_sdbus.py diff --git a/DEVELOPERS b/DEVELOPERS index 58d365ce8e..4b0bde095f 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2764,10 +2764,12 @@ F: support/testing/tests/package/sample_python_jmespath.py F: support/testing/tests/package/sample_python_pymupdf.py F: support/testing/tests/package/sample_python_rsa.py F: support/testing/tests/package/sample_python_s3transfer.py +F: support/testing/tests/package/sample_python_sdbus.py F: support/testing/tests/package/test_python_jmespath.py F: support/testing/tests/package/test_python_pymupdf.py F: support/testing/tests/package/test_python_rsa.py F: support/testing/tests/package/test_python_s3transfer.py +F: support/testing/tests/package/test_python_sdbus.py N: Raphael Pavlidis F: package/nvidia-persistenced/ diff --git a/support/testing/tests/package/sample_python_sdbus.py b/support/testing/tests/package/sample_python_sdbus.py new file mode 100644 index 0000000000..68131cede5 --- /dev/null +++ b/support/testing/tests/package/sample_python_sdbus.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import sdbus +from sdbus_block.dbus_daemon import FreedesktopDbus + +s = FreedesktopDbus(sdbus.sd_bus_open_system()) + +props = s.properties_get_all_dict() + +print(props) + +# Check for a randomly chosen interface: +assert 'org.freedesktop.DBus.Monitoring' in props['interfaces'] diff --git a/support/testing/tests/package/test_python_sdbus.py b/support/testing/tests/package/test_python_sdbus.py new file mode 100644 index 0000000000..7163bbeed1 --- /dev/null +++ b/support/testing/tests/package/test_python_sdbus.py @@ -0,0 +1,12 @@ +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3Sdbus(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_PYTHON3=y + BR2_INIT_SYSTEMD=y + BR2_PACKAGE_PYTHON_SDBUS=y + """ + sample_scripts = ["tests/package/sample_python_sdbus.py"]