Nitrokey / nitrokey-websmartcard-tests

A Python test suite for Nitrokey Webcrypt features
GNU General Public License v3.0
1 stars 2 forks source link
nitrokey nitrokey-webcrypt nitrokey-websmartcard

Nitrokey Webcrypt Tests

Setting up

Tests

  1. Python 3.10 with pipenv

To install Python dependencies for this project only it suffices to call:

pipenv install

Building simulation

Please refer to the main project readme for details:

Running tests

Simulation

It is possible to test the implementation using simulation without the actual hardware. The process and tests communicate via UDP.

Running

Please refer to the main project readme for details regarding how to run the UDP simulation:

Running actual tests:

pipenv run pytest test_comm.py

Same, but write live logs to output:

pipenv run pytest test_comm.py  -svx --log-cli-level=DEBUG

Hardware

Similarly to the simulation case, but with --hardware switch and additional environment variables:

E.g. for the U2F transport:

env REAL_HARDWARE=1 TRANSPORT=U2F pipenv run pytest --hardware test_comm.py

CI

For the CI use a Makefile is prepared, which automatically setups and runs both the simulation and tests. The UDP simulation has to be executed before that. Execution:

make