Nitrokey / nitrokey-websmartcard-tests

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

NFC, FIDO2: Transaction failed #7

Open robin-nitrokey opened 1 year ago

robin-nitrokey commented 1 year ago

When running the FIDO2 test suite over NFC, the run fails after approx. 2/3 of the tests – e. g. at test_initialize or test_restore – with a Transaction failed error. I also encountered this error in my previous tests occasionally without being able to narrow it down.

Environment:

report

szszszsz commented 1 year ago

Can you try running setup_session and the failed tests then?

szszszsz commented 1 year ago

Perhaps it's worth making the test_suite working with https://pypi.org/project/pytest-randomly/

robin-nitrokey commented 1 year ago

Another run, nearly made it:

Full run

======================================= short test summary info ========================================
FAILED test_comm.py::test_pin_set - smartcard.Exceptions.CardConnectionException: Failed to transmit ...
FAILED test_comm.py::test_pin_change - fido2.ctap.CtapError: CTAP error: 0x7F - OTHER                   
FAILED test_comm.py::test_configure - fido2.ctap.CtapError: CTAP error: 0x7F - OTHER                    
==================================== 3 failed, 66 passed in 34.66s =====================================

webcrypt-fido2-nfc-1.zip

Reduced run

env REAL_HARDWARE=1 TRANSPORT=FIDO2 pipenv run pytest --hardware test_comm.py --template=html1/index.html --report=report-fido2.html -k "test_setup_session or test_pin_set"
====================================== short test summary info ========================================
FAILED test_comm.py::test_pin_set - smartcard.Exceptions.CardConnectionException: Failed to transmit ...
============================== 1 failed, 2 passed, 66 deselected in 1.77s ==============================

webcrypt-fido2-nfc-2.zip

robin-nitrokey commented 1 year ago

Observation: The Transaction failed error always occurs if logging is enabled, so it might be due to a timeout.

robin-nitrokey commented 1 year ago

Can no longer reproduce, see #9 for an example run over NFC without failures (except for one outdated test case).

robin-nitrokey commented 1 year ago

Still occurs occasionally.