test(core): skip BLE-incompatible testcases
What changed, and why it matters
This commit only changes test code. It adds a new 'ble' pytest marker and uses it to skip or adjust certain test cases when they are run over a Bluetooth Low Energy (BLE) transport. Some tests that wipe the device are skipped over BLE because 'wipe over BLE is not implemented yet,' and one large transaction test is given a longer timeout when run over BLE. There is no change to the actual Trezor firmware or wallet behavior, so this does not fix or introduce a product security issue.
No security action required. Treat as a routine test-maintenance commit.
Security signals we found
No firmware or cryptographic code changed
Changes are confined to the test suite
No bug fix, vulnerability remediation, or security-hardening pattern present
No changelog entry requested by the author
Evidence from the diff
The diff modifies the test harness (tests/conftest.py) to recognize a @pytest.mark.ble(…) marker. If the test transport is BleTransport, the marker can either skip the test (with a reason) or skip it specifically for wipe operations. The marker is then applied to several device test files: tests that call device wipe are marked ble(wipe=True), and test_ble_unpair_all is marked ble(skip=”can’t unpair all BLE over BLE”). Additionally, test_sign_tx_large in test_authorize_coinjoin.py increases its expected delay from 80 s to 300 s when running over BLE. No firmware source code is changed.
Changed components
tests/conftest.pytests/REGISTERED_MARKERStests/device_tests/bitcoin/test_authorize_coinjoin.pytests/device_tests/evolu/test_delegated_identity_key_rotation.pytests/device_tests/reset_recovery/test_reset_recovery_bip39.pytests/device_tests/reset_recovery/test_reset_recovery_slip39_advanced.pytests/device_tests/reset_recovery/test_reset_recovery_slip39_basic.pytests/device_tests/test_ble.pytests/device_tests/test_debuglink.pytests/device_tests/test_language.pytests/device_tests/test_msg_sd_protect.pytests/device_tests/test_msg_wipedevice.pytests/device_tests/test_protection_levels.pyInspect captured patch +26 / −1
### tests/REGISTERED_MARKERS
@@ -1,4 +1,5 @@
altcoin
+ble
cardano
capabilities
decred
### tests/conftest.py
@@ -433,6 +433,15 @@ def _prepared_test_ctx(
" pytest -m 'not sd_card' <test path>"
)
+ ble_marker = request.node.get_closest_marker("ble")
+ if ble_marker and isinstance(_raw_test_ctx.transport, BleTransport):
+ if reason := ble_marker.kwargs.get("skip", False):
+ assert isinstance(reason, str)
+ pytest.skip(f"Test not supported over BLE: {reason}")
+
+ if ble_marker.kwargs.get("wipe", False):
+ pytest.skip("Wipe over BLE not implemented yet")
+
fail_on_gc_leak = not request.config.getoption("ignore_gc_leak")
# First, make sure the device is responsive:
### tests/device_tests/bitcoin/test_authorize_coinjoin.py
@@ -23,6 +23,7 @@
from trezorlib.debuglink import TrezorTestContext as Client
from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import parse_path
+from trezorlib.transport.ble import BleTransport
from ...common import is_core
from ...tx_cache import TxCache
@@ -277,7 +278,10 @@ def test_sign_tx_large(session: Session):
own_output_count = 30
total_output_count = 1200
output_denom = 10_000 # sats
- max_expected_delay = 80 # seconds
+ if isinstance(session.test_ctx.transport, BleTransport):
+ max_expected_delay = 300 # seconds
+ else:
+ max_expected_delay = 80 # seconds
btc.authorize_coinjoin(
session,
### tests/device_tests/evolu/test_delegated_identity_key_rotation.py
@@ -133,6 +133,7 @@ def test_index_management_cannot_overwrite_existing_index(client: Client):
assert key.rotation_index == 10
+@pytest.mark.ble(wipe=True)
def test_rotation_index_wiped_on_device_wipe(client: Client):
evolu.index_management(client.get_session(), rotation_index=0)
key_before_wipe_0 = get_delegated_identity_key(client)
### tests/device_tests/reset_recovery/test_reset_recovery_bip39.py
@@ -27,6 +27,7 @@
from ...input_flows import InputFlowBip39Recovery, InputFlowBip39ResetBackup
+@pytest.mark.ble(wipe=True)
@pytest.mark.models("core")
@pytest.mark.setup_client(uninitialized=True)
def test_reset_recovery(client: Client, backup_method: BackupMethod):
### tests/device_tests/reset_recovery/test_reset_recovery_slip39_advanced.py
@@ -30,6 +30,7 @@
)
+@pytest.mark.ble(wipe=True)
@pytest.mark.models("core")
@pytest.mark.setup_client(uninitialized=True)
def test_reset_recovery(client: Client, backup_method: BackupMethod):
### tests/device_tests/reset_recovery/test_reset_recovery_slip39_basic.py
@@ -33,6 +33,7 @@
)
+@pytest.mark.ble(wipe=True)
@pytest.mark.models("core")
@pytest.mark.setup_client(uninitialized=True)
def test_reset_recovery(client: Client, backup_method: BackupMethod):
### tests/device_tests/test_ble.py
@@ -21,6 +21,7 @@
from trezorlib.exceptions import TrezorFailure
+@pytest.mark.ble(skip="can't unpair all BLE over BLE")
@pytest.mark.models("t3w1")
def test_ble_unpair_all(session: Session):
ble.unpair(session, all=True)
### tests/device_tests/test_debuglink.py
@@ -58,6 +58,7 @@ def test_pin(session: Session):
assert isinstance(resp, messages.Address)
+@pytest.mark.ble(wipe=True)
@pytest.mark.models("core")
def test_softlock_instability(session: Session):
### tests/device_tests/test_language.py
@@ -264,6 +264,7 @@ def test_build_version_mismatch(session: Session):
# Would be nice to test lower build_version but firmware's is usually 0 and hard to change
+@pytest.mark.ble(wipe=True)
def test_language_is_removed_after_wipe(client: Client):
session = client.get_session()
assert session.features.language == "en-US"
### tests/device_tests/test_msg_sd_protect.py
@@ -70,6 +70,7 @@ def test_refresh(session: Session):
assert session.features.sd_protection is False
+@pytest.mark.ble(wipe=True)
def test_wipe(client: Client):
session = client.get_seedless_session()
# Enable SD protection
### tests/device_tests/test_msg_wipedevice.py
@@ -25,6 +25,8 @@
from ..common import MNEMONIC12, get_test_address
+pytestmark = [pytest.mark.ble(wipe=True)]
+
PIN4 = "1234"
### tests/device_tests/test_protection_levels.py
@@ -255,6 +255,7 @@ def test_get_address(client: Client):
_get_test_address(session)
+@pytest.mark.ble(wipe=True)
def test_wipe_device(client: Client):
_assert_protection(client)
session = client.get_seedless_session()Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.