aboutsummaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-02-01 12:08:52 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-01 12:10:52 +0100
commit2df8bb7f9da3231cb5a7153401d524feb7409642 (patch)
tree5afe04af8bf4eecbfb6d007b1fa77aab85121fa2 /unittest
parent81b4dc8d6316f0e7b9149dcfd0cbe192a4ae900f (diff)
downloadlibnitrokey-2df8bb7f9da3231cb5a7153401d524feb7409642.tar.gz
libnitrokey-2df8bb7f9da3231cb5a7153401d524feb7409642.tar.bz2
Add test for enabling firmware update
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test_storage.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/unittest/test_storage.py b/unittest/test_storage.py
index 0f3e04e..67bbf8b 100644
--- a/unittest/test_storage.py
+++ b/unittest/test_storage.py
@@ -318,6 +318,15 @@ def test_change_update_password(C):
assert C.NK_change_update_password(DefaultPasswords.UPDATE_TEMP, DefaultPasswords.UPDATE) == DeviceErrorCode.STATUS_OK
+@pytest.mark.skip(reason='no reversing method added yet')
+@pytest.mark.update
+def test_enable_firmware_update(C):
+ skip_if_device_version_lower_than({'S': 50})
+ wrong_password = b'aaaaaaaaaaa'
+ assert C.NK_enable_firmware_update(wrong_password) == DeviceErrorCode.WRONG_PASSWORD
+ assert C.NK_enable_firmware_update(DefaultPasswords.UPDATE) == DeviceErrorCode.STATUS_OK
+
+
@pytest.mark.other
def test_send_startup(C):
skip_if_device_version_lower_than({'S': 43})