summaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2020-01-28 14:46:04 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2020-02-26 12:26:23 +0100
commit2b37ae486deba1985179543333c592b55fafbc37 (patch)
tree3339d4217e3358aa3b870a47fb83c3c25b9659dc /unittest
parentec767410d860688f32ef644e9573841272d5aec2 (diff)
downloadlibnitrokey-2b37ae486deba1985179543333c592b55fafbc37.tar.gz
libnitrokey-2b37ae486deba1985179543333c592b55fafbc37.tar.bz2
Bootloader data retention test
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test_pro.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/unittest/test_pro.py b/unittest/test_pro.py
index a47d804..4ac19ab 100644
--- a/unittest/test_pro.py
+++ b/unittest/test_pro.py
@@ -1029,6 +1029,23 @@ def test_bootloader_password_change_pro_too_long(C):
assert C.NK_change_firmware_password_pro(DefaultPasswords.UPDATE, long_string) == LibraryErrors.TOO_LONG_STRING
+@pytest.mark.skip_by_default
+@pytest.mark.firmware
+def test_bootloader_data_rention_test(C):
+ skip_if_device_version_lower_than({'P': 11})
+
+ def populate_device():
+ return False
+
+ def check_data_on_device():
+ return False
+
+ assert populate_device()
+ assert C.NK_enable_firmware_update_pro(DefaultPasswords.UPDATE) == DeviceErrorCode.STATUS_DISCONNECTED
+ input('Please press ENTER after uploading new firmware to the device')
+ assert check_data_on_device()
+
+
@pytest.mark.otp
@pytest.mark.parametrize('counter_mid', [10**3-1, 10**4-1, 10**7-1, 10**8-10, 2**16, 2**31-1, 2**32-1, 2**33, 2**50, 2**60, 2**63]) # 2**64-1
def test_HOTP_counter_getter(C, counter_mid: int):