mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-03-12 22:26:08 +00:00
test: update device tests
[no changelog]
This commit is contained in:
parent
bc9d8dc277
commit
a028570bd1
@ -77,6 +77,7 @@ def test_pin_passphrase(session: Session):
|
|||||||
assert fakes == 12
|
assert fakes == 12
|
||||||
assert mnemonic == [None] * 12
|
assert mnemonic == [None] * 12
|
||||||
|
|
||||||
|
raise Exception("TEST IS USING INIT MESSAGE - TODO CHANGE")
|
||||||
# Mnemonic is the same
|
# Mnemonic is the same
|
||||||
session.init_session()
|
session.init_session()
|
||||||
session.client.refresh_features()
|
session.client.refresh_features()
|
||||||
|
@ -78,7 +78,7 @@ def reset_device(session: Session, strength: int):
|
|||||||
assert mnemonic == expected_mnemonic
|
assert mnemonic == expected_mnemonic
|
||||||
|
|
||||||
# Check if device is properly initialized
|
# Check if device is properly initialized
|
||||||
resp = session.call_raw(messages.Initialize())
|
resp = session.call_raw(messages.GetFeatures())
|
||||||
assert resp.initialized is True
|
assert resp.initialized is True
|
||||||
assert resp.backup_availability == messages.BackupAvailability.NotAvailable
|
assert resp.backup_availability == messages.BackupAvailability.NotAvailable
|
||||||
assert resp.pin_protection is False
|
assert resp.pin_protection is False
|
||||||
@ -170,7 +170,7 @@ def test_reset_device_256_pin(session: Session):
|
|||||||
assert mnemonic == expected_mnemonic
|
assert mnemonic == expected_mnemonic
|
||||||
|
|
||||||
# Check if device is properly initialized
|
# Check if device is properly initialized
|
||||||
resp = session.call_raw(messages.Initialize())
|
resp = session.call_raw(messages.GetFeatures())
|
||||||
assert resp.initialized is True
|
assert resp.initialized is True
|
||||||
assert resp.backup_availability == messages.BackupAvailability.NotAvailable
|
assert resp.backup_availability == messages.BackupAvailability.NotAvailable
|
||||||
assert resp.pin_protection is True
|
assert resp.pin_protection is True
|
||||||
|
@ -215,6 +215,23 @@ def test_get_address(session: Session):
|
|||||||
|
|
||||||
|
|
||||||
def test_wipe_device(session: Session):
|
def test_wipe_device(session: Session):
|
||||||
|
# TODO
|
||||||
|
# Precise cause of crash is not determined, it happens with some order of
|
||||||
|
# tests, but not with all. The following leads to crash:
|
||||||
|
# pytest --random-order-seed=675848 tests/device_tests/test_protection_levels.py
|
||||||
|
#
|
||||||
|
# Traceback (most recent call last):
|
||||||
|
# File "trezor/wire/__init__.py", line 70, in handle_session
|
||||||
|
# File "trezor/wire/thp_main.py", line 79, in thp_main_loop
|
||||||
|
# File "trezor/wire/thp_main.py", line 145, in _handle_allocated
|
||||||
|
# File "trezor/wire/thp/received_message_handler.py", line 123, in handle_received_message
|
||||||
|
# File "trezor/wire/thp/received_message_handler.py", line 231, in _handle_state_TH1
|
||||||
|
# File "trezor/wire/thp/crypto.py", line 93, in handle_th1_crypto
|
||||||
|
# File "trezor/wire/thp/crypto.py", line 178, in _derive_static_key_pair
|
||||||
|
# File "storage/device.py", line 364, in get_device_secret
|
||||||
|
# File "storage/common.py", line 21, in set
|
||||||
|
# RuntimeError: Could not save value
|
||||||
|
|
||||||
session = _assert_protection(session)
|
session = _assert_protection(session)
|
||||||
with session:
|
with session:
|
||||||
session.set_expected_responses([messages.ButtonRequest, messages.Success])
|
session.set_expected_responses([messages.ButtonRequest, messages.Success])
|
||||||
|
Loading…
Reference in New Issue
Block a user