pytest BlueZ environment plugin
Project description
pytest-bluezenv Pytest plugin is used for functional testing of BlueZ and kernel using multiple virtual machine environments, connected by real or virtual controllers.
Source code: https://github.com/pv/pytest-bluezenv/
Documentation: https://pv.github.io/pytest-bluezenv/
Example
from pytest_bluezenv import host_config, Bluetoothd, Bluetoothctl
@host_config(
[Bluetoothd(), Bluetoothctl()],
[Bluetoothd(), Bluetoothctl()],
)
def test_bluetoothctl_pair(hosts):
host0, host1 = hosts
host0.bluetoothctl.send("scan on\n")
host0.bluetoothctl.expect(f"Controller {host0.bdaddr.upper()} Discovering: yes")
host1.bluetoothctl.send("pairable on\n")
host1.bluetoothctl.expect("Changing pairable on succeeded")
host1.bluetoothctl.send("discoverable on\n")
host1.bluetoothctl.expect(f"Controller {host1.bdaddr.upper()} Discoverable: yes")
host0.bluetoothctl.expect(f"Device {host1.bdaddr.upper()}")
host0.bluetoothctl.send(f"pair {host1.bdaddr}\n")
idx, m = host0.bluetoothctl.expect(r"Confirm passkey (\d+).*:")
key = m[0].decode("utf-8")
host1.bluetoothctl.expect(f"Confirm passkey {key}")
host0.bluetoothctl.send("yes\n")
host1.bluetoothctl.send("yes\n")
host0.bluetoothctl.expect("Pairing successful")
The test declares a VM setup with two Qemu instances, where both hosts run bluetoothd and start a bluetoothctl process. The Qemu instances have btvirt virtual BT controllers and can see each other.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pytest_bluezenv-0.1.6.tar.gz.
File metadata
- Download URL: pytest_bluezenv-0.1.6.tar.gz
- Upload date:
- Size: 287.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b13f6d7d654fa84f93408d5c532d1231dc3deee92c0775f9eda21647c1c7ec3
|
|
| MD5 |
d7333e1691d70e816b51615b5d8a0f34
|
|
| BLAKE2b-256 |
b155f32f627ce4b9a455e711901fc1c4d5f2d82cf54bb9e6d395b9433102c594
|
Provenance
The following attestation bundles were made for pytest_bluezenv-0.1.6.tar.gz:
Publisher:
pypi.yml on pv/pytest-bluezenv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_bluezenv-0.1.6.tar.gz -
Subject digest:
6b13f6d7d654fa84f93408d5c532d1231dc3deee92c0775f9eda21647c1c7ec3 - Sigstore transparency entry: 1808486128
- Sigstore integration time:
-
Permalink:
pv/pytest-bluezenv@8e47fe02a197928387221df97af79cc5fb2fcda0 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/pv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@8e47fe02a197928387221df97af79cc5fb2fcda0 -
Trigger Event:
push
-
Statement type: