API#

VM configuration#

host_config(*host_setup[, hw, mem, ...])

Declare host configuration.

parametrized_host_config(param_host_setups)

Declare parametrized host configurations.

Fixtures#

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.

hosts_once(request, vm_once, host_setup)

Function-scope fixture like hosts, but creates VM hosts for this test only.

Host plugins#

HostPlugin()

Base class for plugins that run code in a VM host.

Agent([capability, path])

Host plugin providing org.bluez.Agent1 test implementation.

Bdaddr()

Host plugin providing host.bdaddr.

Bluetoothctl([args])

Host plugin for starting and controlling one bluetoothctl process with pexpect.

Bluetoothd([debug, conf, args])

Host plugin starting Bluetoothd.

Btmon([args])

Host plugin running btmon and forwarding output to logging.

Call()

Host plugin providing host.call(func, *args, **kw) interface.

DbusSession()

Host plugin starting a private session D-Bus for VM-host plugins.

DbusSystem()

Host plugin starting a private system D-Bus for VM-host plugins.

LeAdvertiser([service_uuids, adv_type, ...])

Host plugin registering a minimal connectable org.bluez.LEAdvertisement1 object on a Bluetooth adapter.

Obexd()

Host plugin starting obexd.

Pexpect()

Host plugin for starting and controlling processes with pexpect, providing host.pexpect.spawn(...) interface.

Rcvbuf([rcvbuf])

Host plugin setting pipe buffer size defaults.

Exceptions#

RemoteError(exc, traceback)

Exception raised in a VM host and passed through RPC.

RemoteTimeoutError

Raised when an RPC call to a VM host does not reply within its timeout (see --vm-timeout).

Utilities#

LogStream(name[, pattern, tee, stream])

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

bluez_src_dir()

Location of the BlueZ source tree, as given by --bluez-src-dir.

default_timeout()

Return a default timeout, chosen to deal with VM load.

get_bdaddr([index])

Get bdaddr of controller with given index

get_dbus([session, private])

Get DBus system or session bus.

find_exe(subdir, name)

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

mainloop_assert(func)

Wrap function to assert it runs from GLib main loop

mainloop_invoke(func, *a, **kw)

Blocking invoke of func in GLib main loop.

mainloop_wrap(func)

Wrap function to run in GLib main loop thread

quoted(args)

Quote shell command

run(*args[, input, capture_output, timeout, ...])

Run a command and log its output while it executes.

wait_until(predicate, *a[, timeout])

Call predicate(*a, **kw) repeatedly until it returns true.

CoredumpWarning

Warning emitted if some process crashed and dumped core

KernelBugWarning

Warning emitted if kernel prints BUG:/WARNING: messages

SanitizerWarning

Warning emitted if a sanitizer report (e.g. AddressSanitizer) is found in the output of a test process.

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

Asynchronous event.

EventPluginMixin()

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

dbus_service_event_method(interface, name[, ...])

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

Host proxies#

The upper-tester objects used to access VM-host plugins. host.<name> is a PluginProxy unless a plugin exposes a value through value.

HostProxy(path, timeout, name[, ...])

Upper-tester representation of one VM host with loadable plugins.

PluginProxy()

Upper-tester RPC proxy for a VM-host plugin.

Internals#

Internal fixtures, used by host_config.

kernel(pytestconfig)

Fixture for kernel image.

hw_indices(pytestconfig)

Fixture for available HW USB controllers.

vm(request, kernel, vm_setup)

Package-scope virtual machine fixture.

vm_once(request, kernel, vm_setup)

Function-scope virtual machine fixture.

host_setup(request)

Host setup configuration

vm_setup(request)

VM setup configuration