From aaa1ea6352e028c6d9df57f571f93f3acf02cf92 Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Mon, 17 Aug 2020 17:18:41 +0200 Subject: [PATCH] test: Add upgrade test with enabled PIN for legacy. --- tests/upgrade_tests/test_firmware_upgrades.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/upgrade_tests/test_firmware_upgrades.py b/tests/upgrade_tests/test_firmware_upgrades.py index 274574b4ee..45ee16edbd 100644 --- a/tests/upgrade_tests/test_firmware_upgrades.py +++ b/tests/upgrade_tests/test_firmware_upgrades.py @@ -66,6 +66,37 @@ def test_upgrade_load(gen, tag): assert emu.client.features.language == LANGUAGE +@for_all("legacy") +def test_upgrade_load_pin(gen, tag): + PIN = "1234" + + def asserts(client): + assert client.features.pin_protection + assert not client.features.passphrase_protection + assert client.features.initialized + assert client.features.label == LABEL + client.use_pin_sequence([PIN]) + assert btc.get_address(client, "Bitcoin", PATH) == ADDRESS + + with EmulatorWrapper(gen, tag) as emu: + debuglink.load_device_by_mnemonic( + emu.client, + mnemonic=MNEMONIC, + pin=PIN, + passphrase_protection=False, + label=LABEL, + language=LANGUAGE, + ) + device_id = emu.client.features.device_id + asserts(emu.client) + storage = emu.get_storage() + + with EmulatorWrapper(gen, storage=storage) as emu: + assert device_id == emu.client.features.device_id + asserts(emu.client) + assert emu.client.features.language == LANGUAGE + + @for_all("legacy") def test_upgrade_reset(gen, tag): def asserts(client):