aboutsummaryrefslogtreecommitdiff
path: root/unittest/test_storage.py
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 /unittest/test_storage.py
parentb44b15f5c69c0cebdf2ce3a7005ed044d67de56b (diff)
downloadlibnitrokey-76c8be835cdffea725616ea0a9e59ad54f833d11.tar.gz
libnitrokey-76c8be835cdffea725616ea0a9e59ad54f833d11.tar.bz2
Update Python testsupdate_tests
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest/test_storage.py')
-rw-r--r--unittest/test_storage.py9
1 files changed, 7 insertions, 2 deletions
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