mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 17:03:56 +08:00
* zookeeper lib * add ft4222 to dev pip packages and fix include error * started on CI * it's a file * now it should be happy * use docker for all on-device tests * test scripts * does this work? * access to devices * too broad. only usb enough? * permissions for zookeeper usb * as env var maybe? * this? * try this for now * all devices * move to correct location for impoerts * right paths * not running in the right agent? * ofc not * fix broken merge * add ft4222 package again * add timeout * power monitor * cleanup Co-authored-by: Batman <batman@openpilot-ci.internal> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
26 lines
455 B
Python
Executable File
26 lines
455 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import os
|
|
import sys
|
|
import time
|
|
from tools.zookeeper import Zookeeper
|
|
|
|
z = Zookeeper()
|
|
z.set_device_power(True)
|
|
|
|
def is_online(ip):
|
|
return (os.system(f"ping -c 1 {ip} > /dev/null") == 0)
|
|
|
|
ip = str(sys.argv[1])
|
|
timeout = int(sys.argv[2])
|
|
start_time = time.time()
|
|
while not is_online(ip):
|
|
print(f"{ip} not online yet!")
|
|
|
|
if time.time() - start_time > timeout:
|
|
print("Timed out!")
|
|
raise TimeoutError()
|
|
|
|
time.sleep(1)
|
|
|