diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2018-03-01 19:41:35 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2018-03-02 11:13:08 +0100 |
commit | c3d615b659b608f3a1d624f6fc78c303efbe1f8e (patch) | |
tree | 2d186dec6976b12a9f7b37e589c02703275a30ef /unittest | |
parent | f5da7b4cbd508faef38fcdfff659fab5c4649838 (diff) | |
download | libnitrokey-c3d615b659b608f3a1d624f6fc78c303efbe1f8e.tar.gz libnitrokey-c3d615b659b608f3a1d624f6fc78c303efbe1f8e.tar.bz2 |
Correct firmware version getting in Pro tests
Done for Pro devices
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/misc.py | 7 | ||||
-rw-r--r-- | unittest/test_pro.py | 6 |
2 files changed, 7 insertions, 6 deletions
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 |