aboutsummaryrefslogtreecommitdiff
path: root/unittest
Commit message (Collapse)AuthorAge
* Cleanup: replace magic numbers. Correct copyright dates.Szczepan Zalega2019-06-24
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add simple CLI tool to enable firmware update mode on NK StorageSzczepan Zalega2019-06-24
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Collect received OTP codes for all slots and print themSzczepan Zalega2019-06-22
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add another test for reading and writing OTP slotsSzczepan Zalega2019-06-22
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Test writing edge OTP slotsSzczepan Zalega2019-06-22
| | | | | | | This tests encountered bug in the Storage v0.54 RC. Write either TOTP15 or HOTP1, and try to access the other. Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add HOTP counter testsSzczepan Zalega2019-06-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Tests: correct the model gettingSzczepan Zalega2019-06-18
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Extend TOTP time test up to 64 bitsSzczepan Zalega2019-06-14
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Correct binary counter specifierSzczepan Zalega2019-06-14
| | | | | | | Makes the 64bit OTP tests passing on the Pro v0.8+ (instead of being skipped). Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add test for firmware password lengthSzczepan Zalega2019-06-13
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add exclusions to the Pro firmware testsSzczepan Zalega2019-06-13
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Comments: fixmeSzczepan Zalega2019-06-13
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add Python testsSzczepan Zalega2019-06-13
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Fix regex in unittest for pre-releases and git checkoutsDavid Seifert2019-04-26
|
* Unlock 64 bit tests for StorageSzczepan Zalega2019-03-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Storage v0.54: activate tests for OTP320 and binary counterSzczepan Zalega2019-03-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Replace NK_status with NK_get_status_as_string in unit testsRobin Krahl2019-01-29
|
* Add unit test for NK_get_statusRobin Krahl2019-01-29
|
* Correct the skip message for other OS than FedoraSzczepan Zalega2019-01-26
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Detect UV's block device on Fedora automaticallySzczepan Zalega2019-01-26
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Additional check and device/mount printSzczepan Zalega2019-01-26
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Small correction for macOS 10.13.6Szczepan Zalega2019-01-26
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Stress test for firmware export feature on macOSMartin Müller2019-01-26
|
* Add FIXME comments. Make the skip() method descriptive.Szczepan Zalega2019-01-26
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Stress test for firmware export featureSzczepan Zalega2019-01-26
| | | | | | | | Export the firmware multiple times, and test its size. Hardcoded device set to /dev/sde1 Related: https://github.com/Nitrokey/nitrokey-app/issues/399 Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Merge branch 'pr_138' into contributionsSzczepan Zalega2019-01-15
|\ | | | | | | | | | | Improve support for multiple devices Fixes #138
| * Add test for NK_list_devices to test_multiple_deviceswip/multiple-devicesRobin Krahl2019-01-13
| | | | | | | | | | As we cannot test this function properly in Python (due to missing struct definitions), we test it in the C++ test suite.
| * Add test for NK_connect_with_pathRobin Krahl2019-01-13
| | | | | | | | | | As we cannot read the output of NK_list_devices in the Python tests at the moment, this test case uses NK_list_devices_by_cpuID instead.
| * Add simple test for NK_list_devicesRobin Krahl2019-01-13
| | | | | | | | | | | | | | Unfortunately, I cannot test more as the current ffi implementation does not allow me to import struct definitions. Without the definition for the NK_device_info struct, I cannot inspect the result of the NK_list_devices function.
| * Change std::wstring to std::string in DeviceInfoRobin Krahl2019-01-13
| | | | | | | | | | | | | | For easier handling, we should use a std::string instead of std::wstring for the serial number in DeviceInfo. For the conversion, I assume that the serial number is valid UTF-8. As it should be alphanumeric and ASCII only, this should be true.
| * Add test case for NitrokeyManager::connect_with_path to test_multiple_devicesRobin Krahl2019-01-13
| | | | | | | | | | | | The current test case is renamed to “Use Storage API” as it queries the storage status. The new test case, “Use API”, lists all connected devices and prints their model, path and serial number.
| * Add test case for Device::enumerate to test_multiple_devicesRobin Krahl2019-01-13
| | | | | | | | | | | | The current test case is renamed to “List Storage devices” as it also displays the SD card ID. The new test case, “List devices”, lists all connected devices and prints their model, path and serial number.
| * Make Device::enumerate staticRobin Krahl2019-01-13
| | | | | | | | | | | | | | | | | | | | | | Device::enumerate does not need any instance data, therefore it is made static. Note that this not only changes the public API by making the method static. We also return all connected Nitrokey devices instead of only Storage devices. The NitrokeyManager method list_devices_by_cpuID is changed to check the device type so that they still only return Storage devices. The list_device method now returns both Storage and Pro devices.
| * Change Nitrokey::list_devices return type to use DeviceInfoRobin Krahl2019-01-13
| | | | | | | | | | | | In the previous commit, we changed the return value of Device::enumerate to std::vector<DeviceInfo>. Now we change Nitrokey::list_devices to also return DeviceInfo instances.
| * Change Device::enumerate return type to use DeviceInfoRobin Krahl2019-01-13
| | | | | | | | | | | | The return type of Device::enumerate is changed from std::vector<std::string> to std::vector<DeviceInfo> to expose the additional information contained in the DeviceInfo struct.
* | Merge branch 'pr_139' into contributionsSzczepan Zalega2019-01-15
|\ \ | | | | | | | | | | | | | | | Add tqdm to Python's tests requirements Fixes #139
| * | Add tqdm to unittest/requirements.txtfix/python-requirementsRobin Krahl2019-01-13
| |/ | | | | | | | | | | The test_mulitple.py unit test requires tqdm, which is not a dependency of any of the requirements and was not included in the requirements list.
* | CI: install git to get the library version on buildSzczepan Zalega2019-01-15
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* | Add Python offline testsSzczepan Zalega2019-01-15
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* | Use logger instead of bare printingSzczepan Zalega2019-01-15
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* | Add proxy object for logging libnitrokey callsSzczepan Zalega2019-01-15
| | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* | Add support for multiline C definitions in NK_C_API + testSzczepan Zalega2019-01-15
|/ | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Mention potential test failure cause, when no git version is providedSzczepan Zalega2019-01-02
| | | | | | Related to #133 Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add safe to user data C++ tests - test_safe.cppSzczepan Zalega2019-01-02
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Run enabling firmware update mode, but with wrong password onlySzczepan Zalega2018-11-22
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Handle UNKNOWN_ERROR return codeSzczepan Zalega2018-11-22
| | | | | | | | Handle UNKNOWN_ERROR code (introduced in Storage v0.51, firmware commit 687d4aca31ce405db41231be73864ee2f91b3714) and is returned, when device fails to retrieve the AES key. Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Update for compatibility with Catch2 version 2.3.0Tom Hughes2018-07-24
|
* Update Catch to version 2.3.0Tom Hughes2018-07-24
|
* meson: improve generation of vcs_tagIgor Gnatenko2018-07-18
| | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Allow for <patch> field in library version getter testSzczepan Zalega2018-07-18
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>