Pexpect#

class pytest_bluezenv.Pexpect[source]#

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

The host.pexpect object is a Proxy.

Example

btmgmt = host0.pexpect.spawn(find_exe("tools", "btmgmt"))
btmgmt.send("info\n")
btmgmt.expect("hci0")
btmgmt.close()

Example

with host0.pexpect.spawn(find_exe("tools", "btmgmt")) as btmgmt:
    btmgmt.send("info\n")
    btmgmt.expect("hci0")
__init__()[source]#

Configure a plugin on the upper tester at collection time.

Methods

close(ctl_id)

Close one spawned process and forget its handle.

expect(ctl_id, *a[, reject])

Wait for a pattern in one process' output.

expect_all(ctl_id, patterns[, reject, timeout])

Wait for all the given patterns in one process' output, in any order.

presetup(config)

Configure a plugin on the upper tester before VM hosts start.

send(ctl_id, *a, **kw)

Write to one process' standard input.

setup(impl)

Start the pexpect controller and publish it as host.pexpect (VM side).

spawn(cmd)

Start a process on the host and record it.

teardown()

Kill all processes spawned through this plugin (VM side).