diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-12-12 17:25:46 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2018-02-23 15:42:37 +0100 |
commit | 0363caa230c06f920c9bd6bd9ecc349d322af016 (patch) | |
tree | 6d931775fada412642c12e5eb09fdd6ea51127e9 /unittest/test_storage.py | |
parent | 1411b1bd795bcf4a382dd8ed2aa09f94e352f848 (diff) | |
download | libnitrokey-0363caa230c06f920c9bd6bd9ecc349d322af016.tar.gz libnitrokey-0363caa230c06f920c9bd6bd9ecc349d322af016.tar.bz2 |
Tests for unencrypted volume switching with Admin PIN
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest/test_storage.py')
-rw-r--r-- | unittest/test_storage.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/unittest/test_storage.py b/unittest/test_storage.py index 67bbf8b..9d39371 100644 --- a/unittest/test_storage.py +++ b/unittest/test_storage.py @@ -273,6 +273,20 @@ def test_unencrypted_volume_set_read_write(C): assert C.NK_set_unencrypted_read_write(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK +@pytest.mark.unencrypted +def test_unencrypted_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_unencrypted_read_only(DefaultPasswords.ADMIN) == DeviceErrorCode.STATUS_OK + + +@pytest.mark.unencrypted +def test_unencrypted_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_unencrypted_read_write(DefaultPasswords.ADMIN) == DeviceErrorCode.STATUS_OK + + @pytest.mark.other def test_export_firmware(C): skip_if_device_version_lower_than({'S': 43}) |