aboutsummaryrefslogtreecommitdiff
path: root/unittest
Commit message (Collapse)AuthorAge
* NitrokeyManager: Also return serial number as u32Robin Krahl2020-04-02
| | | | | | | | | | | | | This patch adds the get_serial_number_as_u32 method to NitrokeyManager. It returns the serial number as a 32-bit unsigned integer. Previously, we only returned it as a string generated from the integer value, get_serial_number. While get_serial_number returns an empty string if no device is connected and "NA" if an unknown model is connected, the new method throws a DeviceNotConnected exception in the first case and returns zero in the second case as we cannot express the three states in one integer return value.
* Add missing skip for lower firmware versionSzczepan Zalega2020-02-26
|
* Data retention test. Refactoring. Helper functions.Szczepan Zalega2020-02-26
|
* Refactor. Allow device reconnection.Szczepan Zalega2020-02-26
|
* Refactor move 2Szczepan Zalega2020-02-26
|
* Refactor moveSzczepan Zalega2020-02-26
|
* Refactor renameSzczepan Zalega2020-02-26
|
* Bootloader data retention testSzczepan Zalega2020-02-26
|
* Skip bootloader activation unless specified by the switchSzczepan Zalega2020-02-26
|
* Rename the actual bootloader switching test to a distinct nameSzczepan Zalega2020-02-26
|
* Change too short password to default, but short of 1 letterSzczepan Zalega2020-02-26
|
* Correct result of successful execution for bootloader to DISCONNECTEDSzczepan Zalega2020-02-26
|
* Add tests for Pro`s bootloaderSzczepan Zalega2020-02-26
|
* Add numbers to generated OTP slot namesSzczepan Zalega2019-06-25
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Cleanup: replace magic numbers. Correct copyright dates.v3.5Szczepan 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_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