diff options
| author | Szczepan Zalega <szczepan@nitrokey.com> | 2016-12-09 11:13:20 +0100 | 
|---|---|---|
| committer | Szczepan Zalega <szczepan@nitrokey.com> | 2016-12-09 14:06:49 +0100 | 
| commit | b78c28cb133bd00024416d8ad69740040c91d589 (patch) | |
| tree | 68ba60f544b595ed3ba746f20032f5438cffc816 /unittest | |
| parent | 7c432494269144fa9777266834fd5b88b4fe1b90 (diff) | |
| download | libnitrokey-b78c28cb133bd00024416d8ad69740040c91d589.tar.gz libnitrokey-b78c28cb133bd00024416d8ad69740040c91d589.tar.bz2 | |
Enable factory reset test for Nitrokey Storage. Comments.
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
| -rw-r--r-- | unittest/test_pro.py | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/unittest/test_pro.py b/unittest/test_pro.py index 6b47c9f..3282436 100644 --- a/unittest/test_pro.py +++ b/unittest/test_pro.py @@ -476,8 +476,6 @@ def test_read_write_config(C):  def test_factory_reset(C): -    if is_storage(C): -        pytest.skip('Recovery not implemented for NK Storage')      C.NK_set_debug(True)      assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK      assert C.NK_write_config(255, 255, 255, False, True, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK @@ -494,6 +492,8 @@ def test_factory_reset(C):      assert C.NK_build_aes_key(DefaultPasswords.ADMIN) == DeviceErrorCode.STATUS_OK      assert C.NK_enable_password_safe(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK      assert C.NK_lock_device() == DeviceErrorCode.STATUS_OK +    if is_storage(C): +        C.NK_clear_new_sd_card_warning(DefaultPasswords.ADMIN)  def test_get_status(C): @@ -573,6 +573,10 @@ def test_HOTP_slots_read_write_counter(C, counter):  @pytest.mark.parametrize("period", [30,60] )  @pytest.mark.parametrize("time", range(21,70,20) )  def test_TOTP_slots_read_write_at_time_period(C, time, period): +    """ +    Write to all TOTP slots with specified period, read code at specified time +    and compare with 3rd party +    """      secret = RFC_SECRET      oath = pytest.importorskip("oath")      lib_at = lambda t: oath.totp(RFC_SECRET, t=t, period=period) | 
