1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

tests: T1 now caches the PIN after PIN set/change

This commit is contained in:
Pavol Rusnak 2018-12-14 15:17:14 +01:00
parent 4a516e5a89
commit 831fde9c5c
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
4 changed files with 3 additions and 16 deletions

View File

@ -56,6 +56,9 @@ class TrezorTest:
label="test",
language="english",
)
if conftest.TREZOR_VERSION == 1:
# remove cached PIN (introduced via load_device)
self.client.clear_session()
if conftest.TREZOR_VERSION > 1 and passphrase:
device.apply_settings(self.client, passphrase_source=PASSPHRASE_ON_HOST)

View File

@ -56,9 +56,6 @@ class TestMsgChangepin(TrezorTest):
# Check that there's PIN protection now
features = self.client.call_raw(proto.Initialize())
assert features.pin_protection is True
ret = self.client.call_raw(proto.Ping(pin_protection=True))
assert isinstance(ret, proto.PinMatrixRequest)
self.client.call_raw(proto.Cancel())
# Check that the PIN is correct
assert self.client.debug.read_pin()[0] == self.pin6
@ -105,9 +102,6 @@ class TestMsgChangepin(TrezorTest):
# Check that there's still PIN protection now
features = self.client.call_raw(proto.Initialize())
assert features.pin_protection is True
ret = self.client.call_raw(proto.Ping(pin_protection=True))
assert isinstance(ret, proto.PinMatrixRequest)
self.client.call_raw(proto.Cancel())
# Check that the PIN is correct
assert self.client.debug.read_pin()[0] == self.pin6

View File

@ -85,11 +85,6 @@ class TestMsgRecoverydevice(TrezorTest):
assert isinstance(resp, proto.PassphraseRequest)
self.client.call_raw(proto.Cancel())
# Do PIN-protected action, PinRequest should be raised
resp = self.client.call_raw(proto.Ping(pin_protection=True))
assert isinstance(resp, proto.PinMatrixRequest)
self.client.call_raw(proto.Cancel())
def test_nopin_nopassphrase(self):
mnemonic = self.mnemonic12.split(" ")
ret = self.client.call_raw(

View File

@ -176,11 +176,6 @@ class TestMsgResetDevice(TrezorTest):
assert isinstance(resp, proto.PassphraseRequest)
self.client.call_raw(proto.Cancel())
# Do PIN-protected action, PinRequest should be raised
resp = self.client.call_raw(proto.Ping(pin_protection=True))
assert isinstance(resp, proto.PinMatrixRequest)
self.client.call_raw(proto.Cancel())
def test_failed_pin(self):
# external_entropy = b'zlutoucky kun upel divoke ody' * 2
strength = 128