aboutsummaryrefslogtreecommitdiff
path: root/unittest
Commit message (Collapse)AuthorAge
* Add unit test for NK_get_statusRobin Krahl2019-01-28
|
* 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>
* Merge branch 'pr_116'Szczepan Zalega2018-07-07
|\ | | | | | | | | | | Allow to connect to device with model specified by enum. Fixes #116
| * Replace *out function parameter with return valueSzczepan Zalega2018-06-20
| | | | | | | | | | | | | | Using return value instead of memory manipulation seem to be cleaner solution and less error prone due to avoiding pointer usage. Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| * Expose device model in C APIRobin Krahl2018-05-25
| | | | | | | | | | | | | | | | | | The C++ API already provides access to the model of the connected device in NitrokeyManager::get_connected_device_model(). This patch also exposes this information in the C API by adding NK_get_device_model. As there might be no device connected, the function returns a boolean indicating the connection status and writes the model of the connected device to a pointer passed as an argument.
* | Add a test to ensure valid C code in the C APIRobin Krahl2018-07-05
| | | | | | | | | | | | | | | | | | | | All current tests are written in C++. Therefore C++-only code in the C API might not be detected by the tests. This patch adds a minimal test written in C that only includes the C API header. This should make sure that the C API code is valid. The new test is called `test_minimal.c` and is added to the CMake COMPILE_OFFLINE_TESTS option.
* | Merge branch 'pr_123'Szczepan Zalega2018-06-22
|\ \ | | | | | | | | | | | | | | | Fix version getter test Closes #123
| * | Fix unit test for get_library_version for release commitsRobin Krahl2018-06-21
| | | | | | | | | | | | | | | | | | | | | `git describe` may return a tag name or <tag>-<n>-g<hash>, where <n> is the number of commits since the last tag <tag> and <hash> is the hash of the current commit. The current test case only considers the latter case. This patch adds a regular expression to handle both cases.
* | | Merge branch 'pr_115'Szczepan Zalega2018-06-20
|\ \ \ | |/ / |/| | | | | | | | | | | Fix connect() return value in offline mode Fixes #115
| * | Add extended test for the connect() return value in offline modeSzczepan Zalega2018-06-20
| | | | | | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* | | Add offline test for version getterSzczepan Zalega2018-06-19
| | | | | | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* | | Skip test for devices with firmware lower than v0.9Szczepan Zalega2018-05-24
| | | | | | | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* | | Add authorization testsSzczepan Zalega2018-05-21
|/ / | | | | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* / Fix include path for NK_C_API.h in test_strdup.cppRobin Krahl2018-05-19
|/
* Implement suggested testsSzczepan Zalega2018-04-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Fix compilation warnings for testsSzczepan Zalega2018-04-19
| | | | | | | Cleanup CMakeList a bit as well. Fixes #97 Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Tests: skip reading custom-type based function headerSzczepan Zalega2018-04-10
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Null-terminate the argument for strtoulRobin Krahl2018-04-10
| | | | | | As discussed in issue #95, the buffer passed to strtoul must be null-terminated. This patch null-terminates the buffer used in hexStringToByte in the test_HOTP unit test to avoid a buffer over-read.
* Add missing licensesSzczepan Zalega2018-03-13
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>