add nfc test force flag
This commit is contained in:
parent
b42e990f67
commit
b41cd5d5b8
@ -19,7 +19,9 @@ from tests import Tester, FIDO2Tests, U2FTests, HIDTests, SoloTests
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
print("Usage: %s [sim] <[u2f]|[fido2]|[rk]|[hid]|[ping]>")
|
print("Usage: %s [sim] [nfc] <[u2f]|[fido2]|[rk]|[hid]|[ping]>")
|
||||||
|
print(" sim - test via UDP simulation backend only")
|
||||||
|
print(" nfc - test via NFC interface only")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
t = Tester()
|
t = Tester()
|
||||||
@ -31,7 +33,11 @@ if __name__ == "__main__":
|
|||||||
t.set_sim(True)
|
t.set_sim(True)
|
||||||
t.set_user_count(10)
|
t.set_user_count(10)
|
||||||
|
|
||||||
t.find_device()
|
nfcOnly = False
|
||||||
|
if "nfc" in sys.argv:
|
||||||
|
nfcOnly = True
|
||||||
|
|
||||||
|
t.find_device(nfcOnly)
|
||||||
|
|
||||||
if "solo" in sys.argv:
|
if "solo" in sys.argv:
|
||||||
SoloTests(t).run()
|
SoloTests(t).run()
|
||||||
|
@ -62,10 +62,13 @@ class Tester:
|
|||||||
self.ctap1 = tester.ctap1
|
self.ctap1 = tester.ctap1
|
||||||
self.client = tester.client
|
self.client = tester.client
|
||||||
|
|
||||||
def find_device(self,):
|
def find_device(self, nfcInterfaceOnly = False):
|
||||||
print("--- HID ---")
|
dev = None
|
||||||
print(list(CtapHidDevice.list_devices()))
|
if not nfcInterfaceOnly:
|
||||||
dev = next(CtapHidDevice.list_devices(), None)
|
print("--- HID ---")
|
||||||
|
print(list(CtapHidDevice.list_devices()))
|
||||||
|
dev = next(CtapHidDevice.list_devices(), None)
|
||||||
|
|
||||||
if not dev:
|
if not dev:
|
||||||
try:
|
try:
|
||||||
from fido2.pcsc import CtapPcscDevice
|
from fido2.pcsc import CtapPcscDevice
|
||||||
|
Loading…
x
Reference in New Issue
Block a user