Bluetoothctl#

class pytest_bluezenv.Bluetoothctl(args=())[source]#

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

Parameters:

args (sequence) – extra command-line arguments for bluetoothctl.

Depends on Bluetoothd.

Example

@host_config([Bluetoothctl()])
def test_info(hosts):
    hosts[0].bluetoothctl.send("show\n")

Example

# Accept pairing and authorize services without prompting
@host_config([Bluetoothctl(args=("-a", "auto:NoInputNoOutput"))])
def test_pair(hosts):
    ...
__init__(args=())[source]#

Configure a plugin on the upper tester at collection time.

Methods

expect(*a[, reject])

Wait for a pattern in the bluetoothctl output.

expect_all(patterns[, reject, timeout])

Wait for all the given patterns in the bluetoothctl output, in any order.

presetup(config)

Locate bluetoothctl on the parent host (skip if absent).

send(*a, **kw)

Write a command to the bluetoothctl prompt.

setup(impl)

Spawn bluetoothctl under pexpect (VM side).

teardown()

Close the bluetoothctl process (VM side).