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

device_tests: fix test_msg_recoverydevice for T1

This commit is contained in:
matejcik 2018-05-23 17:08:16 +02:00
parent f8f0be9c86
commit 17b37034e8

View File

@ -15,10 +15,9 @@
# #
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with this library. If not, see <http://www.gnu.org/licenses/>. # along with this library. If not, see <http://www.gnu.org/licenses/>.
import pytest
from __future__ import print_function from .common import TrezorTest
from .common import *
from trezorlib import messages as proto from trezorlib import messages as proto
@ -34,6 +33,11 @@ class TestMsgRecoverydevice(TrezorTest):
language='english', language='english',
enforce_wordlist=True)) enforce_wordlist=True))
# click through confirmation
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
@ -92,6 +96,11 @@ class TestMsgRecoverydevice(TrezorTest):
language='english', language='english',
enforce_wordlist=True)) enforce_wordlist=True))
# click through confirmation
assert isinstance(ret, proto.ButtonRequest)
self.client.debug.press_yes()
ret = self.client.call_raw(proto.ButtonAck())
fakes = 0 fakes = 0
for _ in range(int(12 * 2)): for _ in range(int(12 * 2)):
assert isinstance(ret, proto.WordRequest) assert isinstance(ret, proto.WordRequest)
@ -136,6 +145,11 @@ class TestMsgRecoverydevice(TrezorTest):
language='english', language='english',
enforce_wordlist=True)) enforce_wordlist=True))
# click through confirmation
assert isinstance(ret, proto.ButtonRequest)
self.client.debug.press_yes()
ret = self.client.call_raw(proto.ButtonAck())
assert isinstance(ret, proto.WordRequest) assert isinstance(ret, proto.WordRequest)
for _ in range(int(12 * 2)): for _ in range(int(12 * 2)):
(word, pos) = self.client.debug.read_recovery_word() (word, pos) = self.client.debug.read_recovery_word()
@ -154,6 +168,11 @@ class TestMsgRecoverydevice(TrezorTest):
language='english', language='english',
enforce_wordlist=True)) enforce_wordlist=True))
# click through confirmation
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