mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +00:00
tests: update T1+T2 reset+recovery tests to reflect new Confirm dialog
This commit is contained in:
parent
1a239201d8
commit
1397c3b4d9
@ -36,6 +36,11 @@ class TestMsgRecoverydeviceT2(TrezorTest):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Confirm Recovery
|
||||||
|
assert isinstance(ret, proto.ButtonRequest)
|
||||||
|
self.client.debug.press_yes()
|
||||||
|
ret = self.client.call_raw(proto.ButtonAck())
|
||||||
|
|
||||||
# Enter word count
|
# Enter word count
|
||||||
assert ret == proto.ButtonRequest(
|
assert ret == proto.ButtonRequest(
|
||||||
code=proto.ButtonRequestType.MnemonicWordCount
|
code=proto.ButtonRequestType.MnemonicWordCount
|
||||||
@ -82,6 +87,11 @@ class TestMsgRecoverydeviceT2(TrezorTest):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Confirm Recovery
|
||||||
|
assert isinstance(ret, proto.ButtonRequest)
|
||||||
|
self.client.debug.press_yes()
|
||||||
|
ret = self.client.call_raw(proto.ButtonAck())
|
||||||
|
|
||||||
# Enter word count
|
# Enter word count
|
||||||
assert ret == proto.ButtonRequest(
|
assert ret == proto.ButtonRequest(
|
||||||
code=proto.ButtonRequestType.MnemonicWordCount
|
code=proto.ButtonRequestType.MnemonicWordCount
|
||||||
|
@ -41,6 +41,10 @@ class TestMsgResetDevice(TrezorTest):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
assert isinstance(ret, proto.ButtonRequest)
|
||||||
|
self.client.debug.press_yes()
|
||||||
|
ret = self.client.call_raw(proto.ButtonAck())
|
||||||
|
|
||||||
# Provide entropy
|
# Provide entropy
|
||||||
assert isinstance(ret, proto.EntropyRequest)
|
assert isinstance(ret, proto.EntropyRequest)
|
||||||
internal_entropy = self.client.debug.read_reset_entropy()
|
internal_entropy = self.client.debug.read_reset_entropy()
|
||||||
@ -110,6 +114,10 @@ class TestMsgResetDevice(TrezorTest):
|
|||||||
self.client.debug.press_yes()
|
self.client.debug.press_yes()
|
||||||
ret = self.client.call_raw(proto.ButtonAck())
|
ret = self.client.call_raw(proto.ButtonAck())
|
||||||
|
|
||||||
|
assert isinstance(ret, proto.ButtonRequest)
|
||||||
|
self.client.debug.press_yes()
|
||||||
|
ret = self.client.call_raw(proto.ButtonAck())
|
||||||
|
|
||||||
assert isinstance(ret, proto.PinMatrixRequest)
|
assert isinstance(ret, proto.PinMatrixRequest)
|
||||||
|
|
||||||
# Enter PIN for first time
|
# Enter PIN for first time
|
||||||
@ -192,6 +200,10 @@ class TestMsgResetDevice(TrezorTest):
|
|||||||
self.client.debug.press_yes()
|
self.client.debug.press_yes()
|
||||||
ret = self.client.call_raw(proto.ButtonAck())
|
ret = self.client.call_raw(proto.ButtonAck())
|
||||||
|
|
||||||
|
assert isinstance(ret, proto.ButtonRequest)
|
||||||
|
self.client.debug.press_yes()
|
||||||
|
ret = self.client.call_raw(proto.ButtonAck())
|
||||||
|
|
||||||
assert isinstance(ret, proto.PinMatrixRequest)
|
assert isinstance(ret, proto.PinMatrixRequest)
|
||||||
|
|
||||||
# Enter PIN for first time
|
# Enter PIN for first time
|
||||||
|
@ -38,6 +38,10 @@ class TestMsgResetDeviceNobackup(TrezorTest):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
assert isinstance(ret, proto.ButtonRequest)
|
||||||
|
self.client.debug.press_yes()
|
||||||
|
ret = self.client.call_raw(proto.ButtonAck())
|
||||||
|
|
||||||
# Provide entropy
|
# Provide entropy
|
||||||
assert isinstance(ret, proto.EntropyRequest)
|
assert isinstance(ret, proto.EntropyRequest)
|
||||||
ret = self.client.call_raw(proto.EntropyAck(entropy=self.external_entropy))
|
ret = self.client.call_raw(proto.EntropyAck(entropy=self.external_entropy))
|
||||||
|
@ -42,6 +42,10 @@ class TestMsgResetDeviceSkipbackup(TrezorTest):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
assert isinstance(ret, proto.ButtonRequest)
|
||||||
|
self.client.debug.press_yes()
|
||||||
|
ret = self.client.call_raw(proto.ButtonAck())
|
||||||
|
|
||||||
# Provide entropy
|
# Provide entropy
|
||||||
assert isinstance(ret, proto.EntropyRequest)
|
assert isinstance(ret, proto.EntropyRequest)
|
||||||
internal_entropy = self.client.debug.read_reset_entropy()
|
internal_entropy = self.client.debug.read_reset_entropy()
|
||||||
@ -108,6 +112,10 @@ class TestMsgResetDeviceSkipbackup(TrezorTest):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
assert isinstance(ret, proto.ButtonRequest)
|
||||||
|
self.client.debug.press_yes()
|
||||||
|
ret = self.client.call_raw(proto.ButtonAck())
|
||||||
|
|
||||||
# Provide entropy
|
# Provide entropy
|
||||||
assert isinstance(ret, proto.EntropyRequest)
|
assert isinstance(ret, proto.EntropyRequest)
|
||||||
ret = self.client.call_raw(proto.EntropyAck(entropy=self.external_entropy))
|
ret = self.client.call_raw(proto.EntropyAck(entropy=self.external_entropy))
|
||||||
|
@ -35,6 +35,11 @@ class TestMsgResetDeviceT2(TrezorTest):
|
|||||||
strength = 128
|
strength = 128
|
||||||
|
|
||||||
def input_flow():
|
def input_flow():
|
||||||
|
# Confirm Reset
|
||||||
|
btn_code = yield
|
||||||
|
assert btn_code == B.ResetDevice
|
||||||
|
self.client.debug.press_yes()
|
||||||
|
|
||||||
# Backup your seed
|
# Backup your seed
|
||||||
btn_code = yield
|
btn_code = yield
|
||||||
assert btn_code == B.ResetDevice
|
assert btn_code == B.ResetDevice
|
||||||
@ -68,6 +73,7 @@ class TestMsgResetDeviceT2(TrezorTest):
|
|||||||
with mock.patch("os.urandom", os_urandom), self.client:
|
with mock.patch("os.urandom", os_urandom), self.client:
|
||||||
self.client.set_expected_responses(
|
self.client.set_expected_responses(
|
||||||
[
|
[
|
||||||
|
proto.ButtonRequest(code=B.ResetDevice),
|
||||||
proto.EntropyRequest(),
|
proto.EntropyRequest(),
|
||||||
proto.ButtonRequest(code=B.ResetDevice),
|
proto.ButtonRequest(code=B.ResetDevice),
|
||||||
proto.ButtonRequest(code=B.ResetDevice),
|
proto.ButtonRequest(code=B.ResetDevice),
|
||||||
@ -109,6 +115,11 @@ class TestMsgResetDeviceT2(TrezorTest):
|
|||||||
strength = 128
|
strength = 128
|
||||||
|
|
||||||
def input_flow():
|
def input_flow():
|
||||||
|
# Confirm Reset
|
||||||
|
btn_code = yield
|
||||||
|
assert btn_code == B.ResetDevice
|
||||||
|
self.client.debug.press_yes()
|
||||||
|
|
||||||
# Enter new PIN
|
# Enter new PIN
|
||||||
yield
|
yield
|
||||||
self.client.debug.input("654")
|
self.client.debug.input("654")
|
||||||
@ -155,6 +166,7 @@ class TestMsgResetDeviceT2(TrezorTest):
|
|||||||
with mock.patch("os.urandom", os_urandom), self.client:
|
with mock.patch("os.urandom", os_urandom), self.client:
|
||||||
self.client.set_expected_responses(
|
self.client.set_expected_responses(
|
||||||
[
|
[
|
||||||
|
proto.ButtonRequest(code=B.ResetDevice),
|
||||||
proto.ButtonRequest(code=B.Other),
|
proto.ButtonRequest(code=B.Other),
|
||||||
proto.ButtonRequest(code=B.Other),
|
proto.ButtonRequest(code=B.Other),
|
||||||
proto.ButtonRequest(code=B.ResetDevice),
|
proto.ButtonRequest(code=B.ResetDevice),
|
||||||
@ -201,6 +213,11 @@ class TestMsgResetDeviceT2(TrezorTest):
|
|||||||
proto.ResetDevice(strength=strength, pin_protection=True, label="test")
|
proto.ResetDevice(strength=strength, pin_protection=True, label="test")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Confirm Reset
|
||||||
|
assert isinstance(ret, proto.ButtonRequest)
|
||||||
|
self.client.debug.press_yes()
|
||||||
|
ret = self.client.call_raw(proto.ButtonAck())
|
||||||
|
|
||||||
# Enter PIN for first time
|
# Enter PIN for first time
|
||||||
assert isinstance(ret, proto.ButtonRequest)
|
assert isinstance(ret, proto.ButtonRequest)
|
||||||
self.client.debug.input("654")
|
self.client.debug.input("654")
|
||||||
|
Loading…
Reference in New Issue
Block a user