diff --git a/DEVELOPERS b/DEVELOPERS index 2da5d178b2..af605b388e 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1103,6 +1103,8 @@ F: package/python-dunamai/ F: package/python-poetry-dynamic-versioning/ F: package/python-pyasynchat/ F: package/python-pyasyncore/ +F: support/testing/tests/package/sample_python_networkmanager_goi.py +F: support/testing/tests/package/test_python_networkmanager_goi.py N: Flávio Tapajós F: configs/asus_tinker-s_rk3288_defconfig diff --git a/support/testing/tests/package/sample_python_networkmanager_goi.py b/support/testing/tests/package/sample_python_networkmanager_goi.py new file mode 100644 index 0000000000..240e8437fd --- /dev/null +++ b/support/testing/tests/package/sample_python_networkmanager_goi.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +# This script is from https://networkmanager.dev/docs/developers/ + +import gi +gi.require_version("NM", "1.0") +from gi.repository import NM # noqa: E402 + + +def print_values(setting, key, value, flags, data): + print(" {}.{}: {}".format(setting.get_name(), key, value)) + + +# Create the client object. This automatically loads all the D-Bus +# tree and creates in-memory objects for connections, devices, access +# points, etc. +client = NM.Client.new(None) + +# Obtain a list of connection profiles ... +connections = client.get_connections() + +# ... and print their properties +for c in connections: + print("{}:".format(c.get_id())) + c.for_each_setting_value(print_values, None) + print("\n") diff --git a/support/testing/tests/package/test_python_networkmanager_goi.py b/support/testing/tests/package/test_python_networkmanager_goi.py new file mode 100644 index 0000000000..e755569fc1 --- /dev/null +++ b/support/testing/tests/package/test_python_networkmanager_goi.py @@ -0,0 +1,24 @@ +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3NetworkmanagerGoi(TestPythonPackageBase): + __test__ = True + # Can't use TestPythonPackageBase.config because we need headers + # >= 4.20 for network-manager, so we have to use the bleeding-edge + # toolchain. + config = \ + """ + BR2_arm=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV5_EABI_GLIBC_BLEEDING_EDGE=y + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_GOBJECT=y + BR2_INIT_SYSTEMD=y + BR2_PACKAGE_NETWORK_MANAGER=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + sample_scripts = ["tests/package/sample_python_networkmanager_goi.py"] + + timeout = 30