API#

VM configuration#

pytest_bluezenv.host_config(*host_setup[, ...])

Declare host configuration.

pytest_bluezenv.parametrized_host_config(...)

Declare parametrized host configurations.

Fixtures#

pytest_bluezenv.hosts(request, vm, host_setup)

Function-scope fixture that expands to a list of VM host proxies (HostProxy), with configuration as specified in host_config.

pytest_bluezenv.hosts_once(request, vm_once, ...)

Function-scope fixture.

Host plugins#

pytest_bluezenv.HostPlugin()

Plugin to insert code to VM host side.

pytest_bluezenv.Agent([capability, path])

Host plugin providing org.bluez.Agent1 test implementation.

pytest_bluezenv.Bdaddr()

Host plugin providing host.bdaddr.

pytest_bluezenv.Bluetoothctl()

Host plugin for starting and controlling bluetoothctl with pexpect.

pytest_bluezenv.Bluetoothd([debug, conf, args])

Host plugin starting Bluetoothd.

pytest_bluezenv.Btmon([args])

Host plugin running btmon and forwarding output to logging.

pytest_bluezenv.Call()

Host plugin providing host.call(func, *args, **kw) and call_async which invoke the given functions on VM host side.

pytest_bluezenv.DbusSession()

Host plugin providing system DBus, at address impl.plugins["dbus-session"].address.

pytest_bluezenv.DbusSystem()

Host plugin providing system DBus, at address impl.plugins["dbus-system"].address.

pytest_bluezenv.Obexd()

Host plugin starting obexd.

pytest_bluezenv.Pexpect()

Host plugin for starting and controlling processes with pexpect.

pytest_bluezenv.Rcvbuf([rcvbuf])

Host plugin setting pipe buffer size defaults.

pytest_bluezenv.RemoteError(exc, traceback)

Exception raised on the VM side, passed through RPC.

Utilities#

pytest_bluezenv.LogStream(name[, pattern, ...])

Logger that forwards input from a stream to logging, and optionally tees to another stream.

pytest_bluezenv.get_bdaddr([index])

Get bdaddr of controller with given index

pytest_bluezenv.find_exe(subdir, name)

Find absolute path to the given executable, either within BlueZ build directory or on host.

pytest_bluezenv.mainloop_assert(func)

Wrap function to assert it runs from GLib main loop

pytest_bluezenv.mainloop_invoke(func, *a, **kw)

Blocking invoke of func in GLib main loop.

pytest_bluezenv.mainloop_wrap(func)

Wrap function to run in GLib main loop thread

pytest_bluezenv.quoted(args)

Quote shell command

pytest_bluezenv.run(*args[, input, ...])

Same as subprocess.run() but log output while running.

pytest_bluezenv.wait_until(predicate, *a[, ...])

pytest_bluezenv.Event(kind[, reply_cb, ...])

Asynchronous event.

pytest_bluezenv.EventPluginMixin()

Simple expect() / reply() pattern for handing async events in host plugins.

pytest_bluezenv.dbus_service_event_method(...)

dbus.service.method that pushes Event instances to self.events

Internals#

pytest_bluezenv.HostProxy(path, timeout, name)

Parent host-side representation of one VM host with loadable plugins.

pytest_bluezenv.PluginProxy()

Host-side proxy for a plugin: RPC calls

Internal fixtures:

pytest_bluezenv.host_setup(request)

Host setup configuration

pytest_bluezenv.kernel(pytestconfig)

Fixture for kernel image.

pytest_bluezenv.usb_indices(pytestconfig)

Fixture for available HW USB controllers.

pytest_bluezenv.vm(request, kernel, vm_setup)

Function-scope virtual machine fixture.

pytest_bluezenv.vm_once(request, kernel, ...)

Function-scope virtual machine fixture.

pytest_bluezenv.vm_setup(request)

VM setup configuration