summaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-12-12 18:10:28 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 15:42:38 +0100
commit60b14805b2cb80808c2fcf644699e7cde8e088ac (patch)
tree4f5e7024c717c75c79a1cc3453623c1e5832da80 /unittest
parent08e0a45a8f10ae4fbe294a903b3a6264aa3c4333 (diff)
downloadlibnitrokey-60b14805b2cb80808c2fcf644699e7cde8e088ac.tar.gz
libnitrokey-60b14805b2cb80808c2fcf644699e7cde8e088ac.tar.bz2
Add tests for Encrypted volume ro/rw switch
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test_storage.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/unittest/test_storage.py b/unittest/test_storage.py
index f3fd801..9897727 100644
--- a/unittest/test_storage.py
+++ b/unittest/test_storage.py
@@ -289,6 +289,20 @@ def test_unencrypted_volume_set_read_write(C):
assert C.NK_set_unencrypted_read_write(DefaultPasswords.ADMIN) == DeviceErrorCode.STATUS_OK
+@pytest.mark.encrypted
+def test_encrypted_volume_set_read_only(C):
+ skip_if_device_version_lower_than({'S': 49})
+ assert C.NK_lock_device() == DeviceErrorCode.STATUS_OK
+ assert C.NK_set_encrypted_read_only(DefaultPasswords.ADMIN) == DeviceErrorCode.STATUS_OK
+
+
+@pytest.mark.encrypted
+def test_encrypted_volume_set_read_write(C):
+ skip_if_device_version_lower_than({'S': 49})
+ assert C.NK_lock_device() == DeviceErrorCode.STATUS_OK
+ assert C.NK_set_encrypted_read_write(DefaultPasswords.ADMIN) == DeviceErrorCode.STATUS_OK
+
+
@pytest.mark.other
def test_export_firmware(C):
skip_if_device_version_lower_than({'S': 43})