Skip to content

Commit e5ebcab

Browse files
committed
support reboot command for latest solo fw and better testing
1 parent 0a97adc commit e5ebcab

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

‎tests/conftest.py‎

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,15 @@ def find_device(self, nfcInterfaceOnly=False):
148148
dev = None
149149
self.nfc_interface_only = nfcInterfaceOnly
150150
if not nfcInterfaceOnly:
151-
print("--- HID ---")
152-
print(list(CtapHidDevice.list_devices()))
151+
# print("--- HID ---")
152+
# print(list(CtapHidDevice.list_devices()))
153153
dev = next(CtapHidDevice.list_devices(), None)
154154

155155
if not dev:
156156
from fido2.pcsc import CtapPcscDevice
157157

158-
print("--- NFC ---")
159-
print(list(CtapPcscDevice.list_devices()))
158+
# print("--- NFC ---")
159+
# print(list(CtapPcscDevice.list_devices()))
160160
dev = next(CtapPcscDevice.list_devices(), None)
161161
if dev:
162162
self.is_nfc = True
@@ -190,9 +190,24 @@ def reboot(self,):
190190
self.find_device(self.nfc_interface_only)
191191
return
192192

193-
print("Please reboot authenticator and hit enter")
194-
input()
195-
self.find_device(self.nfc_interface_only)
193+
if 'solokeys' in sys.argv:
194+
try:
195+
self.dev.call(0x53 ^ 0x80,b'')
196+
except OSError:
197+
pass
198+
199+
print('Rebooting..')
200+
for _ in range(0,8):
201+
time.sleep(0.1)
202+
try:
203+
self.find_device(self.nfc_interface_only)
204+
return
205+
except RuntimeError:
206+
pass
207+
else:
208+
print("Please reboot authenticator and hit enter")
209+
input()
210+
self.find_device(self.nfc_interface_only)
196211

197212
def send_data(self, cmd, data):
198213
if not isinstance(data, bytes):

0 commit comments

Comments
 (0)