{"id":22253545,"url":"https://github.com/nitrokey/nitrokey-3-tests","last_synced_at":"2026-01-23T09:05:22.257Z","repository":{"id":140180927,"uuid":"576688233","full_name":"Nitrokey/nitrokey-3-tests","owner":"Nitrokey","description":"Automated tests for the Nitrokey 3","archived":false,"fork":false,"pushed_at":"2024-10-21T11:55:49.000Z","size":117,"stargazers_count":3,"open_issues_count":14,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-21T16:22:29.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nitrokey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES/CC0-1.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-10T16:54:27.000Z","updated_at":"2024-10-21T11:55:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"c889147f-88a2-43de-bf7d-d95428a7d829","html_url":"https://github.com/Nitrokey/nitrokey-3-tests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitrokey%2Fnitrokey-3-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitrokey%2Fnitrokey-3-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitrokey%2Fnitrokey-3-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitrokey%2Fnitrokey-3-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nitrokey","download_url":"https://codeload.github.com/Nitrokey/nitrokey-3-tests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227870138,"owners_count":17832326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T07:18:52.311Z","updated_at":"2026-01-23T09:05:22.222Z","avatar_url":"https://github.com/Nitrokey.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nCopyright (C) 2022 Nitrokey GmbH\nSPDX-License-Identifier: CC0-1.0\n--\u003e\n\n# nitrokey-3-tests\n\n## Quickstart\n\nMake sure that the `vhci-hcd` kernel module is loaded:\n```\n# lsmod | grep vhci_hcd || modprobe vhci-hcd\n```\n\nUse the `test-release.sh` script to download and test the usbip binaries from a GitHub release of the [`nitrokey-3-firmware`][] repository:\n```\n$ ./test-release.sh v1.3.0-rc.1\n```\n\nIf you pass a second version, it will also run upgrade tests from that version:\n```\n$ ./test-release.sh v1.3.0-rc.1 v1.2.2-alpha.20230224\n```\n\nUse the `test-local.sh` script to compile the usbip runner from a local Git checkout of the [`nitrokey-3-firmware`][] repository instead:\n```\n$ ./test-local.sh ../nitrokey-3-firmware\n```\n\nIf you have a clean Git checkout, you can also enable upgrade tests from an old commit:\n```\n$ ./test-local.sh ../nitrokey-3-firmware v1.3.0\n```\nThis will build the new firmware from `HEAD` and the old firmware from the specified revision or tag.\n\n[`nitrokey-3-firmware`]: https://github.com/Nitrokey/nitrokey-3-firmware\n\n## Using the Makefile\n\nIf you want to use the Makefile to run the tests, you have to provide the `usbip-runner` and `usbip-provisioner` binaries in the `bin` directory, for example by building them from source.  See the `test-local.sh` script for insipration.  If you want to execute the upgrade tests, you also have to provide the `usbip-runner-old` and `usbip-provisioner-old` binaries for the firmware version to upgrade from.\n\nThese are the most useful targets in the Makefile:\n\n- Lint the test code and run all tests in a docker container:\n  ```\n  $ make\n  ```\n- Run all tests in a docker container:\n  ```\n  $ make run-docker\n  ```\n- Run all tests locally (may require root privileges for usbip):\n  ```\n  $ make run\n  ```\n- Lint the test code:\n  ```\n  $ make check\n  ```\n\n## Configuration\n\nThe flags passed to `pytest` can be extended by setting the `PYTEST_FLAGS` environment variable.\n\n### Upgrade tests\n\nTo enable upgrade tests, set the `--upgrade` flag.  This only works with virtual devices and requires the `usbip-runner-old` and `usbip-provisioner-old` binaries.\n\n### Device selection\n\nPer default, the tests use a usbip simulation of a Nitrokey 3 device. If you want to use them with a real Nitrokey 3 device connected to your computer:\n* set `--use-usb-devices [uuid1] [uuid2] ... [uuidN]` (using `PYTEST_FLAGS`) option with the UUIDs to whitelist for testing\n* disable the tests with the `virtual` mark with the `-m \"not virtual\"` option\n\nThere also is a shortcut for this: \n* create a `variables.mk` with the variable: `ALLOWED_UUIDS` which will be used for `--use-usb-devices`\n* use `make run-hw` to run the tests on *one* of the `ALLOWED_UUIDS`\n  * you can pass `PYTEST_EXTRA` to the `make` call to call pytest with these extra arguments\n\n\n**Warning:** The test suite will perform destructive changes like setting a PIN or resetting the device.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitrokey%2Fnitrokey-3-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitrokey%2Fnitrokey-3-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitrokey%2Fnitrokey-3-tests/lists"}