/nitrokey-webcrypt-tests

A Python test suite for Nitrokey Webcrypt features

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

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:

  • env REAL_HARDWARE=1 TRANSPORT=FIDO2 for FIDO2 transport
  • env REAL_HARDWARE=1 TRANSPORT=U2F for U2F transport

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