mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 22:11:59 -09:00
support/testing: add new test for python-sdbus-networkmanager
Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
committed by
Yann E. MORIN
parent
00514d75e0
commit
2223d81bd8
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sdbus
|
||||
|
||||
from sdbus_block.networkmanager import (
|
||||
DeviceType,
|
||||
NetworkManager,
|
||||
NetworkDeviceGeneric
|
||||
)
|
||||
|
||||
sdbus.set_default_bus(sdbus.sd_bus_open_system())
|
||||
|
||||
nm = NetworkManager()
|
||||
devices = [NetworkDeviceGeneric(d) for d in nm.get_devices()]
|
||||
|
||||
print([d.interface for d in devices])
|
||||
|
||||
assert devices
|
||||
# Check that we found at least the loopback interface:
|
||||
assert [dev for dev in devices if dev.device_type == DeviceType.LOOPBACK]
|
||||
@@ -0,0 +1,15 @@
|
||||
from tests.package.test_python import TestPythonPackageBase
|
||||
|
||||
|
||||
class TestPythonPy3SdbusNetworkmanager(TestPythonPackageBase):
|
||||
__test__ = True
|
||||
config = TestPythonPackageBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_INIT_SYSTEMD=y
|
||||
BR2_PACKAGE_NETWORK_MANAGER=y
|
||||
BR2_PACKAGE_PYTHON_SDBUS_NETWORKMANAGER=y
|
||||
"""
|
||||
sample_scripts = ["tests/package/sample_python_sdbus_networkmanager.py"]
|
||||
|
||||
timeout = 30
|
||||
Reference in New Issue
Block a user