mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-07-09 16:52:05 +08:00
3668cf59c6
* test * executable * wait for sound card * check that too * update --------- Co-authored-by: Comma Device <device@comma.ai>
31 lines
788 B
Python
Executable File
31 lines
788 B
Python
Executable File
#!/usr/bin/env python3
|
|
import os
|
|
import time
|
|
import subprocess
|
|
|
|
good = """
|
|
Starting Sound...
|
|
[INFO] Bringing adsp out of reset
|
|
subsys4
|
|
waiting for sound card to come online
|
|
sound card online
|
|
sound.service: Succeeded.
|
|
Finished Sound.
|
|
""".strip()
|
|
|
|
if __name__ == "__main__":
|
|
time.sleep(3)
|
|
log = subprocess.check_output("journalctl -o cat -u sound", shell=True, encoding='utf8').strip()
|
|
passed = log == good
|
|
with open('/data/tmp/sound_log', 'a') as f:
|
|
f.write(f"{passed}\n")
|
|
|
|
os.system("journalctl -u sound.service -o short-monotonic >> /data/tmp/sound_service_log")
|
|
os.system("sudo su -c 'tail /data/tmp/sound_log > /dev/console'")
|
|
os.system("sudo su -c 'wc -l /data/tmp/sound_log > /dev/console'")
|
|
os.sync()
|
|
|
|
if passed:
|
|
time.sleep(2)
|
|
os.system("sudo reboot")
|