mirror of
https://github.com/trussed-dev/fido2-tests.git
synced 2026-06-20 04:16:30 -07:00
support reboot command for latest solo fw and better testing
This commit is contained in:
+22
-7
@@ -148,15 +148,15 @@ class TestDevice:
|
||||
dev = None
|
||||
self.nfc_interface_only = nfcInterfaceOnly
|
||||
if not nfcInterfaceOnly:
|
||||
print("--- HID ---")
|
||||
print(list(CtapHidDevice.list_devices()))
|
||||
# print("--- HID ---")
|
||||
# print(list(CtapHidDevice.list_devices()))
|
||||
dev = next(CtapHidDevice.list_devices(), None)
|
||||
|
||||
if not dev:
|
||||
from fido2.pcsc import CtapPcscDevice
|
||||
|
||||
print("--- NFC ---")
|
||||
print(list(CtapPcscDevice.list_devices()))
|
||||
# print("--- NFC ---")
|
||||
# print(list(CtapPcscDevice.list_devices()))
|
||||
dev = next(CtapPcscDevice.list_devices(), None)
|
||||
if dev:
|
||||
self.is_nfc = True
|
||||
@@ -190,9 +190,24 @@ class TestDevice:
|
||||
self.find_device(self.nfc_interface_only)
|
||||
return
|
||||
|
||||
print("Please reboot authenticator and hit enter")
|
||||
input()
|
||||
self.find_device(self.nfc_interface_only)
|
||||
if 'solokeys' in sys.argv:
|
||||
try:
|
||||
self.dev.call(0x53 ^ 0x80,b'')
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
print('Rebooting..')
|
||||
for _ in range(0,8):
|
||||
time.sleep(0.1)
|
||||
try:
|
||||
self.find_device(self.nfc_interface_only)
|
||||
return
|
||||
except RuntimeError:
|
||||
pass
|
||||
else:
|
||||
print("Please reboot authenticator and hit enter")
|
||||
input()
|
||||
self.find_device(self.nfc_interface_only)
|
||||
|
||||
def send_data(self, cmd, data):
|
||||
if not isinstance(data, bytes):
|
||||
|
||||
Reference in New Issue
Block a user