Skip to content

Commit

Permalink
Test for constant firmware password
Browse files Browse the repository at this point in the history
  • Loading branch information
szszszsz committed Sep 4, 2021
1 parent 6528fcb commit b29d3ac
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions unittest/test_pro_bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,20 @@ def test_bootloader_data_rention(C):
C = library_device_reconnect(C)
assert helper_check_device_for_data(C)


@pytest.mark.firmware
def test_factory_reset_does_not_change_update_password(C):
"""
Check if factory reset changes the update password, which should not happen
"""
skip_if_device_version_lower_than({'P': 13})
from test_pro import test_factory_reset
# Revert effects of a broken test run, if needed
C.NK_change_firmware_password_pro(DefaultPasswords.UPDATE_TEMP, DefaultPasswords.UPDATE)

# actual test
assert C.NK_change_firmware_password_pro(DefaultPasswords.UPDATE, DefaultPasswords.UPDATE_TEMP) == DeviceErrorCode.STATUS_OK
test_factory_reset(C)
assert C.NK_change_firmware_password_pro(DefaultPasswords.UPDATE, DefaultPasswords.UPDATE_TEMP) == DeviceErrorCode.WRONG_PASSWORD
assert C.NK_change_firmware_password_pro(DefaultPasswords.UPDATE_TEMP, DefaultPasswords.UPDATE) == DeviceErrorCode.STATUS_OK

0 comments on commit b29d3ac

Please sign in to comment.