From c3d615b659b608f3a1d624f6fc78c303efbe1f8e Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 1 Mar 2018 19:41:35 +0100 Subject: Correct firmware version getting in Pro tests Done for Pro devices Signed-off-by: Szczepan Zalega --- unittest/misc.py | 7 ++++--- unittest/test_pro.py | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'unittest') diff --git a/unittest/misc.py b/unittest/misc.py index a41f2b2..8be915d 100644 --- a/unittest/misc.py +++ b/unittest/misc.py @@ -43,7 +43,7 @@ def cast_pointer_to_tuple(obj, typen, len): def get_devices_firmware_version(C): - firmware = C.NK_get_major_firmware_version() + firmware = C.NK_get_minor_firmware_version() return firmware @@ -54,7 +54,7 @@ def is_pro_rtm_07(C): def is_pro_rtm_08(C): firmware = get_devices_firmware_version(C) - return firmware == 8 + return firmware in [8,9] def is_storage(C): @@ -62,7 +62,8 @@ def is_storage(C): exact firmware storage is sent by other function """ # TODO identify connected device directly - return not is_pro_rtm_08(C) and not is_pro_rtm_07(C) + firmware = get_devices_firmware_version(C) + return firmware >= 45 def is_long_OTP_secret_handled(C): diff --git a/unittest/test_pro.py b/unittest/test_pro.py index 12a34e9..53588f6 100644 --- a/unittest/test_pro.py +++ b/unittest/test_pro.py @@ -164,9 +164,9 @@ def test_password_safe_slot_status(C): @pytest.mark.aes def test_issue_device_locks_on_second_key_generation_in_sequence(C): - if is_pro_rtm_07(C) or is_pro_rtm_08(C): - pytest.skip("issue to register: device locks up " - "after below commands sequence (reinsertion fixes), skipping for now") +# if is_pro_rtm_07(C) or is_pro_rtm_08(C): + pytest.skip("issue to register: device locks up " + "after below commands sequence (reinsertion fixes), skipping for now") assert C.NK_build_aes_key(DefaultPasswords.ADMIN) == DeviceErrorCode.STATUS_OK assert C.NK_build_aes_key(DefaultPasswords.ADMIN) == DeviceErrorCode.STATUS_OK -- cgit v1.2.1