From 4ac4f1c33b64c9fc80bc911681143a3a52c1e5df Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 22 Nov 2018 12:28:32 +0100 Subject: Handle UNKNOWN_ERROR return code Handle UNKNOWN_ERROR code (introduced in Storage v0.51, firmware commit 687d4aca31ce405db41231be73864ee2f91b3714) and is returned, when device fails to retrieve the AES key. Signed-off-by: Szczepan Zalega --- unittest/test_pro.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'unittest/test_pro.py') diff --git a/unittest/test_pro.py b/unittest/test_pro.py index 1c61399..afa9505 100644 --- a/unittest/test_pro.py +++ b/unittest/test_pro.py @@ -192,7 +192,8 @@ def test_enable_password_safe_after_factory_reset(C): assert C.NK_clear_new_sd_card_warning(DefaultPasswords.ADMIN) == DeviceErrorCode.STATUS_OK enable_password_safe_result = C.NK_enable_password_safe(DefaultPasswords.USER) assert enable_password_safe_result == DeviceErrorCode.STATUS_AES_DEC_FAILED \ - or is_storage(C) and enable_password_safe_result == DeviceErrorCode.WRONG_PASSWORD + or is_storage(C) and enable_password_safe_result in \ + [DeviceErrorCode.WRONG_PASSWORD, DeviceErrorCode.STATUS_UNKNOWN_ERROR] # UNKNOWN_ERROR since v0.51 assert C.NK_build_aes_key(DefaultPasswords.ADMIN) == DeviceErrorCode.STATUS_OK assert C.NK_enable_password_safe(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK -- cgit v1.2.1