1import textwrap 2 3 4from tests.package.test_python import TestPythonPackageBase 5 6 7class TestPythonPy3DBusNext(TestPythonPackageBase): 8 __test__ = True 9 config = TestPythonPackageBase.config + \ 10 """ 11 BR2_PACKAGE_DBUS=y 12 BR2_PACKAGE_PYTHON3=y 13 BR2_PACKAGE_PYTHON_DBUS_NEXT=y 14 """ 15 sample_scripts = ["tests/package/sample_python_dbus_next.py"] 16 17 def run_sample_scripts(self): 18 config = \ 19 """ 20 <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" 21 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> 22 <busconfig> 23 <policy user="root"> 24 <allow own="dbus.next.sample"/> 25 <allow send_destination="dbus.next.sample"/> 26 </policy> 27 </busconfig> 28 """ 29 config = textwrap.dedent(config) 30 config_dir = "/etc/dbus-1/system.d" 31 config_fn = "dbus.next.sample.conf" 32 33 # Setup and reload D-Bus configuration 34 self.emulator.run("mkdir -p " + config_dir) 35 self.emulator.run("cat > " + config_dir + "/" + config_fn + 36 " <<EOF" + config + "EOF") 37 self.emulator.run("killall -SIGHUP dbus-daemon") 38 39 # Run test scripts 40 super().run_sample_scripts() 41