mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-01 19:42:07 +08:00
safer modem manager commands (#25999)
Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: 1f5187892f0854bbc6a7d7799fa0d9ca2284714a
This commit is contained in:
@@ -88,7 +88,7 @@ def try_setup_logs(diag, log_types):
|
||||
def mmcli(cmd: str) -> None:
|
||||
for _ in range(5):
|
||||
try:
|
||||
subprocess.check_call(f"mmcli -m 0 {cmd}", shell=True)
|
||||
subprocess.check_call(f"mmcli -m any --timeout 30 {cmd}", shell=True)
|
||||
break
|
||||
except subprocess.CalledProcessError:
|
||||
cloudlog.exception("rawgps.mmcli_command_failed")
|
||||
@@ -151,7 +151,7 @@ def main() -> NoReturn:
|
||||
# wait for ModemManager to come up
|
||||
cloudlog.warning("waiting for modem to come up")
|
||||
while True:
|
||||
ret = subprocess.call("mmcli -m 0 --location-status", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, shell=True)
|
||||
ret = subprocess.call("mmcli -m any --timeout 10 --location-status", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, shell=True)
|
||||
if ret == 0:
|
||||
break
|
||||
time.sleep(0.1)
|
||||
|
||||
@@ -40,7 +40,7 @@ class TestRawgpsd(unittest.TestCase):
|
||||
time.sleep(s)
|
||||
managed_processes['rawgpsd'].stop()
|
||||
|
||||
ls = subprocess.check_output("mmcli -m 0 --location-status --output-json", shell=True, encoding='utf-8')
|
||||
ls = subprocess.check_output("mmcli -m any --location-status --output-json", shell=True, encoding='utf-8')
|
||||
loc_status = json.loads(ls)
|
||||
assert set(loc_status['modem']['location']['enabled']) <= {'3gpp-lac-ci'}
|
||||
|
||||
|
||||
@@ -480,7 +480,7 @@ class Tici(HardwareBase):
|
||||
|
||||
# blue prime config
|
||||
if sim_id.startswith('8901410'):
|
||||
os.system('mmcli -m 0 --3gpp-set-initial-eps-bearer-settings="apn=Broadband"')
|
||||
os.system('mmcli -m any --3gpp-set-initial-eps-bearer-settings="apn=Broadband"')
|
||||
|
||||
def get_networks(self):
|
||||
r = {}
|
||||
|
||||
Reference in New Issue
Block a user