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

pull/25/head
Pavol Rusnak 6 years ago
parent 4a516e5a89
commit 831fde9c5c
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -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)

@ -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

@ -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(

@ -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

Loading…
Cancel
Save