aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-04-15 15:37:35 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-05-25 13:34:55 +0200
commit76c8be835cdffea725616ea0a9e59ad54f833d11 (patch)
tree8abca27935ea36965fb46da8643567d737bb850d
parentb44b15f5c69c0cebdf2ce3a7005ed044d67de56b (diff)
downloadlibnitrokey-76c8be835cdffea725616ea0a9e59ad54f833d11.tar.gz
libnitrokey-76c8be835cdffea725616ea0a9e59ad54f833d11.tar.bz2
Update Python testsupdate_tests
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--unittest/test_pro.py4
-rw-r--r--unittest/test_storage.py9
2 files changed, 9 insertions, 4 deletions
diff --git a/unittest/test_pro.py b/unittest/test_pro.py
index 3f1f0a3..e706b1a 100644
--- a/unittest/test_pro.py
+++ b/unittest/test_pro.py
@@ -759,8 +759,8 @@ def test_edit_OTP_slot(C):
"""
should change slots counter and name without changing its secret (using null secret for second update)
"""
- # counter is not getting updated under Storage v0.43 - #TOREPORT
- skip_if_device_version_lower_than({'S': 44, 'P': 7})
+ # counter is not getting updated under Storage v0.43 - #REPORTED
+ skip_if_device_version_lower_than({'S': 45, 'P': 7})
secret = RFC_SECRET
counter = 0
diff --git a/unittest/test_storage.py b/unittest/test_storage.py
index da7c9a3..98b99cd 100644
--- a/unittest/test_storage.py
+++ b/unittest/test_storage.py
@@ -22,6 +22,7 @@ def get_dict_from_dissect(status):
return d
+@pytest.mark.xfail(reason="Not tested lately, needs dict conversion adjust")
def test_get_status_storage(C):
skip_if_device_version_lower_than({'S': 43})
status_pointer = C.NK_get_status_storage_as_string()
@@ -205,11 +206,15 @@ def test_password_safe_slot_name_corruption(C):
check_PWS_correctness(C)
def test_hidden_volume_corruption(C):
+ hidden_volume_password = 'hiddenpassword'
+ p = lambda i: hidden_volume_password + str(i)
+ assert C.NK_lock_device() == DeviceErrorCode.STATUS_OK
+ assert C.NK_unlock_encrypted_volume(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK
+ for i in range(4):
+ assert C.NK_create_hidden_volume(i, 20+i*10, 20+i*10+i+1, p(i)) == DeviceErrorCode.STATUS_OK
# bug: this should return error without unlocking encrypted volume each hidden volume lock, but it does not
assert C.NK_lock_encrypted_volume() == DeviceErrorCode.STATUS_OK
assert C.NK_unlock_encrypted_volume(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK
- hidden_volume_password = 'hiddenpassword'
- p = lambda i: hidden_volume_password + str(i)
for i in range(4):
assert C.NK_unlock_encrypted_volume(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK
assert C.NK_unlock_hidden_volume(p(i)) == DeviceErrorCode.STATUS_OK