Commit 38416a30 authored by Guido Gunther's avatar Guido Gunther
Browse files

pytests: Check if modem is visible to alsa

parent c74723de
......@@ -11,3 +11,10 @@ def test_modem_modem_manager():
"Test if modem manager picked up the modem"
out = subprocess.check_output(["mmcli", "-m", "0"])
assert(b"model: SIMCOM_SIM7100" in out)
def test_modem_alsa():
"Test if the modem is seen by alsa"
out = subprocess.run(["aplay", "-l"], capture_output=True)
assert(out.returncode == 0)
assert(b": SIM7100 [SIMCom SIM7100]" in out.stdout)
import os
import subprocess
def read_or_unknown(path):
if os.path.exists(path):
return open(path).read().strip()
else:
return "(unknown)"
def pytest_report_header(config):
gitrev_log = '/var/log/gitrev.log'
dt_model = '/sys/firmware/devicetree/base/model'
model = read_or_unknown(dt_model)
kernel = subprocess.check_output(["uname", "-a"]).decode('utf-8').strip()
img_gitrev = read_or_unknown(gitrev_log)
return """
model: {}
kernel: {}
image gitrev: {}
""".format(model, kernel, img_gitrev)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment