aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* Update documentation and test for factory_resetRobin Krahl2019-01-04
| | | | | | Contrary to my previous beliefs, build_aes_key has to be called even after a factory reset using the Nitrokey API. This patch updates the documentation and the unit tests based on this insight.
* Add Device::build_aes_key methodRobin Krahl2019-01-03
| | | | | | | | This patch adds the build_aes_key method to the Device trait that uses the NK_build_aes_key function to build new AES keys on the device. This effectively resets the password safe and the encrypted storage. It is unclear whether other data (e. g. the one-time passwords) are affected too.
* Add Device::factory_reset methodRobin Krahl2019-01-03
| | | | | | | This patch adds the factory_reset_method to the Device trait that uses the NK_factory_reset function to perform a factory reset. The tests verify that the user and admin PIN are reset and that the OTP storage and the password safe are deleted.
* Add Storage::change_update_pin methodRobin Krahl2019-01-03
| | | | | | This patch adds the change_update_pin method to the Storage struct that uses the NK_change_update_password function to set the password required for firmware updates.
* Preserve unknown error code valuesDaniel Mueller2019-01-03
| | | | | | | | | | The CommandError::Unknown variant, which is used whenever a reported error code is not known, makes it close to impossible to determine the root cause of, say, a one-off error, because all information explaining what went wrong is discarded. With this change we adjust the Unknown variant to include the error report. In addition, we introduce a new CommandError variant, Undefined, that is used when no error code is available.
* Extend unlock_user_pin testsRobin Krahl2019-01-03
| | | | | | This patch adds a test case that changes the PIN when calling unlock_user_pin. The previous test case only unlocked the current user PIN.
* Add force argument to ConfigureOtp::set_timeRobin Krahl2019-01-02
| | | | | | | | This patch adds the force argument to the set_time method in the ConfigureOtp trait that allows the user to choose whether jumps to the past are allowed when updating the time. It is implemented by using the NK_totp_set_time_soft function. Previously, jumps where unconditionally allowed.
* Fix Storage volume detection for test casesRobin Krahl2018-12-30
| | | | | | It seems that with newer firmeware, the model string in the lsblk output is Nitrokey_Storage instead of Nitrokey Storage. Therefore this patch replaces underscores with spaces to account for both versions.
* Fix formatting using to rustfmtRobin Krahl2018-12-30
|
* Add function Device::get_modelRobin Krahl2018-12-30
| | | | | This patch adds the function Device::get_model that returns the model of the connected Nitrokey stick.
* Remove test-no-device featureRobin Krahl2018-12-16
| | | | | | | Currently, the test-no-device feature is used for tests that expect no Nitrokey to be connected. Yet test-no-device is equivalent to not test-pro and not test-storage. Therefore, this patch removes the test-no-device feature.
* Refactor tests into the top-level tests directoryRobin Krahl2018-12-16
Newer Rust versions support integration tests in a top-level tests directory. This patch refactors the existing unit tests into integration tests.